Пример #1
22
 protected override void OnPreInit(EventArgs e)
 {
     base.OnPreInit(e);
     foreach (Control control in Controls)
     {
         if (regForm == null)
         {
             regForm = control as HtmlForm;
             if (regForm != null) break;
         }
     }
     if (regForm == null)
     {
         throw new ArgumentException("登录页面中至少添加一个服务器端表单");
     }
     window = new Window();
     window.Title = "管理员注册";
     window.Closable = false;
     window.Icon = Icon.Key;
     window.Width = 320;
     window.Height = 185;
     formPanel = new FormPanel();
     formPanel.BodyStyle = "padding:20px;";
     formPanel.Layout = "table";
     formPanel.LayoutConfig.Add(new TableLayoutConfig()
     {
         Columns = 2
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "用户名",
         AllowBlank = false,
         ColSpan = 2,
         Name = "Username"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "密码",
         AllowBlank = false,
         ColSpan = 2,
         InputType = Ext.Net.InputType.Password,
         Name = "Password"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "确认密码",
         AllowBlank = false,
         ColSpan = 1,
         InputType = Ext.Net.InputType.Password,
         Name = "Password2"
     });
     window.Items.Add(formPanel);
     regForm.Controls.Add(window);
     btnReg = new KeyAddButton();
     btnReg.Text = "注册";
     btnReg.ID = "btnReg";
     btnReg.OnClientClick = "App.direct.Reg({eventMask:{showMask:true,msg:'正在注册'}});";
     window.Buttons.Add(btnReg);
 }
Пример #2
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>
        ///
        /// </summary>
        public FormPanel.Builder FormPanel(FormPanel component)
        {
#if MVC
            component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null;
#endif
            return(new FormPanel.Builder(component));
        }
Пример #4
0
    public static void SetFormReadOnly(Ext.Net.FormPanel form, bool isreadonly)
    {
        //<Ext.Net.Observable>
        List <Field> fields = Ext.Net.Utilities.ControlUtils.FindControls <Field>(form);

        foreach (Field field in fields)
        {
            field.ReadOnly = isreadonly;
        }
    }
 /// <summary>
 ///
 /// </summary>
 private void AddWindowDevice()
 {
     try
     {
         Window window = new Window();
         window.ID            = "DeviceAdd";
         window.Title         = "设备信息增加";
         window.Width         = Unit.Pixel(400);
         window.Height        = Unit.Pixel(420);
         window.Modal         = true;
         window.Collapsible   = true;
         window.Maximizable   = false;
         window.Resizable     = false;
         window.Hidden        = true;
         window.Layout        = "Fit";
         window.AutoLoad.Mode = LoadMode.Merge;
         Ext.Net.FormPanel tab = new Ext.Net.FormPanel();
         tab.Title          = "设备信息";
         tab.Header         = false;
         tab.Padding        = 5;
         tab.DefaultAnchor  = "98%";
         tab.AnchorVertical = "100%";
         tab.MonitorValid   = true;
         tab.Listeners.ClientValidation.Handler = "butSaveEditDevice.setDisabled(!valid);";
         ComboBox cmbDeviceStation = CommonExt.AddComboBox("cmbEDeviceStation", "所属监测点", "StoreStaion", "请选择所属监测点", false);
         cmbDeviceStation.Listeners.Select.Handler = "SystemStation.SelectDeviceEvent()";
         tab.Items.Add(cmbDeviceStation);
         tab.Items.Add(CommonExt.AddTextField("txtEDeviceName", "设备名称", false, "例:[八达岭高速昌平电警抓拍机]"));
         ComboBox cmbDirection = CommonExt.AddComboBox("cmbEDeviceDirection", "所属方向", "StoreDirection", "请选择所属方向", false);
         cmbDirection.Listeners.Select.Handler = "SystemStation.SelectDirectionEvent()";
         tab.Items.Add(cmbDirection);
         tab.Items.Add(CommonExt.AddComboBox("cmdEDeviceType", "设备类型", "StoreType", "请选择设备类型", false));
         tab.Items.Add(CommonExt.AddTextField("txtEDeviceIP", "设备IP地址", false, "例:[192.168.0.1]"));
         tab.Items.Add(CommonExt.AddTextField("txtEDeviceSport", "设备端口", false, "例:[18000]"));
         tab.Items.Add(CommonExt.AddComboBox("cmdEDeviceCompany", "设备厂家", "StoreCompany", "请选择设备厂家", false));
         tab.Items.Add(CommonExt.AddComboBox("cmdEDeviceCamera", "相机类型", "StoreCamera", "请选择相机类型", false));
         tab.Items.Add(CommonExt.AddComboBox("cmdEDeviceScan", "是否扫描文件", "StoreShow", "请选择是/否", false));
         tab.Items.Add(CommonExt.AddTextField("txtEDeviceServiceIP", "图片保存服务器IP", false, "例:[192.168.0.1]"));
         tab.Items.Add(CommonExt.AddTextField("txtEDeviceImagePath", "图片保存路径", false, "例:[D:\\CAPTURE\\192.168.0.1]"));
         window.Buttons.Add(CommonExt.AddButton("butSaveEditDevice", "保存", "Disk", "SystemStation.InfoSaveDevice()"));
         window.Buttons.Add(CommonExt.AddButton("butCancelEditDevice", "取消", "Cancel", window.ClientID + ".hide()"));
         window.Items.Add(tab);
         window.Render(this.Form);
         window.Show();
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
     }
 }
        /// <summary>
        ///
        /// </summary>
        private void AddWindowsStation()
        {
            try
            {
                Window window = new Window();
                window.ID     = "StationAdd";
                window.Title  = "监测点增加";
                window.Width  = Unit.Pixel(400);
                window.Height = Unit.Pixel(300);

                window.Collapsible = true;
                window.Maximizable = false;
                window.Resizable   = false;
                window.Hidden      = true;

                window.Layout        = "Fit";
                window.AutoLoad.Mode = LoadMode.Merge;
                Ext.Net.FormPanel tab = new Ext.Net.FormPanel();
                tab.Title          = "监测点信息";
                tab.Header         = false;
                tab.Padding        = 5;
                tab.DefaultAnchor  = "98%";
                tab.AnchorVertical = "100%";
                tab.MonitorValid   = true;

                tab.Listeners.ClientValidation.Handler = "butSaveEdit.setDisabled(!valid);";
                ComboBox cmbDepartment = CommonExt.AddComboBox("cmbEDepartment", "所属机构", "StoreCombo", "请选择所属机构", false);
                cmbDepartment.Listeners.Select.Handler = "SystemStation.SelectDepartEvent()";
                tab.Items.Add(cmbDepartment);
                ComboBox cmbLocation = CommonExt.AddComboBox("cmbELocation", "所属地点", "StoreLocation", "请选择所属地点", false);
                cmbLocation.Listeners.Select.Handler = "SystemStation.SelectStationEvent()";
                tab.Items.Add(cmbLocation);
                tab.Items.Add(CommonExt.AddTextField("txtEStationID", "监测点编号", false, "例:[2012030010]"));
                tab.Items.Add(CommonExt.AddTextField("txtEStationName", "监测点名称", false, "例:[八达岭高速昌平卡口]"));
                tab.Items.Add(CommonExt.AddComboBox("cmdEStationType", "监测点类型", "StoreType", "请选择监测点类型", false));
                tab.Items.Add(CommonExt.AddComboBox("cmdEStationShow", "卡口系统显示", "StoreShow", "请选择是/否", false));
                tab.Items.Add(CommonExt.AddTextField("txtEDescription", "描述"));

                window.Buttons.Add(CommonExt.AddButton("butSaveEdit", "保存", "Disk", "SystemStation.InfoSave()"));
                window.Buttons.Add(CommonExt.AddButton("butCancelEdit", "取消", "Cancel", window.ClientID + ".hide()"));
                window.Items.Add(tab);
                window.Render(this.Form);
                window.Show();
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
            }
        }
