protected void LoadData(string Id) { Model.tTopic m = bll.GetModel(Convert.ToInt32(Id)); if (m == null) { Alert.ShowInTop("出错了!"); return; } hfEditorInitValue2.Text = m.policyFile; filelist = m.policyFile; //hfEditorInitValue.Text = m.topicFile; txtDptName.Text = m.policyDptName; txtTitle.Text = m.topicTitle; DateTimeCh.SelectedDate = m.topicTime; DateTimeTop.SelectedDate = m.policyTime; txtAdress.Text = m.policyAdress; txtPeo.Text = m.policyPeople; txtProcess.Text = m.policyProcess; txtRs.Text = m.policyResult; txtDone.Text = m.policyDone; if (m.isCheck == "已审核") { btnSaveClose.Text = "已审核"; btnSaveClose.Enabled = false; } }
protected void btnSaveClose_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { string Id = Request.QueryString["Id"]; Model.tTopic m = bll.GetModel(Convert.ToInt32(Id)); if (m == null) { return; } string content1 = Request.Form["editorNew"] == null ? "" : Request.Form["editorNew"]; string content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"]; m.policyFile = content2; m.topicFile = content1; m.policyDptName = txtDptName.Text; m.topicTitle = txtTitle.Text; m.topicTime = DateTimeCh.SelectedDate; m.policyTime = DateTimeTop.SelectedDate; m.policyAdress = txtAdress.Text; m.policyPeople = txtPeo.Text; m.policyProcess = txtProcess.Text; m.policyResult = txtRs.Text; m.policyDone = txtDone.Text; if (bll.Update(m) == true) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("出错了!"); } } else { Model.tTopic m = new Model.tTopic(); string content1 = Request.Form["editorNew"] == null ? "" : Request.Form["editorNew"]; string content2 = Request.Form["editorNew2"] == null ? "" : Request.Form["editorNew2"]; m.policyFile = content2; m.topicFile = content1; m.policyDptName = txtDptName.Text; m.topicTitle = txtTitle.Text; m.topicTime = DateTimeCh.SelectedDate; m.policyTime = DateTimeTop.SelectedDate; m.policyAdress = txtAdress.Text; m.policyPeople = txtPeo.Text; m.policyProcess = txtProcess.Text; m.policyResult = txtRs.Text; m.policyDone = txtDone.Text; m.policyDptId = int.Parse(Request.QueryString["dptId"]); Model.tUsers user = GetIdentityUser(); m.savePeo = user.usersName; m.savePeoId = user.userId; m.policyType = int.Parse(Request.QueryString["tId"]); int k = bll.Add(m); if (k > 0) { PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } } }
protected void GridDpt_RowCommand(object sender, GridCommandEventArgs e) { BLL.tTopic uBLL = new BLL.tTopic(); int deptID = GetSelectedDataKeyID(GridDpt); if (e.CommandName == "Delete") { if (uBLL.GetModel(deptID).isCheck == "已审核") { Alert.ShowInTop("已经审核,无法删除!"); return; } bool isTrue = uBLL.Delete(deptID); if (!isTrue) { Alert.ShowInTop("删除失败!"); return; } else { LoadData(); } } else if (e.CommandName == "Edit") { string openUrl = String.Format("./TopicEdit.aspx?Id={0}&tId=" + tId, HttpUtility.UrlEncode(deptID.ToString())); PageContext.RegisterStartupScript(Window1.GetSaveStateReference(deptID.ToString()) + Window1.GetShowReference(openUrl, "编辑议题")); } else if (e.CommandName == "Check") { Model.tUsers user = GetIdentityUser(); if (!haveRight(user.userId, "三重一大审批")) { Alert.ShowInTop("当前用户没有权限审批!"); return; } Model.tTopic top = uBLL.GetModel(deptID); if (top.isCheck == "已审核") { //if (top.isCheckPeo != user.usersName) //{ // Alert.ShowInTop("当前用户没有权限审批!"); // return; //} top.isCheck = "待审核"; top.isCheckPeo = null; top.isCheckTime = null; } else { top.isCheck = "已审核"; top.isCheckPeo = user.usersName; top.isCheckTime = DateTime.Now; } bool isTrue = uBLL.Update(top); if (!isTrue) { Alert.ShowInTop("操作失败!"); return; } else { LoadData(); } } }