Exemple #1
0
        protected int RequestCount()
        {
            ReimbursementReportValueObj criteria = GetReportCriteria();
            int count = ScgeAccountingQueryProvider.SCGDocumentQuery.CountReportByCriteria(criteria);

            return(count);
        }
        public byte[] GenerateReimbursementReport(string markList, string unMarkList, string pbCode, string pbName, string companyName, string username, string maxPaidDate, string minPaidDate)
        {
            ReimbursementReportValueObj obj = ScgeAccountingQueryProvider.SCGDocumentQuery.GetPeriodPaidDate(markList, unMarkList);

            if (string.IsNullOrEmpty(minPaidDate))
            {
                minPaidDate = obj.MinPaidDate.HasValue ? obj.MinPaidDate.Value.ToString("MMM dd, yyyy") : string.Empty;
            }

            if (string.IsNullOrEmpty(maxPaidDate))
            {
                maxPaidDate = obj.MaxPaidDate.HasValue ? obj.MaxPaidDate.Value.ToString("MMM dd, yyyy") : string.Empty;
            }

            List <ReportParameter> param  = new List <ReportParameter>();
            ReportParameter        param1 = new ReportParameter();
            ReportParameter        param2 = new ReportParameter();
            ReportParameter        param3 = new ReportParameter();
            ReportParameter        param4 = new ReportParameter();
            ReportParameter        param5 = new ReportParameter();
            ReportParameter        param6 = new ReportParameter();
            ReportParameter        param7 = new ReportParameter();
            ReportParameter        param8 = new ReportParameter();

            param1.ParamterName  = "markList";
            param1.ParamterValue = markList;
            param2.ParamterName  = "unMarkList";
            param2.ParamterValue = unMarkList;
            param3.ParamterName  = "pbCode";
            param3.ParamterValue = pbCode;
            param4.ParamterName  = "companyName";
            param4.ParamterValue = companyName;
            param5.ParamterName  = "username";
            param5.ParamterValue = username;
            param6.ParamterName  = "maxPaidDate";
            param6.ParamterValue = maxPaidDate;
            param7.ParamterName  = "minPaidDate";
            param7.ParamterValue = minPaidDate;
            param8.ParamterName  = "pbName";
            param8.ParamterValue = pbName;
            param.Add(param1);
            param.Add(param2);
            param.Add(param3);
            param.Add(param4);
            param.Add(param5);
            param.Add(param6);
            param.Add(param7);
            param.Add(param8);

            FilesGenerator rp = new FilesGenerator();

            byte[] results = rp.GetByte(ParameterServices.ReportingURL, ParameterServices.ReportUserName, ParameterServices.ReportPassword, ParameterServices.ReportDomainName, ParameterServices.ReportFolderPath, "ReimbursementReport", param, FilesGenerator.ExportType.PDF);
            //byte[] results = rp.GetByte("http://172.20.56.116:81/ReportServer/ReportExecution2005.asmx", "RSeAccounting", "p@ssw0rd", "SCG-EACCOUNTING", "eAccountingReports", report.ReportName, param, FilesGenerator.ExportType.PDF);
            return(results);
        }
Exemple #3
0
        protected void ctlReport_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label ctlAmount       = e.Row.FindControl("ctlAmount") as Label;
                Label ctlMainCurrency = e.Row.FindControl("ctlMainCurrency") as Label;
                Label ctlAmountTHB    = e.Row.FindControl("ctlAmountTHB") as Label;

                ReimbursementReportValueObj data = e.Row.DataItem as ReimbursementReportValueObj;
                ctlAmount.ForeColor       = data.Amount < 0 ? System.Drawing.Color.Red : System.Drawing.Color.Gray;
                ctlMainCurrency.ForeColor = data.AmountMainCurrency < 0 ? System.Drawing.Color.Red : System.Drawing.Color.Gray;
                ctlAmountTHB.ForeColor    = data.AmountTHB < 0 ? System.Drawing.Color.Red : System.Drawing.Color.Gray;
            }
        }
