Esempio n. 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();
             }
         }
     }
 }
        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();
                    }
                }
            }
        }
Esempio n. 3
0
        protected string BindTime(string CommentID)
        {
            BComment Bcomment   = new BComment();
            string   CreateDate = Bcomment.Get(CommentID).First().CreateDate.ToString("dd/MM/yyyy hh:mm:ss");

            return(CreateDate);
        }