예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         M_UserInfo mu     = buser.GetLogin();
         DataTable  authdt = perBll.SelAuthByRoles(mu.UserRole);
         RPT.DataSource = progBll.SelHQDT(AppID, 1);
         RPT.DataBind();
         // No_T.Enabled = perBll.CheckAuth(authdt,"oa_pro_no");
     }
 }
예제 #2
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();
            }
        }
예제 #3
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
     }
 }