Пример #7
0
        public void ShowDialog(int id)
        {
            ContentItem contentItem = Engine.Persister.Get(id);

            var window = new Window
            {
                ID = "pageCachingSettings",
                Title = @"Page Caching Settings",
                Width = 500,
                Height = 300,
                Layout = "fit",
                Modal = true
            };

            var formPanel = new FormPanel { Padding = 5 };
            var formLayout = new FormLayout();
            formPanel.ContentControls.Add(formLayout);
            window.Items.Add(formPanel);

            var chkEnableCache = new Checkbox
            {
                ID = "chkEnableCache",
                FieldLabel = @"Enable page cache?",
                LabelSeparator = "",
                Checked = contentItem.GetPageCachingEnabled()
            };
            formLayout.Anchors.Add(new Anchor(chkEnableCache));

            var tmeCacheDuration = new TimeField
            {
                ID = "tmeCacheDuration",
                FieldLabel = @"Cache duration",
                Width = 80,
                SelectedTime = contentItem.GetPageCachingDuration()
            };
            formLayout.Anchors.Add(new Anchor(tmeCacheDuration));

            Button btnSave = new Button { Text = @"Save" };
            window.Buttons.Add(btnSave);
            btnSave.Listeners.Click.Handler = string.Format(
                "stbStatusBar.showBusy(); Ext.net.DirectMethods.PageCaching.SavePageCachingSettings({0}, Ext.getCmp('{1}').getValue(), Ext.getCmp('{2}').getValue(), {{ url: '{4}', success: function() {{ stbStatusBar.setStatus({{ text: 'Saved page caching settings', iconCls: '', clear: true }}); }} }}); {3}.close();",
                id, chkEnableCache.ClientID, tmeCacheDuration.ClientID, window.ClientID, Engine.AdminManager.GetAdminDefaultUrl());

            Button btnCancel = new Button { Text = @"Cancel" };
            window.Buttons.Add(btnCancel);
            btnCancel.Listeners.Click.Handler = string.Format("{0}.close();", window.ClientID);

            window.Render(pnlContainer, RenderMode.RenderTo);
        }
