protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataBind();
         if (Mid > 0)
         {
             proMod                    = proBll.SelReturnModel(Mid);
             proNameT.Text             = proMod.ProcedureName;
             NickName_T.Text           = proMod.SponsorGroup;
             ProClass_DP.SelectedValue = proMod.ClassID.ToString();
             ProType_DP.SelectedValue  = proMod.TypeID.ToString();
             //FormType_Rad.SelectedValue = proMod.FormType.ToString();
             FormInfo_T.Text = proMod.FormInfo;
             //manager_Hid.Value = proMod.Manager;
             sponsor_Hid.Value = proMod.Sponsor;
             //manager_T.Text = perBll.GetRoleNameByIDs(proMod.Manager); //buser.GetUserNameByIDS(proMod.Manager);
             sponsor_T.Text      = perBll.GetRoleNameByIDs(proMod.Sponsor);
             flowdoc_chk.Checked = proMod.AllowAttach == 1;
             //CanEditField_T.Text = proMod.CanEditField;
             remindT.Text              = proMod.Remind;
             FlowTlp_DP.SelectedValue  = proMod.FlowTlp;
             PrintTlp_DP.SelectedValue = proMod.PrintTlp;
             function.Script(this, "SetChkVal('docauth_chk','" + proMod.DocAuth + "');");
         }
     }
     Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='../Config/SiteOption.aspx'>系统设置</a></li><li><a href='Default.aspx'>流程管理</a></li><li class='active'>添加流程</a></li>");
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string proName = "";
                if (ProID > 0)
                {
                    M_MisProcedure proceMod = proBll.SelReturnModel(ProID);
                    if (proceMod != null)
                    {
                        proName = "[" + proceMod.ProcedureName + "]";
                    }
                }
                switch (CurrentView)
                {
                case "1":
                    CurView_L.Text = "待办公文" + proName;
                    break;

                case "2":
                    CurView_L.Text = "已办公文" + proName;
                    break;

                case "3":
                    CurView_L.Text = "我的公文" + proName;
                    break;

                case "4":
                    CurView_L.Text = "我的借阅" + proName;
                    break;
                }
                MyBind();
            }
        }
示例#3
0
        public void MyBind(M_OA_Document oaMod)
        {
            M_UserInfo mu = buser.GetLogin();

            SendMan_L.Text         = oaMod.UserName;
            stepNameL.Text         = "已完结";
            ascx                   = proceBll.SelReturnModel(oaMod.ProID).FlowTlp;
            OAFormUI.SendDate_ASCX = oaMod.SendDate.ToString();
            createTimeL.Text       = oaMod.SendDate.ToString("yyyy年MM月dd日 HH:mm");
            ModelID                = Convert.ToInt32(proceBll.SelReturnModel(oaMod.ProID).FormInfo);
            DataTable dtContent = conBll.GetContent(Convert.ToInt32(oaMod.Content));

            OAFormUI.InitControl(ViewState, ModelID);
            OAFormUI.dataRow = dtContent.Rows[0];
            OAFormUI.MyBind();
            OAFormUI.Title_ASCX        = oaMod.Title;
            OAFormUI.NO_ASCX           = oaMod.No;
            OAFormUI.No_ASCX_T.Enabled = false;
        }
        //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);
        }
示例#5
0
        public ActionResult EditProcedure()
        {
            int            id     = Convert.ToInt32(Request.QueryString["ProID"]);
            M_MisProcedure proMod = mpBll.SelReturnModel(id);

            if (proMod != null)
            {
                ViewBag.TxtName = proMod.ProcedureName;
                DataTable dt = proBll.SelByProID(id);
                ViewBag.repdt = dt;
                if (dt.Rows.Count > 0)
                {
                    ViewBag.txtTRLastIndex = (dt.Rows.Count + 1).ToString();
                }
                else
                {
                    ViewBag.txtTRLastIndex = "1";
                }
                SqlParameter[] sp2  = new SqlParameter[] { new SqlParameter("ID", proMod.MyProType) };
                string         Name = mtBll.Sel("ID=@ID", "ID", sp2).Rows[0]["TypeName"].ToString();
                ViewBag.DrpTypeSel = Name;
            }
            else
            {
                ViewBag.TxtName.Text = "";
            }

            DataTable             types    = mtBll.Sels();
            List <SelectListItem> nodeList = new List <SelectListItem>();

            nodeList.Add(new SelectListItem {
                Text = "全部", Value = "0"
            });
            foreach (DataRow row in types.Rows)
            {
                nodeList.Add(new SelectListItem {
                    Text = row.Field <string>("TypeName"), Value = row.Field <int>("ID").ToString()
                });
            }
            ViewBag.types = nodeList;
            return(View());
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (AppID < 1)
         {
             function.WriteErrMsg("未指定需要打印的文档");
         }
         M_OA_Document  oaMod    = oaBll.SelReturnModel(AppID);
         M_MisProcedure proceMod = proceBll.SelReturnModel(oaMod.ProID);
         ascx = proceMod.PrintTlp;
         OAFormUI.InitControl(ViewState, Convert.ToInt32(proceMod.FormInfo));
         OAFormUI.Title_ASCX    = oaMod.Title;
         OAFormUI.SendDate_ASCX = oaMod.SendDate.ToString("yyyy年MM月dd日");
         OAFormUI.NO_ASCX       = oaMod.No;
         DataTable dtContent = conBll.GetContent(Convert.ToInt32(oaMod.Content));
         OAFormUI.dataRow = dtContent.Rows[0];
         OAFormUI.MyBind();
     }
 }
        private void MyBind()
        {
            //stepCodeT.Text = GenStepCode(proID).ToString();
            string key = searchText.Text;

            proMod           = proBll.SelReturnModel(ProID);
            ProceName_L.Text = proMod.ProcedureName;
            DataTable dt = new DataTable();

            dt = stepBll.SelByProID(ProID);
            if (!string.IsNullOrEmpty(key))
            {
                dt.DefaultView.RowFilter = "StepName like '%" + key + "%'";
            }
            if (dt.Rows.Count > 1)
            {
                orderBtn.Visible = true;
            }
            EGV.DataSource = dt;
            EGV.DataBind();
            ImgData_Hid.Value = JsonHelper.JsonSerialDataTable(dt);
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                #region AJAX请求
                string result = "", action = Request["action"], value = Request["value"];
                switch (action)
                {
                case "signpwdcheck":
                {
                    int       id      = DataConverter.CLng(Request["SignID"]);
                    string    signpwd = Request["SignPwd"];
                    M_OA_Sign signMod = signBll.SelByPwd(id, signpwd);
                    if (signMod == null)
                    {
                        result = "0";
                    }
                    else
                    {
                        result = signMod.VPath.Replace("//", "/");
                        //-----写入至数据库
                        M_UserInfo     mu        = buser.GetLogin();
                        M_OA_DocSigned signedMod = new M_OA_DocSigned();
                        signedMod.ProID    = ProID; //同名签章在一个流程中只能有一个
                        signedMod.Step     = 0;     //暂时不使用
                        signedMod.UserID   = mu.UserID;
                        signedMod.VPath    = signMod.VPath;
                        signedMod.SignID   = id;
                        signedMod.SignName = signMod.SignName;
                        signedMod.AppID    = AppID;
                        signedMod.CUName   = mu.UserName;
                        signedBll.InsertNoDup(signedMod);
                    }
                }
                break;

                default:    //addword
                    break;
                }
                Response.Clear();
                Response.Write(result); Response.Flush(); Response.End();
                #endregion
            }
            if (!IsPostBack)
            {
                M_UserInfo     mu       = buser.GetLogin();
                M_MisProcedure proceMod = proceBll.SelReturnModel(ProID);
                AuthDT = perBll.SelAuthByRoles(mu.UserRole);
                string getword = "/Plugins/Office/OfficeAction.ashx?action=getword&AppID=" + AppID;
                if (!string.IsNullOrEmpty(FName))
                {
                    getword += "&fname=" + HttpUtility.UrlEncode(FName);
                    function.Script(this, "DelayLoadFile('" + getword + "');");
                    AuthCheck(AuthDT);
                }
                else if (Action.Equals("add") && ProID > 0)//新建
                {
                    FName = GetWordName(proceMod.ProcedureName);
                    function.Script(this, "CreateDoc();");
                    AuthCheck(AuthDT);
                }
                else if (AppID > 0)//根据主键ID,打开其已有文档
                {
                    Sign_DP.Enabled = true;
                    M_OA_Document oaMod = oaBll.SelReturnModel(AppID);
                    if (oaMod.IsComplete)
                    {
                        AuthCheck(null);
                    }                                         //已完结则关闭操作权限
                    else
                    {
                        M_MisProLevel stepMod = stepBll.SelByProIDAndStepNum(oaMod.ProID, oaMod.CurStepNum + 1);
                        AuthCheck(AuthDT);
                    }
                    //------------打开公文
                    if (!string.IsNullOrEmpty(oaMod.PrivateAttach))
                    {
                        FName = Path.GetFileName(HttpUtility.UrlDecode(oaMod.PrivateAttach));
                        function.Script(this, "DelayLoadFile('" + getword + "');");
                    }
                }
                else
                {
                    function.WriteErrMsg("参数不正确,请先核对!");
                }
                MyBind(); BindSigned();
            }
        }
        //与写入新的进度信息,如果是最后一步或是拒绝,则更新OA模型
        private void UpdateModel(int status)
        {
            //会签需要加判断,备注需要另外处理
            oaMod = oaBll.SelReturnModel(appID);
            //throw new Exception(progBll.IsHQComplete(appID, userID, CurrentStep).ToString());
            progMod.AppID        = oaMod.ID;
            progMod.ProID        = oaMod.ProID;
            progMod.ProLevel     = CurrentStep.stepNum;
            progMod.ProLevelName = CurrentStep.stepName;
            progMod.ApproveID    = userID;
            progMod.Result       = status;
            progMod.Remind       = remindT.Text;
            progMod.CreateTime   = DateTime.Now;
            progMod.HQUserID     = userID.ToString();
            if (signRadio.Items.Count > 0 && signRadio.SelectedIndex > 0)//0是不使用签章
            {
                progMod.Sign   = signRadio.SelectedValue + ":" + curPosD.Value;
                progMod.SignID = signRadio.SelectedValue;
            }
            //用于email与sms通知功能
            string content = "";

            //是否为最后一步
            bool isLastStep = false;

            if (oaMod.ProID == 0)
            {
                isLastStep = freeBll.IsLastStep(oaMod, CurrentStep);
            }
            else
            {
                isLastStep = stepBll.IsLastStep(CurrentStep);
            }

            //增加通知功能,
            if (isLastStep && status == 99 || status == 98)
            {
                if (CurrentStep.HQoption > 0)//会签判断
                {
                    if (progBll.IsHQComplete(appID, userID, CurrentStep))
                    {
                        oaMod.Status     = status;//流程完成,全部同意
                        oaMod.CurStepNum = CurrentStep.stepNum;
                        content          = oaMod.Title + "会签完成,已进入下一步骤";
                    }
                }
                else
                {
                    oaMod.Status     = status;//流程完成,全部同意
                    oaMod.CurStepNum = CurrentStep.stepNum;
                    content          = oaMod.Title + "已完成" + CurrentStep.stepName + ",进入下一步骤";
                }
            }
            else if (status == 2) //回退
            {
                oaMod.Status = 2;

                int rbStep = DataConvert.CLng(rollBackDP.SelectedValue);
                if (rbStep > 0)
                {
                    rbStep = rbStep - 1;
                    //自由流程回退删除步骤
                    if (oaMod.IsFreePro)
                    {
                        freeBll.DelByStep(oaMod.ID, Convert.ToInt32(rollBackDP.SelectedValue));
                    }
                }
                else  //回退至上一步(-1)
                {
                    rbStep = CurrentStep.stepNum - 2;
                    //自由流程回退删除步骤
                    if (oaMod.IsFreePro)
                    {
                        freeBll.DelByStep(oaMod.ID, CurrentStep.stepNum - 1);
                    }
                }
                oaMod.CurStepNum = rbStep;
                progMod.Remind2  = "回退至" + rbStep;
                progMod.HQUserID = "";
                content          = oaMod.Title + "已被经办人回退至" + rbStep;
                //回退的时候,清除目标会签与签章信息
                progBll.ClearHQ(oaMod.ID, rbStep);
                progBll.ClearSign(oaMod.ID, rbStep);
            }
            else if (status == -1)
            {
                oaMod.Status     = status; //拒绝
                oaMod.CurStepNum = CurrentStep.stepNum;
                content          = oaMod.Title + "已被经办人" + buser.GetLogin().HoneyName + "拒绝.";
            }
            else//同意,但未至最后一步
            {
                if (CurrentStep.HQoption > 0)//需要会签
                {
                    if (progBll.IsHQComplete(appID, userID, CurrentStep))
                    {
                        oaMod.CurStepNum = CurrentStep.stepNum;
                        content          = oaMod.Title + "已完成会签审批,成功通过";
                        //if (oaMod.IsFreePro) oaMod.Status = status;//如果是自由流程就仍更新状态
                    }
                }
                else
                {
                    oaMod.CurStepNum = CurrentStep.stepNum;
                    content          = oaMod.Title + "已完成审批,成功通过";
                }
            }

            if (!string.IsNullOrEmpty(CurrentStep.EmailAlert))//Email与sms通知
            {
                //发送邮件包括会员组里的会员(需扩展支持会员组)
                string ids = "";
                if (!string.IsNullOrEmpty(CurrentStep.EmailGroup))
                {
                    ids += groupBll.GetUserIDByGroupIDS(CurrentStep.EmailGroup);
                }
                ids += CurrentStep.SmsAlert;
                ids  = ids.Trim(',');
                emailToUser(content, ids);
            }
            if (!string.IsNullOrEmpty(CurrentStep.SmsAlert))
            {
                smsTouser(content, CurrentStep.SmsAlert);
            }
            progBll.Insert(progMod);
            oaBll.UpdateByID(oaMod);
            //分发功能
            if (isLastStep && oaMod.Status == 99 && !oaMod.IsFreePro)
            {
                B_MisProcedure prodBll = new B_MisProcedure();
                M_MisProcedure prodMod = prodBll.SelReturnModel(oaMod.ProID);
                if (prodMod.NodeID > -1)//指定了节点,才分发
                {
                    commCall.AddContentToNode(oaMod, prodMod.NodeID, OAConfig.ModelID);
                }
            }
        }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //需要加上验证权限,发起人,经办人,审核人可查看进程,只要任意一步骤有该权限
     userID = buser.GetLogin().UserID;
     if (function.isAjax())//处理AJAX
     {
         #region AJAX
         string action = Request.Form["action"];
         string value  = Request.Form["value"];
         string result = "0";
         switch (action)
         {
         case "PostDate":
             int      id   = Convert.ToInt32(value.Split(':')[0]);
             DateTime date = Convert.ToDateTime(value.Split(':')[1]);
             progBll.UpdateDate(userID, id, date);
             result = "1";
             break;
         }
         Response.Write(result); Response.Flush(); Response.End();
         #endregion
     }
     DataTable dt = buser.SelByUserID(userID);//用于验证是否有主办或经办权限,已改为与角色绑定,可以不需要使用dt
     oaMod = oaBll.SelReturnModel(appID);
     if (oaMod.Status == (int)ZLEnum.ConStatus.Filed)
     {
         Response.Redirect("FlowView.aspx?action=filed&appid=" + appID);
     }
     if (!IsPostBack)
     {
         #region 权限检测
         M_UserInfo sendmu = buser.GetSelect(oaMod.UserID);
         M_UserInfo mu     = buser.GetLogin();
         ascx = proceBll.SelReturnModel(oaMod.ProID).FlowTlp;
         //回退权限
         if (CurrentStep.HToption > 0)
         {
             if (oaMod.CurStepNum == 0)//如果为起始步,则不管是否有权限都不显示
             {
             }
             else
             {
                 rollBackSpan.Visible = true;
                 rollBackBtn.Visible  = true;
                 if (CurrentStep.HToption == 1)
                 {
                     rollBackDP.Items.Insert(0, new ListItem("回退至上一步", "-1"));
                 }
                 else if (CurrentStep.HToption == 2)
                 {
                     FreeDPDataBind();
                     rollBackDP.Items.Insert(0, new ListItem("回退至上一步", "-1"));
                 }
             }
         }
         //转交权限
         if (CurrentStep.Qzzjoption > 0)
         {
             if (stepBll.IsLastStep(CurrentStep))//如果是最后一步,则也不显示
             {
             }
             else
             {
                 zjSpan.Visible = true;
                 ZJDataBind();
                 zjDP.Items.Insert(0, new ListItem("下一步", "-1"));
             }
         }
         #region 签章
         DataTable signDT = signBll.SelByUserID(buser.GetLogin().UserID);
         if (oaMod.IsComplete)
         {
             signTr.Visible = false;
         }
         else if (signDT != null && signDT.Rows.Count > 0)
         {
             SignRadioBind(signDT);
         }
         else
         {
             signTrRemind.Visible = true;
         }
         SignImgBind();
         #endregion
         //-------------------经办,审阅等权限
         #region 是否是经办,抄送或发起人
         if (CurrentStep.Auth(M_MisProLevel.AuthEnum.Refer, dt))
         {
             //拥有经办权限
             agreeBtn.Visible  = true;
             rejectBtn.Visible = true;
             //检测用户有无修改编号或表单的权限,如果有的话,则显示修改表单栏
             SaveForm_Btn.Visible = true;
             //formop_tr.Visible = true;
         }
         else if (CurrentStep.Auth(M_MisProLevel.AuthEnum.CCUser, dt))
         {
             //拥有抄送权限
             DisAllAuth();
             signTr.Visible  = true;
             ccOPBar.Visible = true;
             if (progBll.CheckApproval(buser.GetLogin().UserID, CurrentStep.stepNum, oaMod.ID))
             {
                 signTr.Visible     = false;
                 ccUser_Btn.Visible = false;
                 ccUser_Lab.Visible = true;
             }
         }
         else if (oaMod.UserID == userID)//发起人查看文件
         {
             DisAllAuth();
         }
         else
         {
             function.WriteErrMsg("你当前无权限批复该公文!!");
         }
         #endregion
         //附件删除权限,拥有权限和附件的时候才显示
         if (CurrentStep.PublicAttachOption > 0 && !string.IsNullOrEmpty(oaMod.PublicAttach))
         {
             //delAttachBtn.Visible = true;
         }
         //显示附件
         if (!string.IsNullOrEmpty(oaMod.PublicAttach))
         {
             function.Script(this, "ZL_Webup.AddReadOnlyLi('" + oaMod.PublicAttach + "');");
         }
         //会签
         if (CurrentStep.HQoption > 0)
         {
             string ids = progBll.SelHQUserID(appID, CurrentStep.stepNum);
             hqTr.Visible = true;
             hqL.Text     = buser.GetUserNameByIDS(ids);
             //如果用户已会签,则不显示拒绝与同意
             if (ids.Split(',').Select(p => p).Contains(buser.GetLogin().UserID.ToString()))
             {
                 opBar.Visible = false;
             }
             //显示未会签人
             string[] allUser = CurrentStep.ReferUser.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
             string   ids2    = StrHelper.RemoveRepeat(allUser, ids.Split(','));//未会签用户
             if (string.IsNullOrEmpty(ids2.Replace(",", "")))
             {
                 unHql.Text = "(办理完成!!!)";
             }
             else
             {
                 unHql.Text = "(尚未办理:" + buser.GetUserNameByIDS(ids2) + ")";
             }
         }
         if (oaMod.Status == -1 || oaMod.Status == 99 || oaMod.Status == 98)
         {
             //如果当前流程已完成,或已被拒绝
             //opBar.Visible = false;
             //delAttachBtn.Visible = false;
         }
         //该栏与上一栏只能显示一个
         if (oaMod.Status == 98 && freeBll.IsLastFreeStep(CurrentStep))//是自由流程,已同意,并且是最后一步时,显示该栏
         {
             if (oaMod.ProType == (int)M_MisProcedure.ProTypes.Free)
             {
                 Free_OP_Tr.Visible = HasNextAuth(CurrentStep, oaMod, mu);
             }
             else if (oaMod.ProType == (int)M_MisProcedure.ProTypes.AdminFree)
             {
                 AdminFree_OP_Tr.Visible = HasNextAuth(CurrentStep, oaMod, mu);
             }
         }
         #region 数据绑定
         //ProceName_L.Text = oaMod.Title;
         ////titleL.Text = oaMod.Title;
         if (!string.IsNullOrEmpty(oaMod.PrivateAttach))
         {
             function.Script(this, "ShowWord();");
         }
         SendMan_L.Text         = sendmu.HoneyName;
         stepNameL.Text         = CurrentStep.stepName;
         OAFormUI.SendDate_ASCX = oaMod.SendDate.ToString();
         createTimeL.Text       = oaMod.SendDate.ToString("yyyy年MM月dd日 HH:mm");
         //txt_Content.Text = oaCom.ReplaceHolder(oaMod);
         ModelID = Convert.ToInt32(proceBll.SelReturnModel(oaMod.ProID).FormInfo);
         DataTable dtContent = conBll.GetContent(Convert.ToInt32(oaMod.Content));
         OAFormUI.InitControl(ViewState, ModelID);
         if (dtContent != null && dtContent.Rows.Count > 0)
         {
             OAFormUI.dataRow = dtContent.Rows[0];
             OAFormUI.MyBind();
         }
         OAFormUI.Title_ASCX = oaMod.Title;
         OAFormUI.NO_ASCX    = oaMod.No;
         DataTable authDT = perBll.SelAuthByRoles(mu.UserRole);
         OAFormUI.No_ASCX_T.Enabled = perBll.CheckAuth(authDT, "oa_pro_no");
         DataBind();
         #endregion
         #endregion
     }
 }
示例#11
0
 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);
     }
 }