Initial import
This commit is contained in:
parent
0c865416ca
commit
04804b89a9
279 changed files with 12945 additions and 0 deletions
46
SalesCatalog/Model/TextInput.cs
Normal file
46
SalesCatalog/Model/TextInput.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
|
||||
namespace SalesCatalog.Model
|
||||
{
|
||||
public class TextInput:FormInput
|
||||
{
|
||||
public TextInput ()
|
||||
{
|
||||
}
|
||||
public TextInput (string txt)
|
||||
{
|
||||
text = txt;
|
||||
}
|
||||
string text = null;
|
||||
|
||||
|
||||
public static implicit operator string(TextInput t)
|
||||
{
|
||||
return t.text;
|
||||
}
|
||||
public static implicit operator TextInput(string t)
|
||||
{
|
||||
return new TextInput(t);
|
||||
}
|
||||
public string DefaultValue {
|
||||
get {
|
||||
return text;
|
||||
}
|
||||
set {
|
||||
text = (string) value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool multiline = false;
|
||||
public bool MultiLine { get { return multiline; } set { multiline = value; } }
|
||||
|
||||
public override string ToHtml ()
|
||||
{
|
||||
|
||||
return MultiLine?
|
||||
string.Format ("<textarea id=\"{0}\" name=\"{1}\">{2}</textarea>", Id,Name,DefaultValue)
|
||||
: string.Format ("<input type=\"text\" id=\"{0}\" name=\"{1}\" value=\"{2}\"/>", Id,Name,DefaultValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue