protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id = Convert.ToInt32(Request.QueryString["ID"]);
                moa                  = boa.SelReturnModel(id);
                minfo                = buser.SeachByID(moa.UserID);
                this.LBTitle.Text    = moa.Title;
                this.LBKeyWords.Text = moa.Keywords;
                this.AddUSer.Text    = minfo.HoneyName;
                this.AddTime.Text    = moa.CreateTime.ToString();
                M_MisProLevel freeMod = freeBll.SelByDocID(id);
                if (freeMod != null)
                {
                    if (freeMod.ProID == 0)
                    {
                        preViewBtn.Visible = false;
                    }
                    RUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.ReferUser);

                    CUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.CCUser);
                    RUserID_Hid.Value  = freeMod.ReferUser;
                    CUserID_Hid.Value  = freeMod.CCUser;
                }
            }
        }
Example #2
0
        protected void singleBtn_Click(object sender, EventArgs e)
        {
            int id     = Convert.ToInt32(pageData.Value.Split(':')[0]);
            int nodeID = Convert.ToInt32(pageData.Value.Split(':')[1]);

            oaMod = oaBll.SelReturnModel(id);
            commCall.AddContentToNode(oaMod, nodeID, OAConfig.ModelID);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('分发成功!!!');", true);
        }
        protected void Del_Btn_Click(object sender, EventArgs e)
        {
            int        id = DataConvert.CLng(DelID_Hid.Value);
            M_UserInfo mu = buser.GetLogin();

            if (id > 0)
            {
                M_OA_Document oaMod = oaBll.SelReturnModel(id);
                if (oaMod.CurStepNum > 0 || oaMod.UserID != mu.UserID)
                {
                    function.WriteErrMsg("已开始流程,不可删除");
                }
                else
                {
                    oaBll.Del(id);
                    MyBind();
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SafeSC.Submit_Begin(this.ViewState);
         if (string.IsNullOrEmpty(Request.QueryString["AppID"]))
         {
             function.WriteErrMsg("未指定公文ID");
         }
         else
         {
             //只有上一级经办人有权限继续指定流程
             //M_MisProLevel fMod = freeBll.GetLastStep(AppID);
             //if (!fMod.ReferUser.Contains("," + buser.GetLogin().UserID + ",")) function.WriteErrMsg("只有上一级经办人才有权限修改该流程");
             if (StepID > 0)//修改步骤
             {
                 return_Btn.Visible = true;
                 freeMod            = freeBll.SelReturnModel(StepID);
                 moa = boa.SelReturnModel(AppID);
                 //-----Auth
                 if (!moa.IsFreePro)
                 {
                     function.WriteErrMsg("非自由流程,不允许自指定步骤");
                 }
                 if (freeMod.BackOption != AppID)
                 {
                     function.WriteErrMsg("公文与步骤数据不匹配,取消访问!!!");
                 }
                 if (moa.CurStepNum >= freeMod.stepNum)
                 {
                     function.WriteErrMsg("该步骤已执行,不允许修改!!!");
                 }
                 //-----
                 ReferUser_T.Text    = buser.GetUserNameByIDS(freeMod.ReferUser);
                 ReferUser_Hid.Value = freeMod.ReferUser;
                 CCUser_T.Text       = buser.GetUserNameByIDS(freeMod.CCUser);
                 CCUser_Hid.Value    = freeMod.CCUser;
             }
             else
             {
                 //-----Auth2(只允许创建下一步)
                 if (freeBll.GetStep(AppID) - CurStepNum > 1)
                 {
                     Free_Div.Visible = false;
                     remind2.Visible  = true;
                 }
             }
             Page.ClientScript.RegisterStartupScript(this.GetType(), "disFoo", "ShowFoo();", true);
             DataBind();//绑定已有步骤
         }
     }
 }
 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();
     }
 }
