예제 #1
0
        //修改模式使用,更改前台页面
        protected void BindText(int gid)
        {
            mcon = bll.GetCommonData(gid);
            if (buser.GetLogin().UserName != mcon.Inputer && !purBll.Auth("OAEdit", buser.GetLogin().UserRole, mcon.NodeID))
            {
                function.WriteErrMsg("非本人添加或无修改权限!!");
            }
            Title_T.Text         = mcon.Title;
            nodeDP.SelectedValue = mcon.NodeID.ToString();
            CreateTime.Text      = mcon.CreateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            userNameT.Text       = mcon.Inputer;
            userGroupL.Text      = strBll.SelNameByUid(buser.GetLogin().UserID);
            DataRow dr = boa.SelByItemID(mcon.TableName, mcon.ItemID).Rows[0];

            Secret.SelectedValue     = dr["Secret"].ToString();
            Urgency.SelectedValue    = dr["Urgency"].ToString();
            Importance.SelectedValue = dr["Importance"].ToString();
            userGroupL.Text          = dr["userGroupT"].ToString();
            content.Text             = dr["content"].ToString();
            if (!string.IsNullOrEmpty(dr["attach"].ToString()))
            {
                string[] af = dr["attach"].ToString().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 href='" + af[i] + "' title='点击下载'>" + af[i].Split('/')[(af[i].Split('/').Length - 1)] +
                         "<a href='javascript:;' title='删除' onclick='delHasFile(\"" + af[i] + "\",this);' ><img src='/App_Themes/AdminDefaultTheme/images/del.png'/></a></span>";
                }
                hasFileTD.InnerHtml = h;
            }
            hasFileData.Value = dr["attach"].ToString();//便于删除管理
            saveBtn.Text      = "修改";
        }
예제 #2
0
        protected void DataBind(string ID)
        {
            int generealID = Convert.ToInt32(ID);

            mcon             = bcon.GetCommonData(generealID);
            minfo            = buser.GetUserByName(mcon.Inputer);
            Title_T.Text     = mcon.Title;
            LbCreatTime.Text = mcon.CreateTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            userNameL.Text   = mcon.Inputer;
            //function.WriteErrMsg(mcon.TableName + ":" + mcon.ItemID + ":" + generealID);
            DataRow dr = boa.SelByItemID(mcon.TableName, mcon.ItemID).Rows[0];

            SecretL.Text     = dr["Secret"].ToString();
            UrgencyL.Text    = dr["Urgency"].ToString();
            ImportanceL.Text = dr["Importance"].ToString();
            userGroupL.Text  = dr["userGroupT"].ToString();
            ContentHtml.Text = dr["content"].ToString();
            if (!string.IsNullOrEmpty(dr["attach"].ToString()))
            {
                string[] af = dr["attach"].ToString().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 href='" + af[i] + "' title='点击下载'>" + af[i].Split('/')[(af[i].Split('/').Length - 1)] + "</span>";
                }
                publicAttachTD.InnerHtml = h;
            }
        }
 public void GetFile(string Attachment)
 {
     if (!string.IsNullOrEmpty(Attachment))
     {
         string[] af = Attachment.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;
     }
 }
        /*
         *第一步,则不显示回退
         *最后一步,不允许转交
         *一切以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();
            }
        }
        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");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            B_User.CheckIsLogged();//检测是否登录BinarySearch
            M_UserInfo info = buser.GetLogin();

            if (info.IsNull)
            {
                Response.Redirect("Login.aspx");
            }
            if (function.isAjax())
            {
                string GID = Request.Form["GID"];
                string UID = Request.Form["UID"];
                string usernames;
                usernames = GetByGroupID(GID);
            }
            if (!IsPostBack)
            {
                string uid = Request.QueryString["uid"];
                this.User_T.Text = buser.GetUserNameByIDS(uid);
                if (!string.IsNullOrEmpty(base.Request.QueryString["id"]))
                {
                    M_Message messInfo = B_Message.GetMessByID(DataConverter.CLng(base.Request.QueryString["id"]));
                    if (!messInfo.IsNull)
                    {
                        this.User_T.Text   = buser.GetUserNameByIDS(messInfo.Sender);
                        this.TxtTitle.Text = "回复:" + messInfo.Title;
                    }
                }
                if (!string.IsNullOrEmpty(base.Request.QueryString["ToID"]))
                {
                    M_UserInfo messInfo = buser.GetUserByUserID(DataConverter.CLng(base.Request.QueryString["ToID"]));
                    if (!messInfo.IsNull)
                    {
                        this.User_T.Text = messInfo.HoneyName;
                    }
                }
                int    SentoID  = DataConverter.CLng(base.Request.QueryString["userid"]);
                string titlestr = base.Request.QueryString["title"];

                if (buser.IsExit(SentoID))
                {
                    M_UserInfo userinfo = buser.GetUserByUserID(SentoID);
                    this.User_T.Text   = userinfo.HoneyName;
                    this.TxtTitle.Text = titlestr;
                }
                if (!string.IsNullOrEmpty(base.Request.QueryString["Drafid"]))
                {
                    M_Message messInfo = B_Message.GetMessByID(DataConverter.CLng(base.Request.QueryString["Drafid"]));
                    this.User_T.Text        = buser.GetUserNameByIDS(messInfo.Incept);
                    this.TxtTitle.Text      = messInfo.Title;
                    this.EditorContent.Text = messInfo.Content;
                    if (!string.IsNullOrEmpty(messInfo.Attachment))
                    {
                        hasFileData.Value = messInfo.Attachment + ",";
                        string[] af = messInfo.Attachment.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;
                    }
                }
            }
        }