Added a "Type" property to form inputs.
Fixed the second "title" section found in web page heads.
This commit is contained in:
@ -7,12 +7,23 @@ namespace SalesCatalog.Model
|
||||
public CheckBox ()
|
||||
{
|
||||
}
|
||||
|
||||
#region implemented abstract members of FormInput
|
||||
|
||||
|
||||
public override string Type {
|
||||
get {
|
||||
return "checkbox";
|
||||
}
|
||||
}
|
||||
|
||||
public bool Value { get; set; }
|
||||
|
||||
public override string ToHtml ()
|
||||
{
|
||||
return string.Format ("<input type=\"checkbox\" id=\"{0}\" name=\"{1}\" {2}/>", Id,Name,Value?"checked":"");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,13 @@ namespace SalesCatalog.Model
|
||||
{
|
||||
public class FilesInput : FormInput
|
||||
{
|
||||
#region implemented abstract members of FormInput
|
||||
public override string Type {
|
||||
get {
|
||||
return "file";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public FilesInput ()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace SalesCatalog.Model
|
||||
|
||||
public string Id { get; set; }
|
||||
private string name=null;
|
||||
public abstract string Type { get; }
|
||||
public string Name { get { return name == null ? Id : name; } set { name = value; } }
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,16 @@ namespace SalesCatalog.Model
|
||||
{
|
||||
public class RadioButton:FormInput
|
||||
{
|
||||
#region implemented abstract members of FormInput
|
||||
|
||||
public override string Type {
|
||||
get {
|
||||
return "radio";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public RadioButton ()
|
||||
{
|
||||
}
|
||||
|
@ -6,6 +6,16 @@ namespace SalesCatalog.Model
|
||||
{
|
||||
public class SelectInput: FormInput
|
||||
{
|
||||
#region implemented abstract members of FormInput
|
||||
|
||||
public override string Type {
|
||||
get {
|
||||
return "select";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public Option[] Items;
|
||||
public int SelectedIndex;
|
||||
public override string ToHtml ()
|
||||
|
@ -4,9 +4,18 @@ namespace SalesCatalog.Model
|
||||
{
|
||||
public class TextInput:FormInput
|
||||
{
|
||||
#region implemented abstract members of FormInput
|
||||
public override string Type {
|
||||
get {
|
||||
return "text";
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public TextInput ()
|
||||
{
|
||||
}
|
||||
|
||||
public TextInput (string txt)
|
||||
{
|
||||
text = txt;
|
||||
|
Reference in New Issue
Block a user