Exemple #4
0
        public ReimbursementReportValueObj GetReportCriteria()
        {
            ReimbursementReportValueObj report = new ReimbursementReportValueObj();

            report.PBID = Convert.ToInt64(ctlPbDropdownList.SelectedValue);
            //report.PBID = 98;
            report.RequestDateFrom = ctlRequestDateFromPicker.Value;
            report.RequestDateTo   = ctlRequestDateToPicker.Value;
            report.PaidDateFrom    = ctlPaidDateFromPicker.Value;
            report.PaidDateTo      = ctlPaidDateToPicker.Value;
            report.RequestNoFrom   = ctlRequestNoFromTextbox.Text;
            report.RequestNoTo     = ctlRequestNoToTextbox.Text;
            if (ctlMarkedDocument.Checked && !ctlUnmarkDocument.Checked)
            {
                report.MarkDocument = true;
            }
            else if (!ctlMarkedDocument.Checked && ctlUnmarkDocument.Checked)
            {
                report.MarkDocument = false;
            }
            else
            {
                report.MarkDocument = null;
            }

            string key = ApplicationMode + "reimbursementCriteriaCookie_" + UserAccount.UserID;

            Request.Cookies.Remove(key);
            HttpCookie reimburstCriteriaCookie = Request.Cookies[key];

            if (reimburstCriteriaCookie == null)
            {
                reimburstCriteriaCookie = new HttpCookie(key);
            }

            reimburstCriteriaCookie.Values["PBID"]            = report.PBID.ToString();
            reimburstCriteriaCookie.Values["RequestDateFrom"] = report.RequestDateFrom.ToString();
            reimburstCriteriaCookie.Values["RequestDateTo"]   = report.RequestDateTo.ToString();
            reimburstCriteriaCookie.Values["PaidDateFrom"]    = report.PaidDateFrom.ToString();
            reimburstCriteriaCookie.Values["PaidDateTo"]      = report.PaidDateTo.ToString();
            reimburstCriteriaCookie.Values["RequestNoFrom"]   = report.RequestNoFrom.ToString();
            reimburstCriteriaCookie.Values["RequestNoTo"]     = report.RequestNoTo.ToString();
            reimburstCriteriaCookie.Values["MarkDocument"]    = report.MarkDocument.ToString();
            Response.Cookies.Add(reimburstCriteriaCookie);
            return(report);
        }
Exemple #5
0
        protected object RequestData(int startRow, int pageSize, string sortExpression)
        {
            ReimbursementReportValueObj criteria = GetReportCriteria();

            return(ScgeAccountingQueryProvider.SCGDocumentQuery.GetReportList(criteria, startRow, pageSize, sortExpression));
        }
Exemple #6
0
        protected void ctlUpdateMarkBtn_Click(object sender, EventArgs e)
        {
            string key = ApplicationMode + "reimbursementCookie_" + UserAccount.UserID;

            Request.Cookies.Remove(key);
            HttpCookie reimburstCookie = Request.Cookies[key];

            if (reimburstCookie == null)
            {
                reimburstCookie = new HttpCookie(key);
            }

            IList <ReimbursementReportValueObj> obj = new List <ReimbursementReportValueObj>();
            string markList   = string.Empty;
            string unMarkList = string.Empty;
            string pb         = string.Empty;
            VOPB   voPb       = ScgDbQueryProvider.DbPBQuery.GetDescription(Convert.ToInt64(ctlPbDropdownList.SelectedValue), 2);

            pb = voPb.PBCode + " " + voPb.Description;

            if (Session["MarkStateBeforeUpdate"] != null)
            {
                IList <ReimbursementReportValueObj> markStateList = (IList <ReimbursementReportValueObj>)Session["MarkStateBeforeUpdate"];
                Session.Remove("MarkStateBeforeUpdate");
                int rowNo = 0;

                foreach (GridViewRow item in ctlReport.Rows)
                {
                    if (item.RowType == DataControlRowType.DataRow)
                    {
                        ReimbursementReportValueObj valueObj = new ReimbursementReportValueObj();
                        HiddenField docNo     = (HiddenField)ctlReport.Rows[item.RowIndex].FindControl("ctlDocumentID");
                        CheckBox    mark      = (CheckBox)ctlReport.Rows[item.RowIndex].FindControl("ctlMark");
                        Literal     requestNo = (Literal)ctlReport.Rows[item.RowIndex].FindControl("ctlRequestNo");
                        valueObj.DocumentID = Convert.ToInt64(docNo.Value);
                        valueObj.Mark       = mark.Checked;
                        if (mark.Checked)
                        {
                            if (!markStateList[rowNo].Mark)
                            {
                                if (!string.IsNullOrEmpty(markList))
                                {
                                    markList += ",";
                                }
                                markList += requestNo.Text;
                            }
                        }
                        else
                        {
                            if (markStateList[rowNo].Mark)
                            {
                                if (!string.IsNullOrEmpty(unMarkList))
                                {
                                    unMarkList += ",";
                                }
                                unMarkList += requestNo.Text;
                            }
                        }
                        obj.Add(valueObj);
                        rowNo++;
                    }
                }
                reimburstCookie.Values["markList"]   = markList;
                reimburstCookie.Values["unmarkList"] = unMarkList;
                Response.Cookies.Add(reimburstCookie);
                SCGDocumentService.UpdateMarkDocument(obj);
                ctlReport.DataCountAndBind();
                ctlUpdatePanelMaintainRateGrid.Update();

                SetMarkStateBeforeUpdate();

                StringBuilder scriptBuilder = new StringBuilder("window.open('ReimbursementReportOutput.aspx?");
                scriptBuilder.AppendFormat("pbId={0}", ctlPbDropdownList.SelectedValue);
                scriptBuilder.AppendFormat("&companyId={0}", voPb.CompanyID.Value);
                scriptBuilder.Append("') ;");
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), string.Empty, scriptBuilder.ToString(), true);
            }
        }