Пример #8
0
        /// <summary>
        /// 显示修改窗体
        /// </summary>
        private void AddWindowModify()
        {
            try
            {
                RowSelectionModel sm = this.GridUser.SelectionModel.Primary as RowSelectionModel;
                if (sm.SelectedRow != null)
                {
                    Window window = new Window();
                    window.ID            = "UserModify";
                    window.Title         = GetLangStr("TGSUserManager43", "密码修改");
                    window.Width         = Unit.Pixel(400);
                    window.Height        = Unit.Pixel(240);
                    window.Modal         = true;
                    window.Maximizable   = false;
                    window.Resizable     = false;
                    window.Hidden        = true;
                    window.AutoLoad.Mode = LoadMode.Merge;
                    window.Layout        = "FitLayout";

                    Ext.Net.FormPanel tab = new Ext.Net.FormPanel();
                    tab.MonitorValid = true;
                    tab.Title        = "";
                    tab.Padding      = 20;
                    tab.Height       = 120;
                    tab.Items.Add(CommonExt.AddTextFieldPassword("txtMFirstPassWord", GetLangStr("TGSUserManager44", "初始密码"), false));
                    tab.Items.Add(CommonExt.AddTextFieldPassword("txtMPassWord", GetLangStr("TGSUserManager45", "新密码"), false));
                    tab.Items.Add(CommonExt.AddTextFieldPassword_Confirm("txtMConfirmPassWord", GetLangStr("TGSUserManager46", "重复密码"), false, "txtMPassWord"));

                    tab.Buttons.Add(CommonExt.AddButton("butSaveEdit2", GetLangStr("TGSUserManager47", "保存"), "Disk", "UserManager.UpdateData()"));
                    tab.Buttons.Add(CommonExt.AddButton("butCancelEdit2", GetLangStr("TGSUserManager48", "取消"), "Cancel", window.ClientID + ".hide()"));
                    tab.Listeners.ClientValidation.Handler = "butSaveEdit2.setDisabled(!valid);";

                    window.Items.Add(tab);
                    window.Render(this.Form);
                    window.Show();
                }
                else
                {
                    Notice(GetLangStr("TGSUserManager42", "提示信息"), GetLangStr("TGSUserManager50", "请选择要修改的用户"));
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("TGSUserManager.aspx-AddWindowModify", ex.Message + ";" + ex.StackTrace, "AddWindowModify has an exception");
            }
        }
Пример #9
0
        /// <summary>
        /// 显示自定义窗体
        /// </summary>
        private void AddWindow()
        {
            try
            {
                Window window = new Window();
                window.ID    = "PrivAdd";
                window.Title = GetLangStr("PrivManager41", "增加权限");

                window.Width         = Unit.Pixel(360);
                window.Height        = Unit.Pixel(220);
                window.Modal         = true;
                window.Maximizable   = false;
                window.Resizable     = false;
                window.Hidden        = true;
                window.AutoLoad.Mode = LoadMode.Merge;
                window.Layout        = "FitLayout";

                Ext.Net.FormPanel tab = new Ext.Net.FormPanel();
                tab.MonitorValid = true;
                tab.Title        = GetLangStr("PrivManager42", "权限信息");
                tab.Header       = false;
                tab.Padding      = 20;
                tab.Height       = 200;

                TextField txtPrivId = CommonExt.AddTextField("txtAPrivID", GetLangStr("PrivManager9", "权限编号"));
                txtPrivId.Text     = tgsPproperty.GetMinRecordId();
                txtPrivId.Disabled = true;
                tab.Items.Add(txtPrivId);
                tab.Items.Add(CommonExt.AddTextFieldWidth("txtAPrivName", GetLangStr("PrivManager10", "权限名称"), false, GetLangStr("PrivManager45", "请输入权限名称")));
                tab.Items.Add(CommonExt.AddTextFieldWidth("txtARemark", GetLangStr("PrivManager11", "权限描述"), true, GetLangStr("PrivManager47", "请输入权限描述")));
                tab.Buttons.Add(CommonExt.AddButton("butSaveEdit", GetLangStr("PrivManager13", "保存"), "Disk", "PrivManager.InfoSave()"));
                tab.Buttons.Add(CommonExt.AddButton("butCancelEdit", GetLangStr("PrivManager49", "取消"), "Cancel", window.ClientID + ".hide()"));
                tab.Listeners.ClientValidation.Handler = "butSaveEdit.setDisabled(!valid);";
                window.Items.Add(tab);
                window.Render(this.Form);
                window.Show();
            }

            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("PrivManager.aspx-AddWindow", ex.Message + ";" + ex.StackTrace, "AddWindow has an exception");
            }
        }
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);
            txtOldPassword = new TextField();
            txtOldPassword.Name = "OldPassword";
            txtOldPassword.ID = "txtOldPassword";
            txtOldPassword.FieldLabel = "旧密码";
            txtOldPassword.InputType = InputType.Password;
            txtNewPassword = new TextField()
            {
                Name = "NewPassword",
                ID = "txtNewPassword",
                InputType = InputType.Password,
                FieldLabel = "新密码"
            };
            txtNewPassword2 = new TextField()
            {
                Name = "NewPassword2",
                ID = "txtNewPassword2",
                InputType = InputType.Password,
                FieldLabel = "确认密码"
            };
            formPanel = new FormPanel();
            formPanel.BodyPadding = 20;
            formPanel.Add(txtOldPassword);
            formPanel.Add(txtNewPassword);
            formPanel.Add(txtNewPassword2);
            Controls.Add(formPanel);

            btnAccept = new Button()
            {
                Icon = Icon.Accept,
                Text = "修改",
                ID = "btnAccept"
            };
            btnAccept.DirectClick += btnAccept_DirectClick;
            btnAccept.DirectEvents.Click.EventMask.Set("正在修改");

            formPanel.Buttons.Add(btnAccept);
        }
