Beispiel #1
1
 protected override void OnPreInit(EventArgs e)
 {
     base.OnPreInit(e);
     _formPanel = new FormPanel();
     _formPanel.BodyPadding = 10;
     _formPanel.Layout = "table";
     _formPanel.LayoutConfig.Add(new TableLayoutConfig()
     {
         Columns = 2
     });
     _formPanel.ID = "addForm";
     _formPanel.DefaultAnchor = "100%";
     _txtUsername = new TextField();
     _txtUsername.ID = "txtUsername";
     _txtUsername.Name = "Username";
     _txtUsername.ColSpan = 1;
     _txtUsername.Width = 300;
     _txtUsername.AllowBlank = false;
     _txtUsername.FieldLabel = "用户名";
     _txtUsername.EmptyText = "输入用户名";
     _formPanel.Add(_txtUsername);
     _comboStatus = new ComboBox();
     _comboStatus.EmptyText = "选择状态";
     _comboStatusStore = new Store();
     _comboStatusStore.ID = "comboStoreStatus";
     _comboStatusStore.Model.Add(ComponentHelper.GetModel(
         new Dictionary<string, ModelFieldType>(){
     {"Id",ModelFieldType.Int},{"Name",ModelFieldType.String}
     }));
     _comboStatus.ValueHiddenName = "Status";
     _comboStatus.SimpleSubmit = true;
     _comboStatus.DisplayField = "Name";
     _comboStatus.ValueField = "Id";
     _comboStatus.Store.Add(_comboStatusStore);
     _comboStatus.FieldLabel = "状态";
     _comboStatus.Editable = false;
     _formPanel.Add(_comboStatus);
     _txtMemo = new TextArea();
     _txtMemo.Width = 750;
     _txtMemo.Name = "Description";
     _txtMemo.ColSpan = 2;
     _txtMemo.FieldLabel = "描述";
     _txtMemo.Height = 80;
     _formPanel.Add(_txtMemo);
     _treeRoleSelector = new TreePanelNodeMover();
     _treeRoleSelector.LeftReadData += _treeRoleSelector_LeftReadData;
     //_treeRoleSelector.RightReadData += _treeRoleSelector_RightReadData;
     _treeRoleSelector.Height = 180;
     _treeRoleSelector.Width = 750;
     _treeRoleSelector.ColSpan = 2;
     _treeRoleSelector.ID = "treeRoles";
     _formPanel.Add(_treeRoleSelector);
     _btnAdd = new Button();
     _btnAdd.Text = "添加";
     _btnAdd.Icon = Icon.Add;
     _btnAdd.DirectEvents.Click.Event += AddUser;
     _btnAdd.DirectEvents.Click.EventMask.Set("正在添加");
     _formPanel.Buttons.Add(_btnAdd);
     MainForm.Controls.Add(_formPanel);
 }
 /// <summary>Instantiates the text box control.</summary>
 /// <returns>A text box.</returns>
 protected virtual TextFieldBase CreateEditor()
 {
     if (TextMode == TextBoxMode.MultiLine)
     {
         TextArea textArea = new TextArea();
         //if (Columns > 0) textArea.Columns = Columns;
         //if (Rows > 0) textArea.Rows = Rows;
         return textArea;
     }
     return new TextField();
 }
