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 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; } }