Пример #11
0
        /// <summary>
        /// 显示注册窗体
        /// </summary>
        private void AddWindow()
        {
            Window window = new Window();

            window.ID            = "UserAdd";
            window.Title         = GetLangStr("TGSUserManager51", "用户注册");
            window.Width         = Unit.Pixel(400);
            window.Height        = Unit.Pixel(260);
            window.Modal         = true;
            window.Maximizable   = false;
            window.Resizable     = false;
            window.Hidden        = true;
            window.AutoLoad.Mode = LoadMode.Merge;
            window.Layout        = "FitLayout";

            Ext.Net.FormPanel tab = new Ext.Net.FormPanel();
            tab.MonitorValid = true;
            tab.Padding      = 20;
            tab.Height       = 220;
            TextField txtUserId = CommonExt.AddTextField("txtAUserID", GetLangStr("TGSUserManager52", "用户编号"));

            txtUserId.Text     = tgsPproperty.GetMinRecordId();
            txtUserId.Disabled = true;
            tab.Items.Add(txtUserId);
            TextField txtUserName = CommonExt.AddTextField("txtAUserName", GetLangStr("TGSUserManager53", "用户名"), false, "");

            txtUserName.Width = Unit.Pixel(300);
            tab.Items.Add(txtUserName);
            tab.Items.Add(CommonExt.AddTextFieldPassword("txtAPassWord", GetLangStr("TGSUserManager54", "密码"), false));
            tab.Items.Add(CommonExt.AddTextFieldPassword_Confirm("txtAConfirmPassWord", GetLangStr("TGSUserManager46", "重复密码"), false, "txtAPassWord"));
            tab.Buttons.Add(CommonExt.AddButton("butSaveEdit", GetLangStr("TGSUserManager56", "保存"), "Disk", "UserManager.InfoSave()"));
            tab.Buttons.Add(CommonExt.AddButton("butCancelEdit", GetLangStr("TGSUserManager57", "取消"), "Cancel", window.ClientID + ".hide()"));
            tab.Listeners.ClientValidation.Handler = "butSaveEdit.setDisabled(!valid);";
            window.Items.Add(tab);
            window.Render(this.Form);
            window.Show();
        }