Beispiel #3
0
        private void InitComponents()
        {
            #region Button and Toolbar
            bool display = (Status == "Open" || Status == "") ? true : false;
            btnSave = new Button {
                ID = "btnSave", Icon = Icon.Disk, Text = "Lưu", ToolTip = "Save", Visible = display
            };
            btnDeleteCard = new Button {
                ID = "btnDeleteCard", Icon = Icon.Delete, Text = "Xóa", ToolTip = "Delete", Visible = display
            };
            topBar = new Toolbar {
                ID = "topBar", Items = { btnSave, btnDeleteCard }, Visible = display
            };
            #endregion Button and Toolbar
            #region Batch and Key
            txtBatch = new Ext.Net.Hidden {
                Name = "Batch", LabelWidth = 150, Anchor = "100%", FieldLabel = "Batch", ID = "txtBatch"
            };
            txtKey = new Ext.Net.Hidden {
                DataIndex = "UID", Name = "UID", LabelWidth = 150, Anchor = "100%", FieldLabel = "UID", ID = "txtKey"
            };
            #endregion Batch and Key
            #region cboNo
            cboNo = new ComboBoxLookup
            {
                DataIndex     = "No",
                Name          = "No",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "No.",
                ID            = "cboNo",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/ItemListHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "No", FieldTitle = "No.", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Description", FieldTitle = "Description", ColWidth = 250
                    },
                    new LookupFormatData {
                        FieldName = "Base_Unit_of_Measure", FieldTitle = "Base Unit of Measure", ColWidth = 150
                    },
                    new LookupFormatData {
                        FieldName = "Unit_Cost", FieldTitle = "Unit Cost", ColWidth = 120
                    }
                },
                idProperty   = "No",
                DisplayField = "No",
                ValueField   = "No",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.ItemNo"
            };
            #endregion cboNo
            #region cboType
            cboType = new ComboBox
            {
                DataIndex     = "Type",
                Name          = "Type",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "Type",
                ID            = "cboType",
                SelectOnFocus = true,
                AllowBlank    = false,
                ReadOnly      = true,
                Items         =
                {
                    new ListItem {
                        Text = "G/L Account", Value = "G/L Account"
                    },
                    new ListItem {
                        Text = "Item", Value = "Item"
                    },
                }
            };
            #endregion cboType
            #region cboAction_Message
            cboAction_Message = new ComboBox {
                DataIndex = "Action_Message", Name = "Action_Message", LabelWidth = 150, Anchor = "100%", FieldLabel = "Action Message", ID = "cboAction_Message", SelectOnFocus = true, ReadOnly = true,
                //Items = {
                //    new ListItem {Text="", Value="" },
                //    new ListItem {Text="New", Value="New" },
                //    new ListItem {Text="Change Qty.", Value="Change Qty." },
                //    new ListItem {Text="Reschedule", Value="Reschedule" },
                //    new ListItem {Text="Resched. & Chg. Qty.", Value="Resched. & Chg. Qty." },
                //    new ListItem {Text="Cancel", Value="Cancel" },
                //}
                Store =
                {
                    new Store                      {
                        Data  = ActionMessage, AutoDataBind = true,
                        Model =
                        {
                            new Model              {
                                Fields =
                                {
                                    new ModelField {
                                        Name = "value"
                                    },
                                    new ModelField {
                                        Name = "text"
                                    },
                                    new ModelField {
                                        Name = "displaytext"
                                    }
                                }
                            }
                        }
                    }
                }
            };
            #endregion cboAction_Message
            #region Accept Action Message and Description
            cboAccept_Action_Message = new Checkbox
            {
                DataIndex  = "Accept_Action_Message",
                Name       = "Accept_Action_Message",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Accept Action Message",
                ID         = "cboAccept_Action_Message",
                ReadOnly   = true
            };
            txtDescription = new TextField
            {
                DataIndex  = "Description",
                Name       = "Description",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Description",
                ID         = "txtDescription",
                ReadOnly   = true
            };
            txtRemark = new TextField
            {
                DataIndex  = "Remark",
                Name       = "Remark",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Remark",
                ID         = "txtRemark",
                ReadOnly   = false
            };
            #endregion Accept Action Message and Description
            #region cboLocation_Code
            cboLocation_Code = new ComboBoxLookup
            {
                DataIndex     = "Location_Code",
                Name          = "Location_Code",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "Location Code",
                ID            = "cboLocation_Code",
                SelectOnFocus = true,
                AllowBlank    = true,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/LocationListHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "Code", FieldTitle = "Code", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Name", FieldTitle = "Name", ColWidth = 150
                    }
                },
                idProperty   = "Code",
                DisplayField = "Code",
                ValueField   = "Code",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.Location"
            };
            #endregion cboLocation_Code
            #region Original_Quantity and Quantity
            txtOriginal_Quantity = new NumberField
            {
                DataIndex  = "Original_Quantity",
                Name       = "Original_Quantity",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Original Quantity",
                ID         = "txtOriginal_Quantity",
                MinValue   = 0,
                MaxValue   = 1000000,
                ReadOnly   = true
            }; //1.000.000
            txtQuantity = new TextField
            {
                DataIndex  = "Quantity",
                Name       = "Quantity",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Quantity",
                ID         = "txtQuantity",
                MaskRe     = @"/[0-9\.]/",
            };
            #endregion Original_Quantity and Quantity
            #region cboUnit_of_Measure_Code
            cboUnit_of_Measure_Code = new ComboBoxLookup
            {
                DataIndex     = "Unit_of_Measure_Code",
                Name          = "Unit_of_Measure_Code",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "Unit of Measure Code",
                ID            = "cboUnit_of_Measure_Code",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/UOMHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "Code", FieldTitle = "Code", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Description", FieldTitle = "Description", ColWidth = 150
                    },
                    new LookupFormatData {
                        FieldName = "Qty_per_Unit_of_Measure", FieldTitle = "Qty per Unit of Measure", ColWidth = 150
                    }
                },
                idProperty   = "Code",
                DisplayField = "Code",
                ValueField   = "Code",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.UOM"
            };
            #endregion txtUnit_of_Measure_Code
            #region Direct_Unit_Cost and Due_Date
            txtDirect_Unit_Cost = new TextField
            {
                DataIndex  = "Direct_Unit_Cost",
                Name       = "txtDirect_Unit_Cost",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Direct Unit Cost",
                ID         = "txtDirect_Unit_Cost",
                ReadOnly   = true
            };
            txtDue_Date = new DateField
            {
                DataIndex    = "Due_Date",
                Name         = "Due_Date",
                LabelWidth   = 150,
                Anchor       = "100%",
                FieldLabel   = "Due Date",
                ID           = "txtDue_Date",
                Format       = "dd/MM/yyyy",
                SubmitFormat = "dd/MM/yyyy"
            };
            #endregion Direct_Unit_Cost and Due_Date
            #region cboVendor_No
            cboVendor_No = new ComboBoxLookup {
                DataIndex    = "Vendor_No", Name = "Vendor_No", LabelWidth = 150, Anchor = "100%", FieldLabel = "Vendor No.", ID = "cboVendor_No", ReadOnly = true,
                AllowBlank   = true,
                MsgTarget    = MessageTarget.Side,
                ProxyUrl     = "../../../Handler/ItemVendorCatalogHandler.ashx",
                DataTemplete =
                {
                    new LookupFormatData {
                        FieldName = "Vendor_No", FieldTitle = "Vendor No", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Vendor_Item_No", FieldTitle = "Vendor Item No.", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Lead_Time_Calculation", FieldTitle = "Lead Time Calculation", ColWidth = 150
                    }
                },
                idProperty   = "Vendor_No",
                DisplayField = "Vendor_No",
                ValueField   = "Vendor_No",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.ItemVendorCatalog"
            };
            #endregion cboVendor_No
            #region cboUOMHandler
            //cboUOMHandler = new ComboBoxLookup {
            //    DataIndex = "Unit_of_Measure_Code",
            //    Name = "Unit_of_Measure_Code",
            //    LabelWidth = 150,
            //    Anchor = "100%",
            //    FieldLabel = "UOM",
            //    ID = "cboUOMHandler",
            //    ReadOnly = false,
            //    AllowBlank = false,
            //    MsgTarget = MessageTarget.Side,
            //    ProxyUrl = "../../../Handler/UOMHandler.ashx",
            //    DataTemplete = {
            //        new LookupFormatData{FieldName = "Code", FieldTitle = "Code", ColWidth = 100},
            //        new LookupFormatData{FieldName = "Description", FieldTitle = "Description", ColWidth = 100},
            //        new LookupFormatData{FieldName = "Qty_per_Unit_of_Measure", FieldTitle = "Qty per Unit of Measure", ColWidth = 200, Format="N0"},
            //    },
            //    idProperty = "Unit_of_Measure_Code",
            //    DisplayField = "Unit_of_Measure_Code",
            //    ValueField = "Unit_of_Measure_Code",
            //    PageSize = 5,
            //    CurCompany = GlobalVariable.CompanyName,
            //    SCOPE = "GLX.Lookup.UOM"
            //};
            //cboUOMHandler.Store.Primary.Parameters.AddRange(new Ext.Net.StoreParameter[] {
            //    new Ext.Net.StoreParameter{Name = "type", Value = String.Format("2|3"), Mode = ParameterMode.Value},
            //});
            #endregion cboUOMHandler
            #region Vendor_Item_No
            txtVendor_Item_No = new TextField
            {
                DataIndex  = "Vendor_Item_No",
                Name       = "Vendor_Item_No",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Vendor Item No",
                ID         = "txtVendor_Item_No",
                ReadOnly   = true
            };
            #endregion Vendor_Item_No
            #region cboReplenishment_System
            cboReplenishment_System = new ComboBox
            {
                DataIndex  = "Replenishment_System",
                Name       = "Replenishment_System",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Replenishment System",
                ID         = "cboReplenishment_System",
                ReadOnly   = true,
                Store      =
                {
                    new Store                      {
                        Data  = ReplenishmentSystem, AutoDataBind = true,
                        Model =
                        {
                            new Model              {
                                Fields =
                                {
                                    new ModelField {
                                        Name = "value"
                                    },
                                    new ModelField {
                                        Name = "text"
                                    },
                                    new ModelField {
                                        Name = "displaytext"
                                    }
                                }
                            }
                        }
                    }
                }

                //Items = {
                //    new ListItem { Text="Purchase", Value="Purchase"},
                //    new ListItem { Text="Prod. Order", Value="Prod. Order"},
                //    new ListItem { Text="Transfer", Value="Transfer"},
                //    new ListItem { Text="Assembly", Value="Assembly"}
                //}
            };
            #endregion cboReplenishment_System
            #region cboNo
            cboNo = new ComboBoxLookup
            {
                DataIndex     = "No",
                Name          = "No",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "No.",
                ID            = "cboNo",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/ItemListHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "No", FieldTitle = "No.", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Description", FieldTitle = "Description", ColWidth = 250
                    },
                    new LookupFormatData {
                        FieldName = "Base_Unit_of_Measure", FieldTitle = "Base Unit of Measure", ColWidth = 150
                    },
                    new LookupFormatData {
                        FieldName = "Unit_Cost", FieldTitle = "Unit Cost", ColWidth = 120
                    }
                },
                idProperty   = "No",
                DisplayField = "No",
                ValueField   = "No",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.ItemNo"
            };
            #endregion cboNo


            TextAreaChangeLogComment = new TextArea {
                Flex = 1, ID = "TextAreaChangeLogComment", ReadOnly = true
            };
            hiddenConverted = new Ext.Net.Hidden {
                DataIndex = "Converted", Name = "Converted", ID = "hiddenConverted"
            };
            hiddenStatus = new Ext.Net.Hidden {
                DataIndex = "Status", Name = "Status", ID = "hiddenStatus"
            };

            #region frmHeader
            frmHeader = new FormPanel
            {
                Header           = false,
                Region           = Region.North,
                Icon             = Ext.Net.Icon.ApplicationForm,
                Border           = true,
                ID               = "frmHeader",
                TrackResetOnLoad = true,
                Layout           = "Hbox",
                Items            =
                {
                    new Panel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 10 10",
                        Border             = false,
                        //Items = { txtKey, txtBatch, cboType, cboNo, cboAction_Message, cboAccept_Action_Message, txtDescription, cboLocation_Code } //txtOriginal_Quantity
                        Items ={ txtKey,                    txtBatch,            hiddenConverted,  hiddenStatus, cboNo, txtDescription, txtRemark,
                                cboUnit_of_Measure_Code, txtDirect_Unit_Cost, cboLocation_Code, txtQuantity,  txtDue_Date }//txtOriginal_Quantity, cboType, cboAction_Message, cboAccept_Action_Message,
                    },
                }
            };
            frmComment = new FormPanel
            {
                ID     = "frmComment",
                Title  = "Comment",
                Icon   = Icon.Comments,
                Border = false,
                Region = Region.South,
                Layout = "Fit",
                Height = 150,
                Items  = { TextAreaChangeLogComment }
            };

            #endregion frmHeader

            #region Windows
            this.ID          = "winCard";
            this.Maximizable = false;
            this.Minimizable = false;
            this.CloseAction = CloseAction.Destroy;
            this.Icon        = Icon.ApplicationEdit;
            this.TopBar.Add(topBar);
            this.Layout = "Border";
            this.Items.AddRange(
                new ItemsCollection <Ext.Net.AbstractComponent>
            {
                this.frmHeader, frmComment
            }
                );
            #endregion Windows
        }
    /// <summary>
    /// Lấy fieldname và giá trị
    /// </summary>
    /// <param name="control"></param>
    /// <param name="value"></param>
    /// <returns></returns>
    private string GetFieldName(Ext.Net.Component control, ref object value)
    {
        switch (control.ToString())
        {
        case "Ext.Net.TextField":
            Ext.Net.TextField txtControl = (Ext.Net.TextField)control;
            value = txtControl.Text;
            if (!txtControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtControl.ID.Substring(txtControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Hidden":
            Ext.Net.Hidden hdfControl = (Ext.Net.Hidden)control;
            value = hdfControl.Text;
            if (!hdfControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(hdfControl.ID.Substring(hdfControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Checkbox":
            Ext.Net.Checkbox chk = (Ext.Net.Checkbox)control;
            value = chk.Checked == true ? 1 : 0;
            if (!chk.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(chk.ID.Substring(chk.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.DateField":
            Ext.Net.DateField dfDate = (Ext.Net.DateField)control;
            if (!SoftCore.Util.GetInstance().IsDateNull(dfDate.SelectedDate))
            {
                value = dfDate.SelectedDate.Month + "/" + dfDate.SelectedDate.Day + "/" + dfDate.SelectedDate.Year;
            }
            else
            {
                value = "";
            }
            if (!dfDate.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(dfDate.ID.Substring(dfDate.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.NumberField":
            Ext.Net.NumberField nbf = (Ext.Net.NumberField)control;
            value = nbf.Text;
            if (!nbf.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(nbf.ID.Substring(nbf.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.ComboBox":
            Ext.Net.ComboBox cbBox = (Ext.Net.ComboBox)control;
            value = cbBox.SelectedItem.Value;
            if (!cbBox.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(cbBox.ID.Substring(cbBox.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.SpinnerField":
            Ext.Net.SpinnerField spinnerField = (Ext.Net.SpinnerField)control;
            value = spinnerField.Text;
            if (!spinnerField.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(spinnerField.ID.Substring(spinnerField.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.TextArea":
            Ext.Net.TextArea txtArea = (Ext.Net.TextArea)control;
            value = txtArea.Text;
            if (!txtArea.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtArea.ID.Substring(txtArea.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Container":
            Ext.Net.Container cContainer = (Ext.Net.Container)control;
            GetChildControl(cContainer);
            break;

        case "Ext.Net.FieldSet":
            Ext.Net.FieldSet fieldSet = (Ext.Net.FieldSet)control;
            GetChildControl(fieldSet);
            break;

        case "Ext.Net.HtmlEditor":
            Ext.Net.HtmlEditor htmlEditor = (Ext.Net.HtmlEditor)control;
            value = htmlEditor.Text;
            if (!htmlEditor.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(htmlEditor.ID.Substring(htmlEditor.ID.IndexOf("_") + 1));
            }
        }
        return("");
    }
Beispiel #5
0
 public override void RenderView(System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer)
 {
     RenderMain(writer);
     var _formPanel = new ValidatedForm();
     _formPanel.BodyPadding = 10;
     _formPanel.Layout = "table";
     _formPanel.Url = Url.Action("AddAccount");
     _formPanel.LayoutConfig.Add(new TableLayoutConfig()
     {
         Columns = 2
     });
     _formPanel.ID = "addForm";
     _formPanel.DefaultAnchor = "100%";
     var _txtUsername = new TextField();
     _txtUsername.ID = "txtUsername";
     _txtUsername.Name = "Username";
     _txtUsername.ColSpan = 1;
     _txtUsername.Width = 300;
     _txtUsername.AllowBlank = false;
     _txtUsername.FieldLabel = "用户名";
     _txtUsername.EmptyText = "输入用户名";
     _formPanel.Add(_txtUsername);
     var _comboStatus = new ComboBox();
     _comboStatus.EmptyText = "选择状态";
     _comboStatus.Name = "Status";
     var _comboStatusStore = new Store();
     _comboStatusStore.ID = "comboStoreStatus";
     _comboStatus.AllowBlank = false;
     _comboStatus.BlankText = "必须选择一个状态";
     _comboStatusStore.Model.Add(ComponentHelper.GetModel(
         new Dictionary<string, ModelFieldType>(){
     {"Id",ModelFieldType.Int},{"Name",ModelFieldType.String}
     }));
     _comboStatus.ValueHiddenName = "Status";
     _comboStatus.SimpleSubmit = true;
     _comboStatus.DisplayField = "Name";
     _comboStatus.ValueField = "Id";
     _comboStatus.Store.Add(_comboStatusStore);
     _comboStatus.FieldLabel = "状态";
     _comboStatus.Editable = false;
     _comboStatusStore.DataSource = EnumHelper.GetList(typeof(BaseStatuses), (k, v) =>
     {
         return new
         {
             Id = k,
             Name = v
         };
     });
     _comboStatusStore.DataBind();
     _formPanel.Add(_comboStatus);
     var _txtMemo = new TextArea();
     _txtMemo.Width = 750;
     _txtMemo.Name = "Description";
     _txtMemo.ColSpan = 2;
     _txtMemo.FieldLabel = "描述";
     _txtMemo.Height = 80;
     _formPanel.Add(_txtMemo);
     var _treeRoleSelector = new TreePanelNodeMover();
     _treeRoleSelector.LeftReadProxy.Url = Url.Action("GetNotAddedRoles");
     _treeRoleSelector.RightReadProxy.Url = Url.Action("GetAddedRoles");
     _treeRoleSelector.Height = 180;
     _treeRoleSelector.Width = 750;
     _treeRoleSelector.ColSpan = 2;
     _treeRoleSelector.ID = "treeRoles";
     _formPanel.Add(_treeRoleSelector);
     _formPanel.Add(new Hidden()
     {
         Name = "RoleIds",
         ID = "hdnRoleIds"
     });
     var _btnAdd = new Button();
     _btnAdd.Text = "添加";
     _btnAdd.Icon = Icon.Add;
     _btnAdd.Handler = _treeRoleSelector.SyncAddedNodes("hdnRoleIds") + "App." + _formPanel.ID + ".submitData(function(r){if(r.success){" + HideWindowReloadGrid("gridUsers") + "}})";
     _formPanel.Buttons.Add(_btnAdd);
     writer.Write(_formPanel.ToBuilder().ToHtmlString());
 }