public void CreateFreeStep(M_OA_Document oaMod, M_MisProcedure proceMod, OAStepParam param) { M_MisProLevel freeMod = null; if (param.IsFirst) { freeMod = freeBll.SelByDocID(oaMod.ID); } else if (param.StepID > 0)//修改步骤 { freeMod = freeBll.SelReturnModel(param.StepID); } bool isUpdate = true; if (freeMod == null)//非修改则新建 { isUpdate = false; freeMod = new M_MisProLevel(); } freeMod.ProID = proceMod.ID; freeMod.stepNum = param.StepNum; freeMod.stepName = proceMod.ProcedureName + "第" + param.StepNum + "步"; freeMod.SendMan = buser.GetLogin().UserID.ToString(); freeMod.ReferUser = param.ReferUser.Trim(','); freeMod.ReferGroup = ""; freeMod.CCUser = param.CCUser.Trim(','); freeMod.CCGroup = ""; freeMod.HQoption = 1; freeMod.Qzzjoption = 0; freeMod.HToption = 2; freeMod.EmailAlert = ""; freeMod.EmailGroup = ""; freeMod.SmsAlert = ""; freeMod.SmsGroup = ""; freeMod.BackOption = oaMod.ID; freeMod.PublicAttachOption = 1; freeMod.PrivateAttachOption = 1; freeMod.DocAuth = "refer"; freeMod.Status = 1; freeMod.CreateTime = DateTime.Now; freeMod.Remind = oaMod.Title + "的流程"; if (isUpdate) { freeBll.UpdateByID(freeMod); } else { freeBll.Insert(freeMod); if (!param.IsFirst)//非起始步骤修改,则更新状态 { oaMod.Status = 0; oaBll.UpdateByID(oaMod); } } }
//转交 protected void zjBtn_Click(object sender, EventArgs e) { //只修改步骤,不做其他任何修改 oaMod = oaBll.SelReturnModel(appID); if (zjDP.SelectedValue == "-1") //较交给下一步 { oaMod.CurStepNum = oaMod.CurStepNum == 0 ? 2 : (oaMod.CurStepNum + 1); //默认步数为零 } else { oaMod.CurStepNum = Convert.ToInt32(zjDP.SelectedValue); } oaBll.UpdateByID(oaMod); Response.Redirect("../AffairsList.aspx?View=2"); }
//保存 protected void Save_Btn_Click(object sender, EventArgs e) { OAFormUI.vstate = ViewState; Call commonCall = new Call(); M_OA_Document oaMod = null; if (Mid > 0) { oaMod = oaBll.SelReturnModel(Mid); } oaMod = FillMod(oaMod); M_MisProcedure proceMod = proceBll.SelReturnModel(ProID); DataTable table = OAFormUI.CreateTable(OAFormUI.GetFields(OAFormUI.ModelID).Split(',')); if (Mid > 0)//修改 { M_CommonData conMod = conBll.SelReturnModel(Convert.ToInt32(oaMod.Content)); conBll.UpdateContent(table, conMod); oaBll.UpdateByID(oaMod); } else { oaMod.Content = commonCall.AddContentToNode(oaMod, NodeID, OAFormUI.ModelID, table).ToString(); oaMod.ID = oaBll.insert(oaMod); } oaCom.CreateStep(oaMod, proceMod, new OAStepParam() { IsFirst = true, ReferUser = ReferUser_Hid.Value, StepNum = 1 }); Response.Redirect("ViewDrafting.aspx?ID=" + oaMod.ID + "&FlowType=2"); }
//protected void Type_SelectedIndexChanged(object sender, EventArgs e) //{ // int modelID = DataConvert.CLng(Type.SelectedValue.ToString()); // if (modelID > 0) // { // mmis = bmis.SelReturnModel(modelID); // Content.Text = mmis.ModelContent; // } // else // { // Content.Text = ""; // } //} //protected void proDP_SelectedIndexChanged(object sender, EventArgs e) //{ // if (proDP.SelectedIndex == 0) return; // int proID = DataConvert.CLng(proDP.SelectedValue); // proMod = proBll.SelReturnModel(proID); // if (proMod.AllowAttach == 1) // { // upFileTR.Visible = true; // } //} //保存 #endregion protected void saveBtn_Click(object sender, EventArgs e) { int proID = DataConverter.CLng(proDP.SelectedValue); int id = 0; if (Request.QueryString["Edit"] == "1" && Request.QueryString["appID"] != "") { moa = boa.SelReturnModel(DataConvert.CLng(Request.QueryString["appID"])); id = moa.ID; FillMod(0, moa); boa.UpdateByID(moa); } else { moa = FillMod(0); id = boa.insert(moa); } CreateStep(id); Response.Redirect("ViewDrafting.aspx?ID=" + id); }
//protected void Type_SelectedIndexChanged(object sender, EventArgs e) //{ // int modelID = DataConvert.CLng(Type.SelectedValue.ToString()); // if (modelID > 0) // { // mmis = bmis.SelReturnModel(modelID); // Content.Text = mmis.ModelContent; // } // else // { // Content.Text = ""; // } //} //protected void proDP_SelectedIndexChanged(object sender, EventArgs e) //{ // if (proDP.SelectedIndex == 0) return; // int proID = DataConvert.CLng(proDP.SelectedValue); // proMod = proBll.SelReturnModel(proID); // if (proMod.AllowAttach == 1) // { // upFileTR.Visible = true; // } //} //保存 #endregion protected void saveBtn_Click(object sender, EventArgs e) { int proID = DataConverter.CLng(proDP.SelectedValue); if (Request.QueryString["Edit"] == "1" && Request.QueryString["appID"] != "") { moa = boa.SelReturnModel(DataConvert.CLng(Request.QueryString["appID"])); FillMod(0, moa); boa.UpdateByID(moa); } else { moa = FillMod(0); moa.ID = boa.insert(moa); } M_MisProcedure proceMod = proBll.SelReturnModel(moa.ProID); oaCom.CreateStep(moa, proceMod, new OAStepParam() { IsFirst = true, ReferUser = RUserID_Hid.Value, StepNum = 1 }); { //同步入能力中心 M_User_Plat upMod = B_User_Plat.GetLogin(); if (upMod != null) { B_Blog_Msg msgBll = new B_Blog_Msg(); M_Blog_Msg msgMod = new M_Blog_Msg(); msgMod.CompID = upMod.CompID; msgMod.CUser = upMod.UserID; msgMod.CUName = upMod.TrueName; msgMod.MsgContent = "[" + upMod.TrueName + "]发布了一条公文,标题:<a href=\"/Office/Office/ReadOffice.aspx?AppID=" + moa.ID + "\" target=\"_blank\">" + moa.Title + "</a>"; msgMod.GroupIDS = ""; msgBll.Insert(msgMod); } } Response.Redirect("ViewDrafting.aspx?ID=" + moa.ID); }