Пример #12
0
 /// <summary>
 ///
 /// </summary>
 public FormPanel.Builder FormPanel(FormPanel component)
 {
     return(new FormPanel.Builder(component));
 }
        private void _Count_Radio(System.Web.UI.ControlCollection objcol, string radname)
        {
            try
            {
                int iID;
                int iNO;

                foreach (object obj in objcol)
                {
                    System.Type itype = obj.GetType();
                    if (itype.Namespace == "Ext.Net" || itype.Namespace == "System.Web.UI.HtmlControls")
                    {
                        switch (itype.Name)
                        {
                        case "HtmlForm":
                            System.Web.UI.HtmlControls.HtmlForm htmlform = (System.Web.UI.HtmlControls.HtmlForm)obj;
                            _Count_Radio(htmlform.Controls, radname);
                            break;

                        case "Viewport":
                            Ext.Net.Viewport viewport = (Ext.Net.Viewport)obj;
                            _Count_Radio(viewport.Controls, radname);
                            break;

                        case "FormPanel":
                            Ext.Net.FormPanel formpanel = (Ext.Net.FormPanel)obj;
                            _Count_Radio(formpanel.Controls, radname);
                            break;

                        case "Panel":
                            Ext.Net.Panel panel = (Ext.Net.Panel)obj;
                            _Count_Radio(panel.Controls, radname);
                            break;

                        case "TabPanel":
                            Ext.Net.TabPanel tabpanel = (Ext.Net.TabPanel)obj;
                            _Count_Radio(tabpanel.Controls, radname);
                            break;

                        case "Container":
                            Ext.Net.Container container = (Ext.Net.Container)obj;
                            _Count_Radio(container.Controls, radname);
                            break;

                        case "FieldSet":
                            Ext.Net.FieldSet fieldset = (Ext.Net.FieldSet)obj;
                            _Count_Radio(fieldset.Controls, radname);
                            break;

                        case "ContentContainer":
                            Ext.Net.ContentContainer contentcontainer = (Ext.Net.ContentContainer)obj;
                            _Count_Radio(contentcontainer.Controls, radname);
                            break;

                        case "RadioGroup":
                            Ext.Net.RadioGroup radioGroup = (Ext.Net.RadioGroup)obj;
                            _Count_Radio(radioGroup.Controls, radname);
                            break;

                        case "Radio":
                            Ext.Net.Radio radio = (Ext.Net.Radio)obj;

                            string[] s = radio.ID.Split('_');
                            iID = Convert.ToInt16(s[1]);
                            iNO = Convert.ToInt16(s[2]);

                            if (iID > 1 && iID < 38)
                            {
                                if (radio.Value.Equals(true))
                                {
                                    iSCORE = iSCORE + iNO - 1;
                                }
                            }
                            break;

                        case "":

                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _ErrorMsgShow(ex.Message.ToString());
            }
        }
Пример #14
0
 private FormPanel __BuildControl__control13()
 {
     FormPanel panel = new FormPanel();
     panel.ApplyStyleSheetSkin(this);
     panel.BodyStyle=("padding:20px;");
     panel.Layout=("TableLayout");
     this.__BuildControl__control14(panel.LayoutConfig);
     this.__BuildControl__control16(panel.Items);
     object[] parameters = new object[5];
     parameters[0] = panel;
     parameters[2] = 0x21f;
     parameters[3] = 0x4ca;
     parameters[4] = false;
     this.__PageInspector_SetTraceData(parameters);
     return panel;
 }
Пример #15
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
        }
Пример #16
0
        private void InitComponent()
        {
            #region Button
            btnAddUser = new Button {
                ID = "btnAddUser", Text = "Add User", Icon = Icon.UserAdd
            };
            btnDelete = new Button {
                ID = "btnDelete", Text = "Delete User", Icon = Icon.UserDelete
            };
            #endregion Button

            #region Card
            txtUserName = new TextField
            {
                ID         = "txtUserName",
                EmptyText  = "Enter username",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Username",
                AllowBlank = false
            };

            txtFullName = new TextField
            {
                ID         = "txtFullName",
                EmptyText  = "Enter full name",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Full name",
                AllowBlank = false
            };

            cbgCinema = new CheckboxGroup
            {
                ID            = "cbgCinema",
                FieldLabel    = "Cinema",
                ColumnsNumber = 3,
                Cls           = "x-check-group-alt"
            };

            cboLocation = new ComboBox
            {
                ID         = "cboLocation",
                FieldLabel = "Location",
                EmptyText  = "Enter Location",
                Flex       = 1,
                LabelWidth = 80,
                AllowBlank = false
            };

            cboBatch = new ComboBox
            {
                ID         = "cboBatch",
                EmptyText  = "Enter Batch",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Batch",
                AllowBlank = false
            };

            rdgRole = new RadioGroup
            {
                ID            = "rdgRole",
                FieldLabel    = "Role",
                ColumnsNumber = 1,
                Items         =
                {
                    new Radio {
                        ID = "rdoAdmin", BoxLabel = "Admin", Value = "Admin", InputValue = "Admin"
                    },
                    new Radio {
                        ID = "rdoFnb", BoxLabel = "F&B", Value = "FnB", InputValue = "FnB"
                    },
                    new Radio {
                        ID = "rdoAccSite", BoxLabel = "Accounting Site", Value = "AccSite", InputValue = "AccSite", Checked = true
                    },
                    new Radio {
                        ID = "rdoCM", BoxLabel = "Cinema Manager", Value = "CM", InputValue = "CM"
                    }
                }
            };

            cboCompanyCard = new ComboBox {
                ID         = "cboCompanyCard",
                EmptyText  = "Enter company",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Company",
                AllowBlank = false
            };
            #endregion

            #region Account
            strUsername = new Store
            {
                ID    = "strUsername",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "Account"
                            },
                            new ModelField {
                                Name = "Fullname"
                            },
                        }
                    }
                }
            };

            cboUsername = new Ext.Net.ComboBox
            {
                DataIndex     = "Account",
                Name          = "Account",
                LabelWidth    = 80,
                Anchor        = "100%",
                FieldLabel    = "Account",
                ID            = "cboUsername",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                DisplayField  = "Account",
                ValueField    = "Account",
                PageSize      = 100,
            };
            cboUsername.Store.Add(strUsername);
            cboUsername.ListConfig = new BoundList {
                Width        = 320,
                Height       = 300,
                ItemSelector = ".x-boundlist-item",
                Tpl          = new XTemplate {
                    Html = string.Format(@"
                    <Html>
					    <tpl for=""."">
						    <tpl if=""[xindex] == 1"">
							    <table class=""cbStates-list"">
								    <tr>
									<th style =""font-weight: bold;padding: 3px;background: #3892d3"">{0}</th> 
                                    <th style =""font-weight: bold;padding: 3px;background: #3892d3"">{1}</th>   
								    </tr>
						    </tpl>
						    <tr class=""x-boundlist-item"">
							    <td style=""padding:3px;"">{{{0}}}</td>    
                                <td style=""padding:3px;"">{{{1}}}</td> 
						    </tr>
						    <tpl if=""[xcount-xindex]==0"">
							    </table>
						    </tpl>
					    </tpl>
				    </Html>"                , "Account", "Fullname")
                }
            };
            cboUsername.Triggers.Add(new FieldTrigger {
                Icon = TriggerIcon.Clear, HideTrigger = true
            });
            #endregion Account

            #region Permission
            strPermission = new Store
            {
                ID    = "strPermission",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Company"
                            },
                            new ModelField {
                                Name = "Username"
                            },
                            new ModelField {
                                Name = "Page"
                            },
                            new ModelField {
                                Name = "Action"
                            },
                            new ModelField {
                                Name = "Allow"
                            }
                        }
                    }
                }
            };
            grdPermission = new GridPanel
            {
                ID          = "grdPermission",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Permissions List",
                Height      = 250,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",      Text = "UID",      Width    = 0
                        },
                        new Column {
                            DataIndex = "Company",  Text = "Company",  MinWidth = 100, Flex = 1
                        },
                        new Column {
                            DataIndex = "Username", Text = "Username", Width    = 100
                        },
                        new Column {
                            DataIndex = "Page",     Text = "Page",     Width    = 120
                        },
                        new Column {
                            DataIndex = "Action",   Text = "Action",   MinWidth = 150, Flex = 1
                        },
                        new Column {
                            DataIndex = "Allow",    Text = "Allow",    Width    = 100
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdPermission.Store.Add(strPermission);
            #endregion Permission

            #region GLXAccount
            strGLXAccount = new Store
            {
                ID    = "strGLXAccount",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Account"
                            },
                            new ModelField {
                                Name = "Company"
                            }
                        }
                    }
                }
            };
            grdGLXAccount = new GridPanel
            {
                ID          = "grdGLXAccount",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Company List",
                Height      = 250,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",     Text = "UID",     Width = 0
                        },
                        new Column {
                            DataIndex = "Company", Text = "Company", Width = 100, Flex = 1
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdGLXAccount.Store.Add(strGLXAccount);
            #endregion GLXAccount

            #region LocationAndAccount
            strLocationAndAccount = new Store
            {
                ID    = "strLocationAndAccount",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Account"
                            },
                            new ModelField {
                                Name = "Location"
                            }
                        }
                    }
                }
            };
            grdLocationAndAccount = new GridPanel
            {
                ID          = "grdLocationAndAccount",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Location List",
                Height      = 220,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",      Text = "UID",      Width = 0
                        },
                        new Column {
                            DataIndex = "Location", Text = "Location", Width = 100, Flex = 1
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdLocationAndAccount.Store.Add(strLocationAndAccount);
            #endregion

            #region Worksheet
            strWorksheet = new Store
            {
                ID    = "strWorksheet",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Worksheet Template Name"
                            },
                            new ModelField {
                                Name = "Name"
                            },
                            new ModelField {
                                Name = "Description"
                            },
                            new ModelField {
                                Name = "Template Type"
                            },
                            new ModelField {
                                Name = "Recurring"
                            },
                            new ModelField {
                                Name = "Company"
                            },
                            new ModelField {
                                Name = "Account"
                            },
                        }
                    }
                }
            };

            grdWorksheet = new GridPanel
            {
                ID          = "grdWorksheet",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Worksheet List",
                Height      = 220,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",         Text = "UID",         Width = 0
                        },
                        new Column {
                            DataIndex = "Company",     Text = "Company",     Width = 150
                        },
                        new Column {
                            DataIndex = "Name",        Text = "Name",        Width = 100
                        },
                        new Column {
                            DataIndex = "Description", Text = "Description", Width = 120, Flex = 1
                        },
                        new Column {
                            DataIndex = "Account",     Text = "Account",     Width = 100
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdWorksheet.Store.Add(strWorksheet);
            #endregion

            #region FormPanel
            frmHeader = new FormPanel
            {
                Collapsed   = false,
                Collapsible = true,
                Region      = Region.North,
                Layout      = "HBox",
                Items       =
                {
                    new FormPanel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 10 10",
                        Border             = false,
                        Items              = { cboUsername }
                    },
                    new FormPanel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 10 10",
                        Border             = false
                    }
                },
                TopBar =
                {
                    new Toolbar {
                        Items =
                        {
                            btnAddUser,
                            btnDelete
                        }
                    }
                }
            };

            frmGrid = new FormPanel
            {
                Layout             = "HBoxLayout",
                Region             = Region.Center,
                Header             = true,
                BodyPaddingSummary = "5,5,5,5",
                Items =
                {
                    new Panel         {
                        BodyPadding  = 5,
                        Layout       = "VBoxLayout",
                        Flex         = 2,
                        Region       = Region.Center,
                        LayoutConfig ={ new Ext.Net.VBoxLayoutConfig          {
                                            Align = VBoxAlign.Stretch
                                        } },
                        Items =
                        {
                            grdPermission, grdWorksheet
                        }
                    },
                    new Panel         {
                        BodyPaddingSummary = "5,5,5,5",
                        Layout             = "Fit",
                        Flex   = 1,
                        Region = Region.East,
                        Items  =
                        {
                            new Panel {
                                Items ={ grdGLXAccount, grdLocationAndAccount }
                            }
                        }
                    }
                }
            };
            #endregion FormPanel

            this.ID     = "pageMain";
            this.Layout = "BorderLayout";
            this.Items.AddRange(new ItemsCollection <Ext.Net.AbstractComponent> {
                frmGrid, frmHeader
            });
        }
