コード例 #1
0
        private string fileList(int ticketId, TicketsState status)
        {
            List <FilesEntity> list = new List <FilesEntity>();
            string             Host = System.Configuration.ConfigurationManager.AppSettings["DomainHost"];
            StringBuilder      sb   = new StringBuilder();

            list = fileApp.GetFileListBySourceId(ticketId, FileSourceType.Ticket);
            if (status == TicketsState.Draft)
            {
                foreach (FilesEntity filesEntity in list)
                {
                    sb.AppendFormat("<li  class=\"file\"><a href='{0}/do/DoDownloadFileHandler.ashx?FileID={1}&size={2}' target=\"iframeDownloadFile\");\">{3}{4} (Size:{2})</a><a onclick='deleteImgWhenStatusDraft({1})'><img src=\"/Scripts/Upload/images/error_fuck.png\" width='12' height='12' border=\"0\" /></a></li>"
                                    , Host, filesEntity.FileID, filesEntity.FileSize, filesEntity.FileTitle, filesEntity.ContentType);
                }
            }
            else
            {
                foreach (FilesEntity filesEntity in list)
                {
                    sb.AppendFormat("<li  class=\"file\"><a href='{0}/do/DoDownloadFileHandler.ashx?FileID={1}&size={2}' target=\"iframeDownloadFile\");\">{3}{4} (Size:{2})</a></li>"
                                    , Host, filesEntity.FileID, filesEntity.FileSize, filesEntity.FileTitle, filesEntity.ContentType);
                }
            }

            return(string.Format("<ul id='demo-list'>{0}</ul>", sb));
        }
コード例 #2
0
        public string ShowImageList(string tid)
        {
            if (string.IsNullOrEmpty(tid))
            {
                return("");
            }
            List <FilesEntity> list    = new List <FilesEntity>();
            string             Host    = System.Configuration.ConfigurationManager.AppSettings["DomainHost"];
            StringBuilder      sb      = new StringBuilder();
            FileApplication    fileApp = new FileApplication();

            list = fileApp.GetFileListBySourceId(Convert.ToInt32(tid), FileSourceType.FeedBack);
            string[] imgFormat = ".gif,.jpg,.jpeg,.bmp,.png,.svg,.raw".Split(new char[] { ',' });
            foreach (FilesEntity filesEntity in list)
            {
                string style = "width:110px;height:110px;";
                if (!imgFormat.Any(format => format == filesEntity.ContentType))
                {
                    style = "width:13px;";
                    filesEntity.FilePath = "/Images/icons/file.png";
                }

                sb.AppendFormat("<span class='fdfile'><a href='{0}/do/DoDownloadFileHandler.ashx?FileID={1}&size={2}' target='_blank'><img src='{5}' style='{6}'> {3}{4}</a></span>"
                                , Host, filesEntity.FileID, filesEntity.FileSize, filesEntity.FileTitle, filesEntity.ContentType, filesEntity.FilePath, style);
            }
            return(sb.ToString());
        }
コード例 #3
0
        public string ShowImageList(int feedbackId)
        {
            if (feedbackId < 1)
            {
                return("");
            }
            List <FilesEntity> list = new List <FilesEntity>();
            string             Host = System.Configuration.ConfigurationManager.AppSettings["DomainHost"];
            StringBuilder      sb   = new StringBuilder();

            list = fileApp.GetFileListBySourceId(feedbackId, FileSourceType.FeedBack);
            foreach (FilesEntity filesEntity in list)
            {
                sb.AppendFormat("<span><a href='{0}/do/DoDownloadFileHandler.ashx?FileID={1}&size={2}' target=\"iframeDownloadFile\");\">{3}</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> "
                                , Host, filesEntity.FileID, filesEntity.FileSize, filesEntity.FileTitle);
            }
            return(sb.ToString());
        }
