Exemplo n.º 1
0
 public WebButton(string name, string caption, CommonData.ButtonCategory category, CommonData.ButtonWebType type)
 {
     base.Name           = name.Contains("btn") ? name : this._frefixButton + name;
     base.ButtonCategory = category;
     base.Caption        = caption;
     base.ButtonType     = type;
     base.IconName       = this.GetDefaultIcon(category);
 }
Exemplo n.º 2
0
 public WebButton(HtmlHelper helper, string name, string caption, CommonData.ButtonCategory category, CommonData.ButtonWebType type, object htmlAttributes)
 {
     base.Helper         = helper;
     base.Name           = this._frefixButton + name;
     base.ButtonCategory = category;
     base.Caption        = caption;
     base.ButtonType     = type;
     base.IconName       = this.GetDefaultIcon(category);
     base.HtmlAttributes = htmlAttributes;
 }
Exemplo n.º 3
0
 public static WebButton IvsButton(this HtmlHelper helper, string name, CommonData.ButtonCategory category, CommonData.ButtonWebType type)
 {
     return(new WebButton(helper, name, category, type));
 }
Exemplo n.º 4
0
 public static WebButton IvsButton(this HtmlHelper helper, string name, string caption, CommonData.ButtonCategory category)
 {
     return(new WebButton(helper, name, caption, category));
 }
Exemplo n.º 5
0
 public static WebButton IvsButton(this HtmlHelper helper, string name, string caption, CommonData.ButtonCategory category, CommonData.ButtonWebType type, object htmlAttribtes)
 {
     return(new WebButton(helper, name, caption, category, type, htmlAttribtes));
 }
Exemplo n.º 6
0
 public WebBaseButton SetCategory(CommonData.ButtonCategory category)
 {
     this.ButtonCategory = category;
     return(this);
 }
Exemplo n.º 7
0
 public WebButton(CommonData.ButtonCategory category)
     : this(category, CommonData.ButtonWebType.button)
 {
 }
Exemplo n.º 8
0
 public WebButton(string name, CommonData.ButtonCategory category, CommonData.ButtonWebType type)
     : this(name, CommonData.StringEmpty, category, type)
 {
 }
Exemplo n.º 9
0
 public WebButton(string name, string caption, CommonData.ButtonCategory category)
     : this(name, caption, category, CommonData.ButtonWebType.button)
 {
 }
Exemplo n.º 10
0
 public WebButton(HtmlHelper helper, string name, CommonData.ButtonCategory category, CommonData.ButtonWebType type)
     : this(helper, name, CommonData.StringEmpty, category, type)
 {
 }
Exemplo n.º 11
0
        private string GetDefaultEvent(CommonData.ButtonCategory category)
        {
            string result = CommonData.StringEmpty;

            switch (category)
            {
            case CommonData.ButtonCategory.Add:
                result = "addData();";
                break;

            case CommonData.ButtonCategory.Edit:
                result = "editData();";
                break;

            case CommonData.ButtonCategory.Copy:
                result = "copyData();";
                break;

            case CommonData.ButtonCategory.Detail:
                result = "detailData();";
                break;

            case CommonData.ButtonCategory.Delete:
                result = "deleteData();";
                break;

            case CommonData.ButtonCategory.Search:
                //result = "onclick = 'deleteData()';";
                break;

            case CommonData.ButtonCategory.Export:
                //result = "onclick = 'deleteData()';";
                break;

            case CommonData.ButtonCategory.Print:
                result = "printData();";
                break;

            case CommonData.ButtonCategory.Close:
                //result = "onclick = 'deleteData()';";
                break;

            case CommonData.ButtonCategory.Save:
                result = "saveData();";
                break;

            case CommonData.ButtonCategory.SaveAndNext:
                result = "saveAndNextData();";
                break;

            case CommonData.ButtonCategory.Back:
                result = "backData();";
                break;

            case CommonData.ButtonCategory.Import:
                result = "importData();";
                break;

            case CommonData.ButtonCategory.Refresh:
                result = "refreshData();";
                break;

            case CommonData.ButtonCategory.Yes:
                //result = "onclick = 'deleteData()';";
                break;

            case CommonData.ButtonCategory.No:
                //result = "glyphicon-remove";
                break;

            case CommonData.ButtonCategory.Ok:
                //result = "glyphicon-ok";
                break;

            case CommonData.ButtonCategory.Cancel:
                //result = "glyphicon-off";
                break;

            case CommonData.ButtonCategory.Default:
                break;

            default:
                break;
            }

            return(result);
        }
Exemplo n.º 12
0
 public WebButton(HtmlHelper helper, string name, CommonData.ButtonCategory category)
     : this(helper, name, category, CommonData.ButtonWebType.button)
 {
 }
