コード例 #1
0
 private void InitData()
 {
     if (DocumentId != "")
     {
         BDocument ctl = new BDocument();
         if (ctl.Get(DocumentId, int.Parse(EOFFICE.Common.DocumentType.DocumentDrap.ToString("D"))) != null)
         {
             ODocument obj = ctl.Get(DocumentId, int.Parse(EOFFICE.Common.DocumentType.DocumentDrap.ToString("D")))[0];
             if (obj != null)
             {
                 lblName.Text       = obj.Name;
                 lblSubContent.Text = obj.Excerpt;
                 lblUserDrap.Text   = obj.IDUserCreate.ToString();
                 try
                 {
                     lblUserDrap.Text = (new BUser()).Get(obj.IDUserCreate).First().UserName;
                 }
                 catch (Exception ex)
                 {
                 }
                 lblAttach.Text = obj.Attachs;
                 BComment BobjComment = new BComment();
                 rptComment.DataSource = BobjComment.Get("", DocumentId, 0);
                 rptComment.DataBind();
                 List <OAttach> listAttach = new List <OAttach>();
                 foreach (OComment objI in BobjComment.Get("", DocumentId, 0))
                 {
                     listAttach = listAttach.Union(BobjComment.GetAttachs(objI.CommentID)).ToList();
                 }
                 rptFileAttachs.DataSource = listAttach;
                 rptFileAttachs.DataBind();
             }
         }
     }
 }
コード例 #2
0
        private void InitData()
        {
            //BUser ctlUP = new BUser();
            ////-- Kiểm tra quyền dự thảo
            //if (ctlUP.HasPermission(Global.UserInfo.UserID, Common.PermissionCode.DocumentSendDrap.ToString()))
            //    Response.Redirect("/");
            BUser ctlUP = new BUser();

            //-- Kiểm tra quyền dự thảo
            if (!ctlUP.HasPermission(Global.UserInfo.UserID, Common.PermissionCode.DocumentSendDrap.ToString()) && !Global.IsAdmin())
            {
                Response.Redirect("/permission-fail.aspx");
            }

            if (DocumentId != "")
            {
                BDocument ctl = new BDocument();
                if (ctl.Get(DocumentId, int.Parse(EOFFICE.Common.DocumentType.DocumentSend.ToString("D"))) != null)
                {
                    ODocument obj = ctl.Get(DocumentId, int.Parse(EOFFICE.Common.DocumentType.DocumentSend.ToString("D")))[0];
                    if (obj != null)
                    {
                        lblName.Text       = obj.Name;
                        lblSubContent.Text = obj.Excerpt;
                        lblUserDrap.Text   = obj.IDUserCreate.ToString();
                        try
                        {
                            lblUserDrap.Text = (new BUser()).Get(obj.IDUserCreate).First().UserName;
                        }
                        catch (Exception ex)
                        {
                        }
                        //lblAttach.Text = obj.Attachs;
                        BComment BobjComment = new BComment();
                        rptComment.DataSource = BobjComment.Get("", DocumentId, 0);
                        rptComment.DataBind();
                        List <OAttach> listAttach = new List <OAttach>();
                        foreach (OComment objI in BobjComment.Get("", DocumentId, 0))
                        {
                            listAttach = listAttach.Union(BobjComment.GetAttachs(objI.CommentID)).ToList();
                        }
                        rptFileAttachs.DataSource = listAttach;
                        rptFileAttachs.DataBind();
                        rptFiles.DataSource = (new BAttach()).GetAttachs(obj.Attachs);
                        rptFiles.DataBind();
                    }
                }
            }
        }
コード例 #3
0
        protected void rptListUser_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int WorkID = int.Parse(Request.QueryString["WorkID"].ToString());

            if (e.CommandName == "trigger")
            {
                LinkButton btn = e.CommandSource as LinkButton;

                if (btn != null)
                {
                    RepeaterItem ri    = e.Item;
                    HiddenField  hdfID = (HiddenField)ri.FindControl("hdfID");

                    BComment BobjComment = new BComment();
                    OComment objComment  = new OComment();
                    if (BobjComment.GetCreate(hdfID.Value, WorkID).Count == 0)
                    {
                        lblMessage.Text        = "Chưa có nội dung xử lý!";
                        rptComment.Visible     = false;
                        rptFileAttachs.Visible = false;
                    }
                    else
                    {
                        rptComment.Visible     = true;
                        rptFileAttachs.Visible = true;
                        lblMessage.Text        = "";
                        objComment             = BobjComment.GetCreate(hdfID.Value, WorkID).First();
                        rptComment.DataSource  = BobjComment.GetCreate(hdfID.Value, WorkID);
                        rptComment.DataBind();

                        List <OAttach> listAttach = new List <OAttach>();
                        foreach (OComment obj in BobjComment.GetCreate(hdfID.Value, WorkID))
                        {
                            listAttach = listAttach.Union(BobjComment.GetAttachs(obj.CommentID)).ToList();
                        }
                        rptFileAttachs.DataSource = listAttach;
                        rptFileAttachs.DataBind();
                    }
                }
            }
        }