Example #6
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);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataTable dt = fieldBll.GetModelFieldListall(ModelID);
         if (Mid > 0)
         {
             M_OA_Document oaMod     = oaBll.SelReturnModel(Mid);
             DataTable     dtContent = conBll.GetContent(Convert.ToInt32(oaMod.Content));
             Html_Lit.Text = fieldBll.InputallHtml(ModelID, 9999, new ModelConfig()
             {
                 ValueDT = dtContent
             });
         }
         else
         {
             Html_Lit.Text = showBll.ShowStyleField(dt, 9999);
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                moa                  = boa.SelReturnModel(Mid);
                minfo                = buser.SeachByID(moa.UserID);
                this.LBTitle.Text    = moa.Title;
                this.LBKeyWords.Text = moa.Keywords;
                this.AddUSer.Text    = minfo.HoneyName;
                this.AddTime.Text    = moa.CreateTime.ToString();
                title_lab.Text       = moa.Title;
                docType_Tr.Visible   = false;
                switch (moa.ProType)
                {
                case (int)M_MisProcedure.ProTypes.Admin:
                    //M_MisProLevel stepMod = stepBll.SelByProIDAndStepNum(moa.ProID,1);
                    //RUserName_Lab.Text = buser.GetUserNameByIDS(stepMod.ReferUser);
                    break;

                default:
                    M_MisProLevel freeMod = freeBll.SelByDocID(Mid);
                    if (freeMod != null)
                    {
                        if (freeMod.ProID == 0)
                        {
                            preViewBtn.Visible = false;
                        }
                        RUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.ReferUser);
                        //CUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.CCUser);
                        //RUserID_Hid.Value = freeMod.ReferUser;
                        //CUserID_Hid.Value = freeMod.CCUser;
                    }
                    break;
                }
                string steps = StrHelper.GetIDSFromDT(stepBll.SelByProID(moa.ProID), "StepName");
                if (!string.IsNullOrEmpty(steps))
                {
                    function.Script(this, "$(\"#prog_div\").ZLSteps(\"" + steps + "\");");
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!userBll.CheckLogin() && !adminBll.CheckLogin())
     {
         function.WriteErrMsg("无权限访问页面");
     }
     if (!string.IsNullOrEmpty(Request.QueryString["appID"]))
     {
         oaMod          = oaBll.SelReturnModel(Convert.ToInt32(Request.QueryString["appID"]));
         ModelHtml.Text = oaCom.ClearHolder(oaMod);
         SignImgBind();
     }
     else
     {
         if (Session["PrintCon"] != null)
         {
             ModelHtml.Text = Session["PrintCon"].ToString();
             Page.ClientScript.RegisterStartupScript(this.GetType(), "", "creatimg('" + Session["PrintImg"] + "');", true);
         }
     }
     Page.ClientScript.RegisterStartupScript(this.GetType(), "DisProg", "DisProg(\"" + oaCom.GetHolder(oaMod, 0) + "\");", true);
 }
        protected void Free_Sure_Btn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(ReferUser_Hid.Value))
            {
                function.WriteErrMsg("主办人不能为空");
            }
            if (!SafeSC.Submit_Check(this.ViewState))
            {
                B_OA_Document  oaBll    = new B_OA_Document();
                M_OA_Document  oaMod    = oaBll.SelReturnModel(AppID);
                M_MisProcedure proceMod = new B_MisProcedure().SelReturnModel(oaMod.ProID);
                oaCom.CreateStep(oaMod, proceMod, new OAStepParam()
                {
                    ReferUser = ReferUser_Hid.Value,
                    CCUser    = CCUser_Hid.Value,
                    StepNum   = freeBll.GetStep(AppID),
                    StepID    = this.StepID
                });
                DataBind();
                Free_Div.Visible = false;
                remind2.Visible  = true;
                switch (Request["s"] ?? "")
                {
                case "old":
                    function.Script(this, "PaerntUrl(\"/Office/AffairsList.aspx?view=1\");");
                    break;

                default:
                    function.Script(this, "PaerntUrl(\"/Office/Flow/ApplyList.aspx?view=1\");");
                    break;
                }
            }
            else
            {
                Response.Redirect(Request.RawUrl);
            }
        }
 }                                                                                                //仅传文件名
                                                                                                  //稍后改为直接存入字段中
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Files.Count > 0)
     {
         HttpPostedFile file = Request.Files[0];
         if (AppID > 0)
         {
             M_OA_Document oaMod = oaBll.SelReturnModel(AppID);
             M_UserInfo    mu    = buser.SelReturnModel(oaMod.UserID);
             SafeSC.SaveFile(oacom.GetMyDir(mu), file, FName);
         }
         else//第一次创建
         {
             M_UserInfo mu = buser.GetLogin();
             SafeSC.SaveFile(oacom.GetMyDir(mu), file, FName);
         }
         Response.Write("true");
     }
     else
     {
         Response.Write("No File Upload!");
     }
     Response.End();
 }
