protected void btnSaveSystemPost_Click(object sender, DirectEventArgs e) { try { SystemPostWrapper obj = new SystemPostWrapper(); obj.Name = this.txtName.Text.Trim(); obj.Code = this.txtCode.Text.Trim(); obj.Description = this.txtDescription.Text.Trim(); obj.OrganizationID = SystemOrganizationWrapper.FindById(Convert.ToInt32(this.hidOrgID.Text.Trim())); obj.CreateBy = this.ParentPage.CurrentLoginUser.UserID; obj.CreateAt = System.DateTime.Now; obj.LastModifyBy = this.ParentPage.CurrentLoginUser.UserID; obj.LastModifyAt = System.DateTime.Now;; obj.LastModifyComment = "创建用户"; SystemPostWrapper.Save(obj); winSystemPostAdd.Hide(); } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message; } }
protected void btnSaveSystemPost_Click(object sender, DirectEventArgs e) { try { SystemPostWrapper obj = SystemPostWrapper.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.LastModifyBy = this.ParentPage.CurrentLoginUser.UserID; obj.LastModifyAt = System.DateTime.Now;; obj.LastModifyComment = "创建用户"; SystemPostWrapper.Update(obj); winSystemPostEdit.Hide(); ResourceManager.AjaxSuccess = true; } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message; return; } }
public void Show(int id) { try { SystemPostWrapper obj = SystemPostWrapper.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.txtOrganizationID.Text = obj.OrganizationID.Name; hidId.Text = id.ToString(); winSystemPostEdit.Show(); } else { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message : Data does not exist"; return; } } catch (Exception ex) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = "Error Message : " + ex.Message; return; } }
public void DeletePost(int id) { try { SystemPostWrapper.DeleteByID(id); ResourceManager.AjaxSuccess = true; } catch (Exception e) { ResourceManager.AjaxSuccess = false; ResourceManager.AjaxErrorMessage = e.Message; return; } }
protected void storeSystemPost_Refresh(object sender, StoreRefreshDataEventArgs e) { PageQueryParams pageQueryParams = WebUIHelper.GetPageQueryParamFromStoreRefreshDataEventArgs(e, this.PagingToolBar1); RecordSortor recordSortor = WebUIHelper.GetRecordSortorFromStoreRefreshDataEventArgs(e); int selectOrgID = 0; if (!string.IsNullOrEmpty(e.Parameters["SelectOrgID"])) { selectOrgID = Convert.ToInt32(e.Parameters["SelectOrgID"]); } if (selectOrgID == 0) { storeSystemPost.DataSource = new List <SystemPostWrapper>(); e.Total = 0; storeSystemPost.DataBind(); return; } SystemOrganizationWrapper organization = SystemOrganizationWrapper.FindById(selectOrgID); if (organization == null) { storeSystemPost.DataSource = new List <SystemPostWrapper>(); e.Total = 0; storeSystemPost.DataBind(); return; } storeSystemPost.DataSource = SystemPostWrapper.FindAllByOrderByAndFilterAndOrganizationID(recordSortor.OrderByColumnName, recordSortor.IsDesc, organization, pageQueryParams); e.Total = pageQueryParams.RecordCount; storeSystemPost.DataBind(); }