예제 #1
0
        //返回付款申请文件
        public ActionResult FaninceResult(string format = "")
        {
            LocalReport localReport = new LocalReport
            {
                ReportPath = Server.MapPath(@"~\Areas\reportforms\Report\financereport.rdlc")
            };
            var dt = new PaymentApply().Select("", "", "", "");

            ReportDataSource reportDataSource = new ReportDataSource("payment", dt);

            localReport.DataSources.Add(reportDataSource);

            Warning[] warnings;
            string[]  streams;

            string reportType;
            string mimeType;
            string encoding;
            string fileNameExtension;

            switch (format)
            {
            case "Image":
                reportType = "png";
                break;

            case "Excel":
                reportType = "xls";
                break;

            case "PDF":
                reportType = "pdf";
                break;

            case "Word":
                reportType = "doc";
                break;

            default:
                reportType = "pdf";
                break;
            }
            string deviceInfo =
                "<DeviceInfo>" +
                "  <OutputFormat>" + reportType + "</OutputFormat>" +
                "</DeviceInfo>";



            var renderedBytes = localReport.Render(
                format,
                deviceInfo,
                out mimeType,
                out encoding,
                out fileNameExtension,
                out streams,
                out warnings);

            return(File(renderedBytes, mimeType));
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~\Areas\reportforms\Report\financereport.rdlc");
            var dt = new PaymentApply().Select("", "", "", "");

            ReportDataSource reportDataSource = new ReportDataSource("payment", dt);

            ReportViewer1.LocalReport.DataSources.Add(reportDataSource);
            ReportViewer1.LocalReport.Refresh();
        }
예제 #3
0
        public ActionResult Detail(string id)
        {
            PaymentApply applydetail = new PaymentApply();
            var          obj         = applydetail.GetDetailPaymentApply(id);

            if (obj != null)
            {
                return(View(obj));
            }
            else
            {
                return(View("Unauthorized"));
            }
        }
예제 #4
0
        /// <summary>
        /// 产生编辑视图数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult EditView(string id)
        {
            PaymentApply payedit = new PaymentApply();
            var          res     = payedit.GetEditPaymentApply(id);

            if (res != null)
            {
                return(View(res));
            }
            else
            {
                return(View("Unauthorized"));
            }
        }
예제 #5
0
        //
        // GET: /finance/PaymentApply/Create

        public ActionResult Create(PaymentApply pay)
        {
            FileUtility     attachFile = new FileUtility();
            FileUploadField upload     = this.GetCmp <FileUploadField>("AnnetPath");

            if (upload.HasFile)
            {
                attachFile.File = upload.PostedFile;
                pay.AnnetPath   = string.Format("~/AttachFile/PaymentApply/{0}/{1}.{2}", DateTime.Now.Date.ToString("yyyy-MM-dd"), Guid.NewGuid(),
                                                Path.GetExtension(attachFile.File.FileName));
                attachFile.FilePath = pay.AnnetPath;
                attachFile.SavePath = Server.MapPath(attachFile.FilePath);
                attachFile.FileType = attachFile.File.ContentType;
            }
            if (pay.CreatePaymentApply(this, attachFile))
            {
                X.Msg.Alert("页面消息", "保存成功!", "parent.App.storedata.reload();parent.App.win.close();").Show();
            }
            else
            {
                X.Msg.Alert("页面消息", "保存失败,请确保输入信息正确!").Show();
            }
            return(this.Direct());
        }
예제 #6
0
 /// <summary>
 /// 编辑视图的submit响应  保存用户修改的数据到数据库
 /// </summary>
 /// <param name="pay"></param>
 /// <returns></returns>
 public ActionResult Edit(string id, PaymentApply pay)
 {
     pay.ID = id;
     return(this.Direct(pay.UpdatePaymentApply()));
 }
예제 #7
0
        public ActionResult Fiter(StoreRequestParameters parameters, string customername = "", string projectNo = "", string paymentstate = "", string date = "")
        {
            var applylist = new PaymentApply().Select(customername, projectNo, paymentstate, date);

            return(this.Store(applylist.GetPage(parameters)));
        }
예제 #8
0
        public ActionResult GetPaidAmount(string projectno)
        {
            PaymentApply paymentApply = new PaymentApply();

            return(this.Direct(paymentApply.GetPaidAmount(projectno)));
        }