コード例 #4
0
        public string ShowImageList(string tid)
        {
            FileApplication fileApp = new FileApplication();

            if (string.IsNullOrEmpty(tid))
            {
                return("");
            }
            List <FilesEntity> list = new List <FilesEntity>();
            string             Host = System.Configuration.ConfigurationManager.AppSettings["DomainHost"];
            StringBuilder      sb   = new StringBuilder();

            list = fileApp.GetFileListBySourceId(Convert.ToInt32(tid), FileSourceType.FeedBack);
            foreach (FilesEntity filesEntity in list)
            {
                sb.AppendFormat("<span class=\"fdfile\"><a href='{0}/do/DoDownloadFileHandler.ashx?FileID={1}&size={2}' target=\"iframeDownloadFile\");\"><img src=\"~\\Images\\icons\\file.png\"> {3}</a></span>"
                                , Host, filesEntity.FileID, filesEntity.FileSize, filesEntity.FileTitle);
            }
            return(sb.ToString());
        }
コード例 #5
0
 private void BindDocuments(int wid)
 {
     rptDocuments.DataSource = fileApp.GetFileListBySourceId(wid, SunNet.PMNew.Entity.FileModel.FileSourceType.WorkRequest);
     rptDocuments.DataBind();
 }
コード例 #6
0
        private void BindData(ProposalTrackerEntity entity)
        {
            ListItem li = ddlProject.Items.FindByValue(entity.ProjectID.ToString());

            if (li == null)
            {
                ProjectsEntity projectEntity = new App.ProjectApplication().Get(entity.ProjectID);
                if (projectEntity != null)
                {
                    ddlProject.Items.Insert(0, new ListItem()
                    {
                        Text = projectEntity.Title, Value = projectEntity.ID.ToString()
                    });
                }
            }
            else
            {
                li.Selected = true;
            }

            //ddlPayment.SelectedValue = entity.Payment.ToString();
            //txtRequestNo.Text = entity.RequestNo;
            //txtInvoiceNo.Text = entity.InvoiceNo;
            ddlStatus.SelectedValue = entity.Status.ToString();
            //txtDueDate.Text = entity.DueDate == null ? "" : ((DateTime)entity.DueDate).ToString("MM/dd/yyyy");
            txtTitle.Text       = entity.Title;
            txtDescription.Text = entity.Description;

            txtProposalSentTo.Text = entity.ProposalSentTo;
            txtProposalSentOn.Text = entity.ProposalSentOn == null ? "" : entity.ProposalSentOn.Value.ToShortDateString();
            txtPO.Text             = entity.PONo;
            chkLessThen.Checked    = entity.PoTotalLessThenProposalTotal.Value;
            txtApprovedBy.Text     = entity.ApprovedBy;
            txtApprovedOn.Text     = entity.ApprovedOn == null ? "" : entity.ApprovedOn.Value.ToShortDateString();
            //txtInvoiceSentOn.Text = entity.InvoiceSentOn == null ? "" : entity.InvoiceSentOn.Value.ToShortDateString();

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("<ul class=\"fileList\"><li><a href=\"/do/DoDownWrokRequestFile.ashx?ID={0}\" title='{1}' target=\"_blank\">{1}</a>"
                            , entity.ProposalTrackerID, entity.WorkScopeDisplayName);
            sb.Append("</li></ul>");
            lblFile.InnerHtml = sb.ToString();


            rptNotes.DataSource = wrApp.GetProposalTrackerNotes(entity.ProposalTrackerID);;
            rptNotes.DataBind();

            rptDocuments.DataSource = fileApp.GetFileListBySourceId(entity.ProposalTrackerID, FileSourceType.WorkRequest);
            rptDocuments.DataBind();

            decimal hours = wrApp.GetProposalTrackerHours(QS("id", 0));

            string link = string.Format("<a href='/Report/Timesheet.aspx?WID={0}'>{1}</a>",
                                        entity.ProposalTrackerID, hours.ToString("N"));

            litHours.Text       = link;
            litProjectName.Text = ddlProject.SelectedItem.Text;

            this.rptTicketsList.DataSource = wrApp.GetAllRelation(entity.ProposalTrackerID);
            this.rptTicketsList.DataBind();
        }
コード例 #7
0
ファイル: Ticket.ashx.cs プロジェクト: KhaledSMQ/SunNet.PM
        private object GetFeedbackFiles(int feedback)
        {
            var files = fileApp.GetFileListBySourceId(feedback, FileSourceType.FeedBack);

            return(files.Select(x => new { id = x.FileID, title = x.FileTitle + x.ContentType }));
        }