Пример #17
0
 protected override void OnPreInit(EventArgs e)
 {
     base.OnPreInit(e);
     foreach (Control control in Controls)
     {
         if (loginForm == null)
         {
             loginForm = control as HtmlForm;
             if (loginForm != null) break;
         }
     }
     if (loginForm == null)
     {
         throw new ArgumentException("登录页面中至少添加一个服务器端表单");
     }
     window = new Window();
     window.Title = "用户登录";
     window.Closable = false;
     window.Icon = Icon.Key;
     window.Width = 320;
     window.Height = 185;
     formPanel = new FormPanel();
     formPanel.BodyStyle = "padding:20px;";
     formPanel.Layout = "table";
     formPanel.LayoutConfig.Add(new TableLayoutConfig()
     {
         Columns = 2
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "用户名",
         AllowBlank = false,
         ColSpan = 2,
         Name = "Username"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "密码",
         AllowBlank = false,
         ColSpan = 2,
         InputType = Ext.Net.InputType.Password,
         Name = "Password"
     });
     formPanel.Items.Add(new TextField()
     {
         FieldLabel = "验证码",
         AllowBlank = false,
         ColSpan = 1,
         InputType = Ext.Net.InputType.Text,
         Name = "VerifyCode"
     });
     imgVerify = new Ext.Net.Image()
     {
         Width = 100,
         ImageUrl = "login.aspx?action=VerifyImage",
         Height = 22,
         ColSpan = 1,
         ID = "imgVerify"
     };
     formPanel.Items.Add(imgVerify);
     window.Items.Add(formPanel);
     loginForm.Controls.Add(window);
     btnChangeImage = new Ext.Net.Button();
     btnChangeImage.Text = "更换验证码";
     btnChangeImage.OnClientClick = "App.direct.ChangeImage();";
     window.Buttons.Add(btnChangeImage);
     btnLogin = new KeyGoButton();
     btnLogin.Text = "登录";
     btnLogin.ID = "btnLogin";
     btnLogin.OnClientClick = "App.direct.Login();";
     window.Buttons.Add(btnLogin);
 }
