/// <summary> /// 保存操作 /// </summary> private void DoSave() { Leave ent = null; id = FormData.Get <String>("Id"); if (String.IsNullOrEmpty(id)) { ent = this.GetPostedData <Leave>(); ent.DoCreate(); } else { ent = this.GetMergedData <Leave>(); ent.DoUpdate(); } this.SetFormData(ent); }
string type = String.Empty; // 对象类型 #endregion #region ASP.NET 事件 protected void Page_Load(object sender, EventArgs e) { string db = ConfigurationManager.AppSettings["ExamineDB"]; op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); type = RequestData.Get <string>("type"); Leave ent = null; switch (this.RequestAction) { case RequestActionEnum.Update: ent = this.GetMergedData <Leave>(); ent.DoUpdate(); this.SetMessage("修改成功!"); break; case RequestActionEnum.Insert: case RequestActionEnum.Create: ent = this.GetPostedData <Leave>(); //自动生成流水号 ent.Number = DataHelper.QueryValue("select " + db + ".dbo.fun_getLeaveNumber()") + ""; ent.DoCreate(); this.SetMessage("新建成功!"); break; case RequestActionEnum.Delete: ent = this.GetTargetData <Leave>(); ent.DoDelete(); this.SetMessage("删除成功!"); return; default: if (RequestActionString == "save") { DoSave(); } else if (RequestActionString == "submitfinish") { Leave pc = Leave.Find(this.RequestData.Get <string>("id")); pc.State = "End"; pc.AppState = this.RequestData.Get <string>("ApprovalState"); pc.Save(); } break; } if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = Leave.Find(id); } this.SetFormData(ent); this.PageState.Add("State", ent.State); } if (op == "c") { PageState.Add("ReleDepartment", DataHelper.QueryValue("select " + db + ".dbo.get_DeptName('" + UserInfo.UserID + "')")); } this.PageState.Add("FlowEnum", SysEnumeration.GetEnumDictList("WorkFlow.Simple")); PageState.Add("LeaveType", SysEnumeration.GetEnumDict("LeaveType")); }