Exemplo n.º 13
0
        private string GetDefaultIcon(CommonData.ButtonCategory category)
        {
            string iconName = CommonData.StringEmpty;

            switch (category)
            {
            case CommonData.ButtonCategory.Add:
                iconName = "glyphicon-plus";
                break;

            case CommonData.ButtonCategory.Edit:
                iconName = "glyphicon-edit";
                break;

            case CommonData.ButtonCategory.Copy:
                iconName = "glyphicon-repeat";
                break;

            case CommonData.ButtonCategory.Detail:
                iconName = "glyphicon-pencil";
                break;

            case CommonData.ButtonCategory.Delete:
                iconName = "glyphicon-remove";
                break;

            case CommonData.ButtonCategory.Search:
                iconName = "glyphicon-search";
                break;

            case CommonData.ButtonCategory.Export:
                iconName = "glyphicon-export";
                break;

            case CommonData.ButtonCategory.Print:
                iconName = "glyphicon-print";
                break;

            case CommonData.ButtonCategory.Close:
                iconName = "glyphicon-off";
                break;

            case CommonData.ButtonCategory.Save:
                iconName = "glyphicon-saved";
                break;

            case CommonData.ButtonCategory.SaveAndNext:
                iconName = "glyphicon-log-in";
                break;

            case CommonData.ButtonCategory.Back:
                iconName = "glyphicon-circle-arrow-left";
                break;

            case CommonData.ButtonCategory.Import:
                iconName = "glyphicon-import";
                break;

            case CommonData.ButtonCategory.Refresh:
                iconName = "glyphicon-refresh";
                break;

            case CommonData.ButtonCategory.Yes:
                iconName = "glyphicon-ok";
                break;

            case CommonData.ButtonCategory.No:
                iconName = "glyphicon-remove";
                break;

            case CommonData.ButtonCategory.Ok:
                iconName = "glyphicon-ok";
                break;

            case CommonData.ButtonCategory.Cancel:
                iconName = "glyphicon-off";
                break;

            case CommonData.ButtonCategory.Default:
                break;

            default:
                break;
            }

            return(iconName);
        }
Exemplo n.º 14
0
        private string GetDefaultCation(CommonData.ButtonCategory category)
        {
            string caption = CommonData.StringEmpty;

            switch (category)
            {
            case CommonData.ButtonCategory.Add:
                caption = I18n.GetMessage("COM_LBL_ADD");
                break;

            case CommonData.ButtonCategory.Edit:
                caption = I18n.GetMessage("COM_LBL_EDIT");
                break;

            case CommonData.ButtonCategory.Copy:
                caption = I18n.GetMessage("COM_LBL_COPY");
                break;

            case CommonData.ButtonCategory.Detail:
                caption = I18n.GetMessage("COM_LBL_DETAIL");
                break;

            case CommonData.ButtonCategory.Delete:
                caption = I18n.GetMessage("COM_LBL_DELETE");
                break;

            case CommonData.ButtonCategory.Search:
                caption = I18n.GetMessage("COM_LBL_SEARCH");
                break;

            case CommonData.ButtonCategory.Export:
                caption = I18n.GetMessage("COM_LBL_EXPORT");
                break;

            case CommonData.ButtonCategory.Print:
                caption = I18n.GetMessage("COM_LBL_PRINT");
                break;

            case CommonData.ButtonCategory.Close:
                caption = I18n.GetMessage("COM_LBL_CLOSE");
                break;

            case CommonData.ButtonCategory.Save:
                caption = I18n.GetMessage("COM_LBL_SAVE");
                break;

            case CommonData.ButtonCategory.SaveAndNext:
                caption = I18n.GetMessage("COM_LBL_SAVEANDNEXT");
                break;

            case CommonData.ButtonCategory.Back:
                caption = I18n.GetMessage("COM_LBL_BACK");
                break;

            case CommonData.ButtonCategory.Import:
                caption = I18n.GetMessage("COM_LBL_IMPORT");
                break;

            case CommonData.ButtonCategory.Refresh:
                caption = I18n.GetMessage("COM_LBL_REFRESH");
                break;

            case CommonData.ButtonCategory.Yes:
                caption = I18n.GetMessage("COM_LBL_YES");
                break;

            case CommonData.ButtonCategory.No:
                caption = I18n.GetMessage("COM_LBL_NO");
                break;

            case CommonData.ButtonCategory.Ok:
                caption = I18n.GetMessage("COM_LBL_OK");
                break;

            case CommonData.ButtonCategory.Cancel:
                caption = I18n.GetMessage("COM_LBL_CANCEL");
                break;

            case CommonData.ButtonCategory.Default:
                break;

            default:
                break;
            }

            return(caption);
        }
Exemplo n.º 15
0
 public WebButton(CommonData.ButtonCategory category, CommonData.ButtonWebType type)
     : this(category.ToString(), CommonData.StringEmpty, category, type)
 {
 }