Пример #18
0
        public void ShowDialog(string title, string subtitle, string affectedItemIDs)
        {
            var window = new Window
            {
                ID = "deleteDialog",
                Modal = true,
                Width = 500,
                Height = 300,
                Title = title,
                Layout = "fit",
                Maximizable = true
            };

            window.Listeners.Maximize.Fn = "function(el) { var v = Ext.getBody().getViewSize(); el.setSize(v.width, v.height); }";
            window.Listeners.Maximize.Scope = "this";

            FormPanel formPanel = new FormPanel
            {
                BaseCls = "x-plain",
                Layout = "absolute"
            };
            window.Items.Add(formPanel);

            formPanel.ContentControls.Add(new Label
            {
                Html = @"<div class=""x-window-dlg""><div class=""ext-mb-warning"" style=""width:32px;height:32px""></div></div>",
                X = 5,
                Y = 5
            });
            formPanel.ContentControls.Add(new Label
            {
                Html = subtitle,
                X = 42,
                Y = 6
            });

            TabPanel tabPanel = new TabPanel
            {
                ID = "deleteDialog_TabPanel",
                X = 0,
                Y = 42,
                Anchor = "100% 100%",
                AutoTabs = true,
                DeferredRender = false,
                Border = false
            };
            formPanel.ContentControls.Add(tabPanel);

            TreePanel affectedItemsTreePanel = new TreePanel
            {
                Title = "Affected Items",
                AutoScroll = true,
                RootVisible = false
            };
            tabPanel.Items.Add(affectedItemsTreePanel);

            TreeLoader treeLoader = new TreeLoader
            {
                DataUrl = Engine.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(typeof(DeleteUserControl).Assembly,
                    "Zeus.Admin.Plugins.DeleteItem.AffectedItems.ashx")
            };
            affectedItemsTreePanel.Loader.Add(treeLoader);

            treeLoader.Listeners.Load.Fn = "function(loader, node) { node.getOwnerTree().expandAll(); }";

            affectedItemsTreePanel.Root.Add(new AsyncTreeNode
            {
                Text = "Root",
                NodeID = affectedItemIDs,
                Expanded = true
            });

            TreePanel referencingItemsTreePanel = new TreePanel
            {
                Title = "Referencing Items",
                TabTip = "Items referencing the item(s) you're deleting",
                AutoScroll = true,
                RootVisible = false
            };
            tabPanel.Items.Add(referencingItemsTreePanel);

            TreeLoader referencingItemsTreeLoader = new TreeLoader
            {
                DataUrl = Engine.Resolve<IEmbeddedResourceManager>().GetServerResourceUrl(typeof(DeleteUserControl).Assembly,
                    "Zeus.Admin.Plugins.DeleteItem.ReferencingItems.ashx")
            };
            referencingItemsTreePanel.Loader.Add(referencingItemsTreeLoader);

            referencingItemsTreePanel.Root.Add(new AsyncTreeNode
            {
                Text = "Root",
                NodeID = affectedItemIDs,
                Expanded = true
            });

            Button yesButton = new Button
            {
                ID = "yesButton",
                Text = "Yes"
            };
            yesButton.Listeners.Click.Handler = string.Format(@"
                stbStatusBar.showBusy('Deleting...');
                {0}.hide();
                Ext.net.DirectMethods.Delete.DeleteItems('{1}',
                {{
                    url : '{2}',
                    success: function() {{ stbStatusBar.setStatus({{ text: 'Deleted Item(s)', iconCls: '', clear: true }}); }}
                }});",
                window.ClientID, affectedItemIDs, Engine.AdminManager.GetAdminDefaultUrl());
            window.Buttons.Add(yesButton);

            window.Buttons.Add(new Button
            {
                ID = "noButton",
                Text = "No",
                Handler = string.Format(@"function() {{ {0}.hide(); }}", window.ClientID)
            });

            window.Render(pnlContainer, RenderMode.RenderTo);
        }
        /// <summary>
        /// 添加车道信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AddLane(object sender, DirectEventArgs e)
        {
            if (string.IsNullOrEmpty(HideStation.Value.ToString()))
            {
                Notice("提示", "请选择左侧监测点!");
                return;
            }
            try
            {
                Window window = new Window();
                window.ID     = "LimitAdd";
                window.Title  = GetLangStr("TGSLimitSpeed36", "限速设置");
                window.Width  = Unit.Pixel(400);
                window.Height = Unit.Pixel(320);

                window.Maximizable = false;
                window.Resizable   = false;
                window.Hidden      = true;

                window.Layout        = "Fit";
                window.AutoLoad.Mode = LoadMode.Merge;
                Ext.Net.FormPanel tab = new Ext.Net.FormPanel();
                tab.Title          = GetLangStr("TGSLimitSpeed20", "限速信息");
                tab.Header         = false;
                tab.Padding        = 5;
                tab.DefaultAnchor  = "98%";
                tab.AnchorVertical = "100%";
                tab.MonitorValid   = true;

                tab.Listeners.ClientValidation.Handler = "butSaveLimit.setDisabled(!valid);";

                /*  switch (HideLimitType.Value as string)
                 * {
                 *    case "1":
                 *        tab.Items.Add(CommonExt.AddComboBox("cmdLDirection", GetLangStr("TGSLimitSpeed21", "所属方向"), "StoreDirDev", GetLangStr("TGSLimitSpeed22", "请选择所属方向"), true));
                 *        tab.Items.Add(CommonExt.AddTextField("txtLLane", GetLangStr("TGSLimitSpeed23", "车道编号")));
                 *        X.GetCmp<ComboBox>("cmdLDirection").Hidden = true;
                 *        X.GetCmp<TextField>("txtLLane").Hidden = false;
                 *        break;
                 *
                 *    case "2":
                 *        tab.Items.Add(CommonExt.AddComboBox("cmdLDirection", GetLangStr("TGSLimitSpeed21", "所属方向"), "StoreDirDev", GetLangStr("TGSLimitSpeed22", "请选择所属方向"), false));
                 *        tab.Items.Add(CommonExt.AddTextField("txtLLane", GetLangStr("TGSLimitSpeed23", "车道编号")));
                 *        X.GetCmp<TextField>("txtLLane").Hidden = false;
                 *
                 *        break;
                 *
                 *    case "3":
                 *        tab.Items.Add(CommonExt.AddComboBox("cmdLDirection", GetLangStr("TGSLimitSpeed21", "所属方向"), "StoreDirDev", GetLangStr("TGSLimitSpeed22", "请选择所属方向"), false));
                 *        tab.Items.Add(CommonExt.AddTextField("txtLLane", GetLangStr("TGSLimitSpeed23", "车道编号"), false, "例:[1]"));
                 *        break;
                 *
                 *    default:
                 *        tab.Items.Add(CommonExt.AddTextField("txtLLane", GetLangStr("TGSLimitSpeed23", "车道编号"), false, "例:[1]"));
                 *        break;
                 * }
                 */
                tab.Items.Add(CommonExt.AddTextField("txtLLane", GetLangStr("TGSLimitSpeed23", "车道编号"), false, "例:[1]"));
                tab.Items.Add(CommonExt.AddTextField("sfEBSpeed", GetLangStr("TGSLimitSpeed11", "大车限速"), false, "例:[60]"));
                tab.Items.Add(CommonExt.AddTextField("sfESSpeed", GetLangStr("TGSLimitSpeed12", "小车限速"), false, "例:[80]"));
                tab.Items.Add(CommonExt.AddTextField("sfEBASpeed", GetLangStr("TGSLimitSpeed13", "大车标牌限速"), false, "例:[65]"));
                tab.Items.Add(CommonExt.AddTextField("sfESASpeed", GetLangStr("TGSLimitSpeed14", "小车标牌限速"), false, "例:[85]"));
                tab.Items.Add(CommonExt.AddTextField("sfEBLSpeed", GetLangStr("TGSLimitSpeed15", "大车限低速"), false, "例:[40]"));
                tab.Items.Add(CommonExt.AddTextField("sfESLSpeed", GetLangStr("TGSLimitSpeed16", "小车限低速"), false, "例:[50]"));
                window.Buttons.Add(CommonExt.AddButton("butSaveLimit", GetLangStr("TGSLimitSpeed24", "保存"), "Disk", "TGSLimitSpeed.InfoLimitSave()"));
                window.Buttons.Add(CommonExt.AddButton("butCancelLimit", GetLangStr("TGSLimitSpeed25", "取消"), "Cancel", window.ClientID + ".hide()"));
                X.GetCmp <TextField>("sfEBSpeed").Text    = "80";
                X.GetCmp <TextField>("sfESSpeed").Text    = "80";
                X.GetCmp <TextField>("sfEBASpeed").Text   = "65";
                X.GetCmp <TextField>("sfESASpeed").Text   = "85";
                X.GetCmp <TextField>("sfEBLSpeed").Text   = "10";
                X.GetCmp <TextField>("sfESLSpeed").Text   = "10";
                X.GetCmp <TextField>("sfEBASpeed").Hidden = true;
                X.GetCmp <TextField>("sfESASpeed").Hidden = true;
                window.Items.Add(tab);
                window.Render(this.Form);
                window.Show();
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("TGSLimitSpeed.aspx-AddLane", ex.Message + ";" + ex.StackTrace, "AddLane has an exception");
            }
        }