Example #12
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();
            }
        }
        /*
         *第一步,则不显示回退
         *最后一步,不允许转交
         *一切以CurStepNum为准,必须维护好这个数值
         */
        protected void Page_Load(object sender, EventArgs e)
        {
            userID = buser.GetLogin().UserID;
            if (function.isAjax())//处理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]);
                    try
                    {
                        progBll.UpdateDate(userID, id, date);
                        result = "1";
                    }
                    catch { }
                    break;
                }
                Response.Write(result); Response.Flush(); Response.End();
            }
            EGV.txtFunc = txtPageFunc;
            appID       = DataConverter.CLng(Request.QueryString["AppID"]);
            DataTable dt = buser.SelByUserID(buser.GetLogin().UserID);

            oaMod = oaBll.SelReturnModel(appID);
            if (!IsPostBack)
            {
                M_UserInfo mu = buser.GetSelect(oaMod.UserID);
                //回退权限
                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)
                        {
                            if (oaMod.IsFreePro)
                            {
                                FreeDPDataBind();
                            }
                            else
                            {
                                DPDataBind();
                            }
                            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
                //-------------------经办,审阅等权限
                if (CurrentStep.Auth(M_MisProLevel.AuthEnum.Refer, dt))
                {
                    //拥有经办权限
                    agreeBtn.Visible  = true;
                    rejectBtn.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("你当前无权限批复该公文!!");
                }
                //附件删除权限,拥有权限和附件的时候才显示
                if (CurrentStep.PublicAttachOption > 0 && !string.IsNullOrEmpty(oaMod.PublicAttach))
                {
                    //delAttachBtn.Visible = true;
                }
                //显示附件
                if (!string.IsNullOrEmpty(oaMod.PublicAttach))
                {
                    string[] af = oaMod.PublicAttach.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    string   h  = "";
                    for (int i = 0; i < af.Length; i++)
                    {
                        h += "<span class='disupFile'>";
                        h += GroupPic.GetShowExtension(GroupPic.GetExtName(af[i]));
                        string filename = Path.GetExtension(af[i]).ToLower().Replace(".", "");
                        if (filename == "docx" || filename == "doc" || filename == "xls" || filename == "xlsx")
                        {
                            h += af[i].Split('/')[(af[i].Split('/').Length - 1)] + "</a><a class='filea' href='/Common/ShowFlash.aspx?path=" + Server.UrlEncode(af[i]) + "&type=1' target='_blank'>(预览)</a><a href='" + af[i] + "'>(下载)</span>";
                        }
                        else
                        {
                            h += "<a href='" + af[i] + "' title='点击下载'>" + af[i].Split('/')[(af[i].Split('/').Length - 1)] + "</a></span>";
                        }
                    }
                    publicAttachTD.InnerHtml = h;
                }
                //会签
                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    = 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.IsFreePro && oaMod.Status == 98 && freeBll.IsLastStep(oaMod, CurrentStep))//是自由流程,已同意,并且是最后一步时,显示该栏
                {
                    Free_OP_Tr.Visible = true;
                }
                titleL.Text      = oaMod.Title;
                sendManL.Text    = mu.HoneyName;
                stepNameL.Text   = CurrentStep.stepName;
                createTimeL.Text = oaMod.CreateTime.ToString("yyyy年MM月dd日 HH:mm");
                if (oaMod.UserID == userID)//签名占位符同样筛选后输出
                {
                    txt_Content.Text = oaCom.ReplaceHolder(oaMod);
                }
                else
                {
                    txt_Content.Text = oaCom.ReplaceHolder(oaMod, "ApproveID =" + userID);
                }
                DataBind();
            }
        }
