public void Show(int id)
        {
            try
            {
                SystemDictionaryGroupWrapper obj = SystemDictionaryGroupWrapper.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.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsSystem);



                    hidId.Text = id.ToString();


                    winSystemDictionaryGroupEdit.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;
            }
        }
        protected void storeSystemDictionaryGroup_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1);

            RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e);

            storeSystemDictionaryGroup.DataSource = SystemDictionaryGroupWrapper.FindAllByOrderBy(recordSortor.OrderByColumnName, recordSortor.IsDesc, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSystemDictionaryGroup.DataBind();
        }
        public void DeleteRecord(int id)
        {
            try
            {
                SystemDictionaryGroupWrapper.DeleteByID(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
예제 #4
0
        protected void btnSaveSystemDictionaryGroup_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemDictionaryGroupWrapper obj = new SystemDictionaryGroupWrapper();
                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;



                SystemDictionaryGroupWrapper.Save(obj);

                winSystemDictionaryGroupAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
            }
        }
        protected void btnSaveSystemDictionaryGroup_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SystemDictionaryGroupWrapper obj = SystemDictionaryGroupWrapper.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;


                SystemDictionaryGroupWrapper.Update(obj);

                winSystemDictionaryGroupEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }