Ejemplo n.º 1
0
        protected void storeSystemConfigGroup_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            storeSystemConfigGroup.DataSource = SystemConfigGroupWrapper.FindAll();


            storeSystemConfigGroup.DataBind();
        }
Ejemplo n.º 2
0
        public void Show(int id)
        {
            try
            {
                SystemConfigGroupWrapper obj = SystemConfigGroupWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text        = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.txtCode.Text        = ValueConvertUtil.ConvertStringValue(obj.Code);
                    this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);
                    this.chkIsEnable.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsEnable);
                    this.chkIsSystem.Value   = obj.IsSystem.ToString();



                    hidId.Text = id.ToString();


                    winSystemConfigGroupEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
Ejemplo n.º 3
0
        protected void storeSystemConfigGroup_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            storeSystemConfigGroup.DataSource = SystemConfigGroupWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemConfigGroup.DataBind();
        }
Ejemplo n.º 4
0
        public void DeleteGroupRecord(int id)
        {
            try
            {
                SystemConfigGroupWrapper.DeleteByID(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
Ejemplo n.º 5
0
        protected void btnSaveSystemConfig_Click(object sender, DirectEventArgs e)
        {
            try
            {
                if (SystemConfigWrapper.CheckIfExistedConfigByKey(this.txtConfigKey.Text.Trim()))
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "Error Message : config '" + this.txtConfigKey.Text.Trim() + "' is existed  ,Please change key name.";
                    return;
                }


                SystemConfigWrapper obj = new SystemConfigWrapper();
                if (this.cmbGroup.SelectedItem != null)
                {
                    obj.ConfigGroupID = SystemConfigGroupWrapper.FindById(int.Parse(this.cmbGroup.SelectedItem.Value));
                }
                else
                {
                    obj.ConfigGroupID = null;
                }
                obj.ConfigKey         = this.txtConfigKey.Text.Trim();
                obj.ConfigValue       = this.txtConfigValue.Text.Trim();
                obj.ConfigDescription = this.txtConfigDescription.Text.Trim();
                obj.SortIndex         = 1;
                obj.ConfigDataType    = this.cmbDataType.SelectedItem.Value;



                SystemConfigWrapper.Save(obj);

                winSystemConfigAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message :" + ex.Message;
            }
        }
Ejemplo n.º 6
0
        protected void btnSaveSystemConfigGroup_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemConfigGroupWrapper obj = new SystemConfigGroupWrapper();
                obj.Name        = this.txtName.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.IsEnable    = this.chkIsEnable.Checked;
                obj.IsSystem    = this.chkIsSystem.Checked;



                SystemConfigGroupWrapper.Save(obj);

                winSystemConfigGroupAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
Ejemplo n.º 7
0
        protected void btnSaveSystemConfigGroup_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemConfigGroupWrapper obj = SystemConfigGroupWrapper.FindById(int.Parse(hidId.Text.Trim()));
                obj.Name        = this.txtName.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.IsEnable    = this.chkIsEnable.Checked;
                obj.IsSystem    = this.chkIsSystem.Checked;


                SystemConfigGroupWrapper.Update(obj);

                winSystemConfigGroupEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSystemConfig_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemConfigWrapper obj = SystemConfigWrapper.FindById(int.Parse(hidSystemConfigID.Text.Trim()));

                if (this.cmbGroup.SelectedItem != null)
                {
                    obj.ConfigGroupID = SystemConfigGroupWrapper.FindById(int.Parse(this.cmbGroup.SelectedItem.Value));
                }
                else
                {
                    obj.ConfigGroupID = null;
                }

                string configValue = this.txtConfigValue.Text.Trim();

                if (this.cmbDataType.SelectedItem.Value.ToString() == DictionaryConst.Dictionary_System_DataType_int_Key)
                {
                    try
                    {
                        int.Parse(configValue);
                    }
                    catch (Exception ex)
                    {
                        ResourceManager.AjaxSuccess      = false;
                        ResourceManager.AjaxErrorMessage = "请输入整数:" + ex.Message;
                        return;
                    }
                }
                else if (this.cmbDataType.SelectedItem.Value.ToString() == DictionaryConst.Dictionary_System_DataType_datetime_Key)
                {
                    try
                    {
                        DateTime.Parse(configValue);
                    }
                    catch (Exception ex)
                    {
                        ResourceManager.AjaxSuccess      = false;
                        ResourceManager.AjaxErrorMessage = "请输入日期时间:" + ex.Message;
                        return;
                    }
                }
                else if (this.cmbDataType.SelectedItem.Value.ToString() == DictionaryConst.Dictionary_System_DataType_bool_Key)
                {
                    try
                    {
                        bool.Parse(configValue);
                    }
                    catch (Exception ex)
                    {
                        ResourceManager.AjaxSuccess      = false;
                        ResourceManager.AjaxErrorMessage = "请输入布尔值:" + ex.Message;
                        return;
                    }
                }
                else if (this.cmbDataType.SelectedItem.Value.ToString() == DictionaryConst.Dictionary_System_DataType_decimal_Key)
                {
                    try
                    {
                        decimal.Parse(configValue);
                    }
                    catch (Exception ex)
                    {
                        ResourceManager.AjaxSuccess      = false;
                        ResourceManager.AjaxErrorMessage = "请输入小数:" + ex.Message;
                        return;
                    }
                }

                obj.ConfigDataType = this.cmbDataType.SelectedItem.Value;

                obj.ConfigValue       = this.txtConfigValue.Text.Trim();
                obj.ConfigDescription = this.txtConfigDescription.Text.Trim();
                obj.SortIndex         = 1;



                SystemConfigWrapper.Update(obj);

                winSystemConfigEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(GetGlobalResourceObject("GlobalResource", "msgShowError").ToString(), ex.Message);
                return;
            }
        }