コード例 #1
0
 //改为与用户角色绑定,不与步骤绑定
 public void AuthCheck(DataTable authDT)
 {
     //------------权限
     traceless_btn.Visible = perBll.CheckAuth(authDT, "oa_doc_traceless");
     hastrace_btn.Visible  = perBll.CheckAuth(authDT, "oa_doc_hastrace");
     Head_DP.Enabled       = perBll.CheckAuth(authDT, "oa_doc_head");
     Sign_DP.Enabled       = perBll.CheckAuth(authDT, "oa_doc_sign");
     if (!perBll.CheckAuth(authDT, "oa_doc_edit"))
     {
         save_btn.Visible  = false;
         Protect_Hid.Value = "0";
     }
 }
コード例 #2
0
 //借阅列表
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!perBll.CheckAuth(new B_User().GetLogin().UserRole, "oa_pro_file"))
     {
         function.WriteErrMsg("你没有访问该页面的权限");
     }
     if (!IsPostBack)
     {
         MyBind();
     }
 }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            M_OA_Document oaMod = oaBll.SelReturnModel(appID);

            if (oaMod.Status != (int)ZLEnum.ConStatus.Filed)
            {
                function.WriteErrMsg("该文件尚未归档,无法查看!");
            }
            //验证是否拥有档案管理员或已有借阅权限
            M_UserInfo mu = buser.GetLogin();

            if (perBll.CheckAuth(mu.UserRole, "oa_pro_file") || borBll.HasAuth(mu.UserID, appID))
            {
            }
            else
            {
                function.WriteErrMsg("该文件已归档,你没有对应的查看权限!");
            }
            MyBind(oaMod);
        }
コード例 #4
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
     }
 }