Example #14
0
        }                                                                                                                     //仅传文件名
        public void ProcessRequest(HttpContext context)
        {
            HttpRequest  Request  = context.Request;
            HttpResponse Response = context.Response;
            string       action   = Request["action"];

            switch (action)
            {
            case "getword":    //返回Word二进制文件
            {
                Response.Clear();
                Response.ContentType = "Application/msword";
                string fname = HttpUtility.UrlDecode(Request["fname"]);
                int    appid = DataConverter.CLng(Request["appid"]);
                string vpath = "";
                if (appid > 0)
                {
                    M_OA_Document oaMod = oaBll.SelReturnModel(appid);
                    M_UserInfo    mu    = buser.SelReturnModel(oaMod.UserID);
                    vpath = oacom.GetMyDir(mu) + HttpUtility.UrlDecode(oaMod.PrivateAttach);
                }
                else
                {
                    M_UserInfo mu = buser.GetLogin();
                    vpath = oacom.GetMyDir(mu) + fname;
                }
                Response.BinaryWrite(SafeSC.ReadFileByte(vpath));           //读取二进制的文件
                Response.Flush(); Response.End();
            }
            break;

            case "saveword":
            {
                if (Request.Files.Count > 0)
                {
                    HttpPostedFile file = Request.Files[0];
                    if (AppID > 0)
                    {
                        M_OA_Document oaMod = oaBll.SelReturnModel(AppID);
                        M_UserInfo    mu    = buser.SelReturnModel(oaMod.UserID);
                        SafeSC.SaveFile(oacom.GetMyDir(mu), file, FName);
                    }
                    else        //第一次创建
                    {
                        HttpContext curReq = HttpContext.Current;
                        if (curReq.Request.Cookies["UserState"] != null)
                        {
                            string loginName = curReq.Request.Cookies["UserState"]["LoginName"], password = curReq.Request.Cookies["UserState"]["Password"];
                            ZLLog.L("SaveWord:" + loginName + ":" + password);
                        }
                        else
                        {
                            ZLLog.L("SaveWord:empty");
                        }
                        M_UserInfo mu = buser.GetLogin();
                        SafeSC.SaveFile(oacom.GetMyDir(mu), file, FName);
                    }
                    Response.Write("true");
                }
                else
                {
                    Response.Write("No File Upload!");
                }
            }
            break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //需要加上验证权限,发起人,经办人,审核人可查看进程,只要任意一步骤有该权限
            userID = buser.GetLogin().UserID;
            if (function.isAjax())//处理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();
            }
            DataTable dt = buser.SelByUserID(buser.GetLogin().UserID);

            oaMod = oaBll.SelReturnModel(appID);
            if (!IsPostBack)
            {
                M_UserInfo mu = buser.GetSelect(oaMod.UserID);
                //回退权限
                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)
                        {
                            if (oaMod.IsFreePro)
                            {
                                FreeDPDataBind();
                            }
                            else
                            {
                                DPDataBind();
                            }
                            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
                //-------------------经办,审阅等权限
                if (CurrentStep.Auth(M_MisProLevel.AuthEnum.Refer, dt))
                {
                    //拥有经办权限
                    agreeBtn.Visible  = true;
                    rejectBtn.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("你当前无权限批复该公文!!");
                }
                //附件删除权限,拥有权限和附件的时候才显示
                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.IsFreePro && oaMod.Status == 98 && freeBll.IsLastStep(oaMod, CurrentStep))//是自由流程,已同意,并且是最后一步时,显示该栏
                {
                    Free_OP_Tr.Visible = true;
                }
                ProceName_L.Text = oaMod.Title;
                //titleL.Text = oaMod.Title;
                sendManL.Text    = mu.UserName;
                stepNameL.Text   = CurrentStep.stepName;
                createTimeL.Text = oaMod.CreateTime.ToString("yyyy年MM月dd日 HH:mm");
                //txt_Content.Text = oaCom.ReplaceHolder(oaMod);
                ShowPage(oaMod);
                DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (function.isAjax())
            {
                string Action = Request.Form["Action"];
                string result = "";
                if (Action == "Print")
                {
                    string content = Request.Form["Content"];
                    string img     = Request.Form["Image"];
                    Session["PrintCon"] = content;
                    Session["PrintImg"] = img;
                    result = "1";
                }
                else
                {
                    string value = Request.Form["value"];
                    mmis   = bmis.SelReturnModel(Convert.ToInt32(value));
                    result = oaCom.GetHolder(mmis, buser.GetLogin().GroupID.ToString());
                }
                Response.Clear(); Response.Write(result); Response.Flush(); Response.End();
            }
            if (!IsPostBack)
            {
                //      if (!purBll.Auth("OADocumentWrite", buser.GetLogin().UserRole)) { function.WriteErrMsg("你当前没有起草公文的权限,请联系管理员!!!"); }
                TypeDataBind();
                DPDataBind();
                #region 签章初始化
                DataTable signDT = signBll.SelByUserID(buser.GetLogin().UserID);
                if (signDT != null && signDT.Rows.Count > 0)
                {
                    SignRadioBind(signDT);
                }
                else
                {
                    signTrRemind.Visible = true;
                }
                #endregion
                if (Request.QueryString["Edit"] == "1" && !string.IsNullOrEmpty(Request.QueryString["AppID"]))
                {
                    saveBtn.Text      = "修改";
                    AddNewBtn.Visible = true;
                    int           id      = DataConvert.CLng(Request.QueryString["AppID"]);
                    M_MisProLevel freeMod = freeBll.SelByDocID(id);
                    moa                      = boa.SelReturnModel(id);
                    minfo                    = buser.SeachByID(moa.UserID);
                    Title_T.Text             = moa.Title;
                    key                      = moa.Keywords;
                    Keywords.Text            = moa.Keywords;
                    Secret.SelectedValue     = moa.Secret.ToString();
                    Urgency.SelectedValue    = moa.Urgency.ToString();
                    Importance.SelectedValue = moa.Importance.ToString();
                    DocType_DP.SelectedValue = moa.Type.ToString();
                    proDP.SelectedValue      = moa.ProID.ToString();
                    Content.Text             = moa.Content;
                    CreateTime.Text          = moa.CreateTime.ToString("yyyy/MM/dd HH:mm:ss");
                    Label1.Text              = minfo.HoneyName;
                    Label2.Text              = groupBll.GetByID(minfo.GroupID).GroupName;
                    if (freeMod != null)
                    {
                        RUserID_Hid.Value  = freeMod.ReferUser;
                        RUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.ReferUser);
                        CUserID_Hid.Value  = freeMod.CCUser;
                        CUserName_Lab.Text = buser.GetUserNameByIDS(freeMod.CCUser);
                    }
                    //附件相关,移除,不做检测
                    //proMod = proBll.SelReturnModel(moa.ProID);
                    //if (proMod.AllowAttach == 1)
                    //{
                    upFileTR.Visible = true;
                    //}

                    if (!string.IsNullOrEmpty(moa.PublicAttach))
                    {
                        hasFileData.Value = moa.PublicAttach;
                        string[] af = moa.PublicAttach.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        string   h  = "";
                        for (int i = 0; i < af.Length; i++)
                        {
                            h += "<span class='disupFile'>";
                            h += GroupPic.GetShowExtension(GroupPic.GetExtName(af[i]));
                            h += "<a target='_blank' href=" + af[i] + ">" + af[i].Split('/')[(af[i].Split('/').Length - 1)] + "</a><a href='javascript:;' title='删除' onclick='delHasFile(\"" + af[i] + "\",this);' ><img src='/App_Themes/AdminDefaultTheme/images/del.png'/></a></span>";
                        }
                        hasFileTD.InnerHtml = h;
                    }
                    //签章,用于修改
                    if (!string.IsNullOrEmpty(moa.SignID) && signRadio.Items.Count > 0)
                    {
                        signRadio.SelectedValue = moa.SignID.Split(':')[0];
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "signInit", "InitPos('" + moa.SignID + "');", true);
                    }
                    DraftBtn.Visible = false;
                    //-----检测是否已开始流程
                    if (boa.IsApproving(id))//已开始,不允许修改
                    {
                        saveBtn.Visible  = false;
                        DraftBtn.Visible = false;
                        clearBtn.Attributes.Add("disabled", "disabled");
                        clearBtn.Text = "流程已开始,禁止修改";
                    }
                }
                else
                {
                    AddNewBtn.Visible = false;
                    Label1.Text       = buser.GetLogin().HoneyName;
                    Label2.Text       = groupBll.GetByID(buser.GetLogin().GroupID).GroupName;
                    CreateTime.Text   = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                }
            }
        }
Example #17
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
     }
 }
Example #18
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);
     }
 }