protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { M_UserInfo mu = buser.GetLogin(); M_MisProcedure proceMod = new M_MisProcedure(); if (Mid < 1) { ProID = DataConverter.CLng(Request.QueryString["ProID"]); if (ProID < 1) { function.WriteErrMsg("请先指定需要创建的流程!"); } proceMod = proceBll.SelReturnModel(ProID); if (!perBll.ContainRole(proceMod.Sponsor, mu.UserRole)) { function.WriteErrMsg("你没有权限使用该流程"); } ascx = proceMod.FlowTlp; ModelID = Convert.ToInt32(proceMod.FormInfo); OAFormUI.InitControl(ViewState, ModelID); switch (proceMod.MyProType) { case M_MisProcedure.ProTypes.Admin: SelUser_Tr.Visible = false; break; } ViewState["No"] = CreateNo(proceMod); //OAFormUI.Title_T = proceMod.ProcedureName; OAFormUI.SendDate_ASCX = DateTime.Now.ToString("yyyy年MM月dd日 HH:mm"); } else { M_OA_Document oaMod = new M_OA_Document(); oaMod = oaBll.SelReturnModel(Mid); if (mu.UserID != oaMod.UserID) { function.WriteErrMsg("非发起人不能修改文档!"); } if (oaBll.HasBegin(oaMod.ID)) { function.WriteErrMsg("已开始的流程不能修改"); } ProID = oaMod.ProID; proceMod = proceBll.SelReturnModel(oaMod.ProID); FName_Hid.Value = oaMod.PrivateAttach;//Word文档 ascx = proceMod.FlowTlp; ModelID = Convert.ToInt32(proceMod.FormInfo); OAFormUI.InitControl(ViewState, ModelID); OAFormUI.Title_ASCX = oaMod.Title; OAFormUI.SendDate_ASCX = oaMod.SendDate.ToString(); OAFormUI.NO_ASCX = oaMod.No; M_MisProLevel freeMod = freeBll.SelByDocID(oaMod.ID); if (freeMod != null) { ReferUser_T.Text = buser.GetUserNameByIDS(freeMod.ReferUser); ReferUser_Hid.Value = freeMod.ReferUser; } ViewState["No"] = oaMod.No; Save_Btn.Text = "修改发文"; } OAFormUI.NO_ASCX = ViewState["No"].ToString(); NodeID = proceMod.NodeID; ShowPage(proceMod); } }