Example #1
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT508> resp = _reportsService.ChildGetAll <Model.Reports.RT508>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            string getLan = _systemService.SessionHelper.getLangauge();

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            PayrollLeavePaymentsReport  h          = new PayrollLeavePaymentsReport(parameters, getLan);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = resp.Items;
            //  h.Parameters["Fitlers"].Value = texts.Text;

            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #2
0
        private void FillReport(bool throwException = true)
        {
            ReportCompositeRequest             req  = GetRequest();
            ListResponse <Model.Reports.RT106> resp = _reportsService.ChildGetAll <Model.Reports.RT106>(req);

            //if (resp == null || string.IsNullOrEmpty(resp.Error))
            //{
            //    throw new Exception(GetGlobalResourceObject("Errors", "Error_1").ToString());
            //}
            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            TurnoverRate y = new TurnoverRate();

            y.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            y.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            resp.Items.ForEach(x => { x.MonthString = CultureInfo.CurrentUICulture.DateTimeFormat.GetMonthName(x.month); x.month = x.month - 1; x.rate = x.rate / 100; });
            y.DataSource = resp.Items;
            string user = _systemService.SessionHelper.GetCurrentUser();

            y.Parameters["User"].Value = user;

            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(y);
        }
Example #3
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT401> resp = _reportsService.ChildGetAll <Model.Reports.RT401>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            resp.Items.ForEach(x => x.StatusString = GetLocalResourceObject("Status" + x.status.ToString()).ToString());
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            LoansReport h = new LoansReport(parameters);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = resp.Items;

            //string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            //string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();


            h.Parameters["User"].Value = user;
            //    h.Parameters["Filters"].Value = texts.Text;
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #4
0
        private void FillReport(bool throwException = true)
        {
            int    count             = 0;
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;



            ListResponse <Model.Reports.RT802> resp = _reportsService.ChildGetAll <Model.Reports.RT802>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            resp.Items.ForEach(x => { x.TypeString = GetGlobalResourceObject("Common", "TrType" + x.type.ToString()).ToString(); x.ClassIdString = GetGlobalResourceObject("Classes", "Class" + x.classId.ToString()) != null ? GetGlobalResourceObject("Classes", "Class" + x.classId.ToString()).ToString() : "NA"; x.DateString = x.eventDt.ToString(_systemService.SessionHelper.GetDateformat() + " HH:mm", CultureInfo.CurrentCulture); });
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            AuditTrail h = new AuditTrail(parameters);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            h.Parameters["User"].Value = _systemService.SessionHelper.GetCurrentUser();
            //   h.Parameters["Filters"].Value = texts.Text;
            h.DataSource = resp.Items;


            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #5
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT602> resp = _reportsService.ChildGetAll <Model.Reports.RT602>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            resp.Items.ForEach(x =>
            {
                if (x.hireDate != null)
                {
                    x.hireDateString = x.hireDate.Value.ToString(_systemService.SessionHelper.GetDateformat());
                }
                else
                {
                    x.hireDateString = string.Empty;
                }
                if (x.lastReturnDate != null)
                {
                    x.lastReturnDateString = x.lastReturnDate.Value.ToString(_systemService.SessionHelper.GetDateformat());
                }
                else
                {
                    x.lastReturnDateString = string.Empty;
                }
            });
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            LeaveBalance h = new LeaveBalance(parameters);

            h.DataSource = resp.Items;

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;


            //string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            //string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();

            //h.Parameters["From"].Value = from;
            //h.Parameters["To"].Value = to;
            h.Parameters["User"].Value = user;
            //    h.Parameters["Fitlers"].Value = texts.Text;
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #6
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");


            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;


            ListResponse <Model.Reports.RT601> resp = _reportsService.ChildGetAll <Model.Reports.RT601>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            errorMSG.Text = "";
            string format = _systemService.SessionHelper.GetDateformat();

            resp.Items.ForEach(s =>
            {
                s.endDateString   = s.endDate.ToString(format, CultureInfo.CurrentCulture);
                s.startDateString = s.startDate.ToString(format, CultureInfo.CurrentCulture);
                if (s.returnDate.HasValue)
                {
                    s.returnDateString = s.returnDate.Value.ToString(format, CultureInfo.CurrentCulture);
                }

                s.isPaidString = s.isPaid ? GetLocalResourceObject("Paid1").ToString() : GetLocalResourceObject("Paid0").ToString();
                s.statusString = statusList.Where(y => y.key == s.status).Count() != 0 ? statusList.Where(y => y.key == s.status).First().value : "";
            });
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            LeaveList h = new LeaveList(parameters);

            h.DataSource = resp.Items;

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            //string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            //string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();


            h.Parameters["User"].Value = user;
            //  h.Parameters["Fitlers"].Value = texts.Text;
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #7
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT113> resp = _reportsService.ChildGetAll <Model.Reports.RT113>(req);



            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }


            resp.Items.ForEach(x => {
                x.licenseExpiryDateString = x.licenseExpiryDate == null ? " " : ((DateTime)x.licenseExpiryDate).ToString(_systemService.SessionHelper.GetDateformat());
                x.licenseIssueDateString  = x.licenseIssueDate == null ? " " : ((DateTime)x.licenseIssueDate).ToString(_systemService.SessionHelper.GetDateformat());
            });

            string getLang = _systemService.SessionHelper.getLangauge();

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            BranchWorkforce             h          = new BranchWorkforce(parameters, getLang);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = resp.Items;

            //  string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            //  string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string user = _systemService.SessionHelper.GetCurrentUser();


            //h.Parameters["Fitlers"].Value = texts.Text;

            h.Parameters["User"].Value = user;


            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #8
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params = vals.Text;
            //PendingPunchListRequest req = new PendingPunchListRequest();
            //if (vals.Text == "")
            //{
            //    req.ppTypeParam = "0";
            //}
            //else
            //{
            //    req.ppTypeParam = rep_params.Substring(2, 1);
            //}
            //req.udid = "0";
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.TimeAttendance.PendingPunch> resp = _timeAttendanceService.ChildGetAll <Model.TimeAttendance.PendingPunch>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            //resp.Items.ForEach(x =>
            //{
            //    if (x.hireDate != null)
            //        x.hireDateString = ((DateTime)(x.hireDate)).ToString(_systemService.SessionHelper.GetDateformat(), System.Threading.Thread.CurrentThread.CurrentCulture);
            //    if (x.terminationDate != null)
            //        x.terminationDateString = ((DateTime)(x.terminationDate)).ToString(_systemService.SessionHelper.GetDateformat(), System.Threading.Thread.CurrentThread.CurrentCulture);
            //});

            string getLan = _systemService.SessionHelper.getLangauge();

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            PendingPunches h = new PendingPunches(parameters, getLan);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;



            //h.Parameters["User"].Value = _systemService.SessionHelper.GetCurrentUser();
            //   h.Parameters["Filters"].Value = texts.Text;
            h.DataSource = resp.Items;

            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #9
0
        public void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT201> resp = _reportsService.ChildGetAll <Model.Reports.RT201>(req);

            //if (!resp.Success)
            //{

            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");

            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            string getLang = _systemService.SessionHelper.getLangauge();

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            SalaryHistory h = new SalaryHistory(parameters, getLang);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            resp.Items.ForEach(x => {
                x.PaymentFrequencyString = x.paymentFrequency.HasValue? GetGlobalResourceObject("Common", ((PaymentFrequency)x.paymentFrequency).ToString()).ToString():"";
                x.SalaryTypeString       = x.salaryType.HasValue ? GetGlobalResourceObject("Common", ((SalaryType)x.salaryType).ToString()).ToString() : "";
                x.EffectiveDateString    = x.effectiveDate.ToString(_systemService.SessionHelper.GetDateformat(), CultureInfo.CurrentCulture);
            });

            h.DataSource = resp.Items;
            string user = _systemService.SessionHelper.GetCurrentUser();

            h.Parameters["User"].Value = user;


            h.CreateDocument();
            //string format = "Pdf";
            //string fileName = String.Format("Report.{0}", format);
            //MemoryStream ms = new MemoryStream();
            //h.ExportToPdf(ms,new DevExpress.XtraPrinting.PdfExportOptions() { ShowPrintDialogOnOpen = true });
            //Response.Clear();
            //Response.ContentType = "application/pdf";
            //Response.AddHeader("Content-Disposition", String.Format("{0}; filename={1}", "inline", fileName));
            //Response.BinaryWrite(ms.ToArray());
            //Response.End();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #10
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            ReportCompositeRequest req = GetRequest();

            ListResponse <Model.Reports.RT402> resp = _reportsService.ChildGetAll <Model.Reports.RT402>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            for (int i = 0; i < resp.Items.Count; i++)
            {
                if (i == 0)
                {
                    resp.Items[i].balance = resp.Items[i].amount;
                }
                else
                {
                    resp.Items[i].balance = resp.Items[i - 1].balance + resp.Items[i].amount;
                }
                resp.Items[i].dateStringFormat = resp.Items[i].date.ToString(_systemService.SessionHelper.GetDateformat());
            }


            LoanStatement h = new LoanStatement();

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = resp.Items;

            //  string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            //  string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string user = _systemService.SessionHelper.GetCurrentUser();



            h.Parameters["User"].Value         = user;
            h.Parameters["EmployeeName"].Value = employeeFilter.SelectedItem.Text;

            h.Parameters["descriptionTrxType1"].Value = GetLocalResourceObject("descriptionTrxType1");
            h.Parameters["descriptionTrxType2"].Value = GetLocalResourceObject("descriptionTrxType2");



            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #11
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT111> resp = _reportsService.ChildGetAll <Model.Reports.RT111>(req);



            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
                return;
            }


            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);



            BankAccounts h = new BankAccounts(parameters);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = resp.Items;

            //  string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            //  string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string user = _systemService.SessionHelper.GetCurrentUser();



            //h.Parameters["PositionName"].Value = jobInfo1.GetPosition();
            h.Parameters["User"].Value = user;

            //h.Parameters["Status"].Value = statusCombo.SelectedItem.Text;



            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #12
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT503> resp = _reportsService.ChildGetAll <Model.Reports.RT503>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }



            string user = _systemService.SessionHelper.GetCurrentUser();


            bool isArabic = _systemService.SessionHelper.CheckIfArabicSession();


            int bulk = 1;

            if (filterBy.Value != null)
            {
                int.TryParse(filterBy.Value.ToString(), out bulk);
            }

            string getLan = _systemService.SessionHelper.getLangauge();

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            GroupedPayrollCrossReport   h          = new GroupedPayrollCrossReport(resp.Items, isArabic, (GroupedPayrollCrossReport.GroupType)bulk, parameters, getLan);

            h.PrintingSystem.Document.AutoFitToPagesWidth = 1;


            h.Parameters["User"].Value = user;
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #13
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT502> resp = _reportsService.ChildGetAll <Model.Reports.RT502>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            resp.Items.ForEach(x =>
            {
                x.cvOvertime      = Math.Round(x.cvOvertime, 2);
                x.cvLateness      = Math.Round(x.cvLateness, 2);
                x.cvAbsence       = Math.Round(x.cvAbsence, 2);
                x.cvDisappearance = Math.Round(x.cvDisappearance, 2);
                x.cvMissedPunches = Math.Round(x.cvMissedPunches, 2);
            });

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);

            PayrollPeriodTimeCodes h = new PayrollPeriodTimeCodes(parameters);

            h.DataSource = resp.Items;

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;


            string user = _systemService.SessionHelper.GetCurrentUser();

            //h.Parameters["User"].Value = _systemService.SessionHelper.GetCurrentUser();
            //   h.Parameters["Filters"].Value = texts.Text;
            h.DataSource = resp.Items;

            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #14
0
        public void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT202> resp = _reportsService.ChildGetAll <Model.Reports.RT202>(req);

            resp.Items.ForEach(x =>
            {
                if (x.prevBasicAmount == 0)
                {
                    x.prevBasicAmount = null; x.prevCurrencyRef = ""; x.PrevSalaryTypeString = "";
                }
            });
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            //resp.Items.ForEach(x => { x.PaymentFrequencyString = GetGlobalResourceObject("Common", ((PaymentFrequency)x.paymentFrequency).ToString()).ToString(); });

            resp.Items.ForEach(x =>
            {
                x.SalaryTypeString     = x.salaryType.HasValue ? GetGlobalResourceObject("Common", ((SalaryType)x.salaryType).ToString()).ToString() : "";
                x.PrevSalaryTypeString = x.prevSalaryType.HasValue ? GetGlobalResourceObject("Common", ((SalaryType)x.prevSalaryType).ToString()).ToString() : "";
                x.DateString           = x.effectiveDate != null ? ((DateTime)(x.effectiveDate)).ToString(_systemService.SessionHelper.GetDateformat(), CultureInfo.CurrentCulture) : "";
            });
            string getLan = _systemService.SessionHelper.getLangauge();
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            SalaryChanges h = new SalaryChanges(parameters, getLan);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            h.DataSource = resp.Items;
            string user = _systemService.SessionHelper.GetCurrentUser();

            h.Parameters["User"].Value = user;


            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #15
0
        private void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT803> resp = _reportsService.ChildGetAll <Model.Reports.RT803>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            Dictionary <string, string> parameters = Common.FetchReportParameters(texts.Text);
            UsersReport          h            = new UsersReport(parameters);
            List <XMLDictionary> userTypeList = Common.XMLDictionaryList(_systemService, "7");

            resp.Items.ForEach(x => x.userTypeName = userTypeList.Where(y => y.key == x.userType).Count() != 0 ? userTypeList.Where(y => y.key == x.userType).First().value : "");
            //  resp.Items.ForEach(x => x.DateString = x.eventDT.ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"))); SignInTrail h = new SignInTrail();
            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            h.DataSource = resp.Items;
            //  string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            //  string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();

            // h.Parameters["From"].Value = from;
            //  h.Parameters["To"].Value = to;
            h.Parameters["User"].Value = user;
            // h.Parameters["Filters"].Value = texts.Text;
            //if (resp.Items.Count > 0)
            //{
            //    //if (req.Parameters["_userId"] != "0")
            //    //    h.Parameters["UserId"].Value = resp.Items[0].userName;
            //    else
            //        h.Parameters["UserId"].Value = GetGlobalResourceObject("Common", "All");
            //}

            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #16
0
        private void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT203> resp = _reportsService.ChildGetAll <Model.Reports.RT203>(req);

            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);

            string getLan = _systemService.SessionHelper.getLangauge();

            PointInTimeSalary h = new PointInTimeSalary(parameters, getLan);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            resp.Items.ForEach(x => { x.SalaryTypeString = x.salaryType.HasValue ? GetGlobalResourceObject("Common", ((SalaryType)x.salaryType).ToString()).ToString() : ""; });


            h.DataSource = resp.Items;

            //string from = DateTime.Parse(req.Parameters["_asOfDate"]).ToString(_systemService.SessionHelper.GetDateformat());

            string user = _systemService.SessionHelper.GetCurrentUser();



            h.Parameters["User"].Value = user;
            // h.Parameters["Fitlers"].Value = texts.Text;

            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #17
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT115> resp = _reportsService.ChildGetAll <Model.Reports.RT115>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            resp.Items.ForEach(x =>
            {
                if (x.hireDate != null)
                {
                    x.hireDateString = ((DateTime)(x.hireDate)).ToString(_systemService.SessionHelper.GetDateformat(), System.Threading.Thread.CurrentThread.CurrentCulture);
                }
                if (x.terminationDate != null)
                {
                    x.terminationDateString = ((DateTime)(x.terminationDate)).ToString(_systemService.SessionHelper.GetDateformat(), System.Threading.Thread.CurrentThread.CurrentCulture);
                }
            });
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            IndemnityReport             h          = new IndemnityReport(parameters);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;



            h.Parameters["User"].Value = _systemService.SessionHelper.GetCurrentUser();
            //   h.Parameters["Filters"].Value = texts.Text;
            h.DataSource = resp.Items;

            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #18
0
        private void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT104> resp = _reportsService.ChildGetAll <Model.Reports.RT104>(req);

            //if (resp == null || string.IsNullOrEmpty(resp.Error))
            //{
            //    throw new Exception(GetGlobalResourceObject("Errors", "Error_1").ToString());
            //}
            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");

            //}

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            YearsInService y = new YearsInService(parameters);

            y.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            y.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            List <Model.Reports.RT104> reordered = resp.Items.Where(x => x.hiredMonth >= DateTime.Now.Month).ToList();

            reordered.AddRange(resp.Items.Where(x => x.hiredMonth < DateTime.Now.Month).OrderBy(h => h.hiredMonth).ToList());
            reordered.ForEach(x => x.HiredMonthString = GetGlobalResourceObject("Common", new CultureInfo("en-US").DateTimeFormat.GetMonthName(x.hiredMonth)).ToString());
            y.DataSource = reordered;
            string user = _systemService.SessionHelper.GetCurrentUser();

            y.Parameters["User"].Value = user;

            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(y);
        }
Example #19
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT506> resp = _reportsService.ChildGetAll <Model.Reports.RT506>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }


            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            PayrollPeriodSummary        h          = new PayrollPeriodSummary(parameters);

            h.DataSource = resp.Items;

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;


            string user = _systemService.SessionHelper.GetCurrentUser();

            //if (resp.Items.Count != 0)
            //{
            //    h.Parameters["startDate"].Value = resp.Items[0].startDate.ToString(_systemService.SessionHelper.GetDateformat());
            //    h.Parameters["endDate"].Value = resp.Items[0].endDate.ToString(_systemService.SessionHelper.GetDateformat());
            //}
            h.Parameters["User"].Value = user;

            // h.Parameters["Fitlers"].Value = texts.Text;
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #20
0
        public void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;
            ListResponse <Model.Reports.RT105> resp = _reportsService.ChildGetAll <Model.Reports.RT105>(req);

            //if (resp == null || string.IsNullOrEmpty(resp.Error))
            //{
            //    throw new Exception(GetGlobalResourceObject("Errors", "Error_1").ToString());
            //}
            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            resp.Items.ForEach(x => x.DateString = x.date.ToString(_systemService.SessionHelper.GetDateformat()));
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);

            JobHistory h = new JobHistory(parameters);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            h.Parameters["User"].Value = _systemService.SessionHelper.GetCurrentUser();
            h.DataSource = resp.Items;



            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #21
0
        private void FillReport(bool throwException = true)
        {
            ReportCompositeRequest             req  = GetRequest();
            ListResponse <Model.Reports.RT801> resp = _reportsService.ChildGetAll <Model.Reports.RT801>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            resp.Items.ForEach(x => x.DateString = x.eventDT.ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"))); SignInTrail h = new SignInTrail();
            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;

            h.DataSource = resp.Items;
            string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string to   = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();

            h.Parameters["From"].Value = from;
            h.Parameters["To"].Value   = to;
            h.Parameters["User"].Value = user;
            if (resp.Items.Count > 0)
            {
                if (req.Parameters["_userId"] != "0")
                {
                    h.Parameters["UserId"].Value = resp.Items[0].userName;
                }
                else
                {
                    h.Parameters["UserId"].Value = GetGlobalResourceObject("Common", "All");
                }
            }

            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #22
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;


            ListResponse <Model.Reports.RT507> resp = _reportsService.ChildGetAll <Model.Reports.RT507>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            List <Model.Reports.RT501> Items = new List <Model.Reports.RT501>();

            Items.AddRange(resp.Items);
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            EmployeesPaySlip            h          = new EmployeesPaySlip(Items, _systemService.SessionHelper.CheckIfArabicSession(), parameters);



            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            string user = _systemService.SessionHelper.GetCurrentUser();

            h.Parameters["user"].Value = user;
            //  h.Parameters["Fitlers"].Value = texts.Text;


            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #23
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT301> resp = _reportsService.ChildGetAll <Model.Reports.RT301>(req);

            //if (!resp.Success)
            //{

            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");

            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            var monthlyGrouped = resp.Items.GroupBy(x => x.month);
            MonthlyEmployeeAttendanceCollection monthlyAtts = new MonthlyEmployeeAttendanceCollection();

            foreach (var item in monthlyGrouped)
            {
                MonthAttendance at = new MonthAttendance(item.Key, item.ToList());
                monthlyAtts.Add(at);
            }

            //var grouped = resp.Items.GroupBy(x => x.name.fullName);


            //EmployeeAttendanceCollection ats = new EmployeeAttendanceCollection();
            //foreach (var item in grouped)
            //{
            //    EmployeeAttendances at = new EmployeeAttendances();
            //    at.name = item.Key;

            //    var details = item.ToList();
            //    if (details.Count != 0)
            //    {
            //        at.departmentName = details[0].departmentName;
            //        at.branchName = details[0].branchName;
            //        at.positionName = details[0].positionName;
            //    }

            //    foreach (var subItem in item.ToList())
            //    {
            //        at.Add(new Attendance() { workingTime=subItem.workingTime, day = subItem.day, year=subItem.year, month = subItem.month, timeIn = subItem.checkIn, timeOut = subItem.checkOut });

            //    }
            //    ats.Add(at);
            //}


            TimeAttendanceSummary h = new TimeAttendanceSummary();

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = monthlyAtts;
            string   user = _systemService.SessionHelper.GetCurrentUser();
            DateTime date = DateTime.Parse(req.Parameters["_fromDate"]);

            h.Parameters["User"].Value    = user;
            h.Parameters["Fitlers"].Value = texts.Text;
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #24
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;


            ListResponse <Model.Reports.RT112> resp = _reportsService.ChildGetAll <Model.Reports.RT112>(req);



            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);



            EmployeesNotes h = new EmployeesNotes(parameters);

            //List<Model.Reports.RT112> EN = new List<Model.Reports.RT112>();
            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            //   var d= resp.Items.GroupBy(x => x.employeeName);

            resp.Items.ForEach(x => x.dateString = x.date.ToString(_systemService.SessionHelper.GetDateformat() + " HH:MM"));
            //  d.ToList().ForEach(x =>
            //  {

            //      //EN.Add(x.ToList()[0]);
            //      //x.ToList().RemoveAt(0);
            //      x.ToList()[0].dateString = x.ToList()[0].date.ToString(_systemService.SessionHelper.GetDateformat() + " HH:MM");
            //      EN.Add(x.ToList()[0]);
            //      foreach (var e in x.Skip(1))
            //      {
            //          e.employeeName = "";
            //          e.dateString = e.date.ToString(_systemService.SessionHelper.GetDateformat() + " HH:MM");
            //          EN.Add(e);
            //      }



            //  }

            //);



            h.DataSource = resp.Items;

            //  string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            //  string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string user = _systemService.SessionHelper.GetCurrentUser();



            //h.Parameters["PositionName"].Value = jobInfo1.GetPosition();
            h.Parameters["User"].Value = user;

            //h.Parameters["Status"].Value = statusCombo.SelectedItem.Text;



            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #25
0
        private void FillReport(bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT108> resp = _reportsService.ChildGetAll <Model.Reports.RT108>(req);

            //if (resp == null || string.IsNullOrEmpty(resp.Error))
            //{
            //    throw new Exception(GetGlobalResourceObject("Errors", "Error_1").ToString());
            //}
            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            EmployeeDetails             y          = new EmployeeDetails(parameters);

            y.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            y.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            string      format = _systemService.SessionHelper.GetDateformat();
            CultureInfo cul    = CultureInfo.CurrentCulture;

            resp.Items.ForEach(x =>
            {
                x.hireDateString = x.hireDate.HasValue? x.hireDate.Value.ToString(format, cul) :"";

                x.idExpiryString        = x.resExpiryDate.HasValue? x.resExpiryDate.Value.ToString(format, cul) :"";
                x.passportExpiryString  = x.passportExpiryDate.HasValue? x.passportExpiryDate.Value.ToString(format, cul) :"";
                x.terminationDateString = x.terminationDate.HasValue? x.terminationDate.Value.ToString(format, cul) :"";
                x.lastLeaveReturnString = x.lastLeaveReturnDate.HasValue? x.lastLeaveReturnDate.Value.ToString(format, cul) :"";
                x.termEndDateString     = x.termEndDate.HasValue ? x.termEndDate.Value.ToString(format, cul) : "";
                x.genderString          = x.gender == 1?GetGlobalResourceObject("Common", "Male").ToString(): GetGlobalResourceObject("Common", "Female").ToString();
                switch (x.religion)
                {
                case 0: x.religionString = GetGlobalResourceObject("Common", "Religion0").ToString();
                    break;

                case 1: x.religionString = GetGlobalResourceObject("Common", "Religion1").ToString();
                    break;

                case 2:
                    x.religionString = GetGlobalResourceObject("Common", "Religion2").ToString();
                    break;

                case 3:
                    x.religionString = GetGlobalResourceObject("Common", "Religion3").ToString();
                    break;

                case 4:
                    x.religionString = GetGlobalResourceObject("Common", "Religion4").ToString();
                    break;

                case 5:
                    x.religionString = GetGlobalResourceObject("Common", "Religion5").ToString();
                    break;

                case 6:
                    x.religionString = GetGlobalResourceObject("Common", "Religion6").ToString();
                    break;

                default: x.religionString = "";
                    break;
                }
                x.isInactiveString = (ActiveStatus)x.activeStatus == ActiveStatus.INACTIVE?GetGlobalResourceObject("Common", "Inactive").ToString():GetGlobalResourceObject("Common", "Active").ToString();
            });
            y.DataSource = resp.Items;
            string user = _systemService.SessionHelper.GetCurrentUser();

            y.Parameters["User"].Value = user;



            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(y);
        }
Example #26
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT501> resp = _reportsService.ChildGetAll <Model.Reports.RT501>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            //resp.Items is the list of RT501 objects  that you can used it as data source for reprot


            //Filters parameters as string

            resp.Items.ForEach(x =>
            {
                x.startDateString = x.startDate.ToString(_systemService.SessionHelper.GetDateformat());
                x.endDateString   = x.endDate.ToString(_systemService.SessionHelper.GetDateformat());
            });

            string user = _systemService.SessionHelper.GetCurrentUser();
            //string paymentMethod = paymentMethodCombo.GetPaymentMethodString();
            //string payRef = payId.SelectedItem.Text;
            //string department = jobInfo1.GetDepartment();
            //string position = jobInfo1.GetPosition();
            //string employee = employeeFilter.GetEmployeeName();

            string getLan = _systemService.SessionHelper.getLangauge();

            // this variable for check if the user request arabic report or english   true mean arabic reprot
            bool isArabic = _systemService.SessionHelper.CheckIfArabicSession();
            //those two lines code for fill the viewer with your report
            //ASPxWebDocumentViewer1.DataBind();
            //ASPxWebDocumentViewer1.OpenReport();



            //Old work
            //var d = resp.Items.GroupBy(x => x.employeeName.fullName);
            //PayrollLineCollection lines = new PayrollLineCollection();
            //HashSet<Model.Reports.EntitlementDeduction> ens = new HashSet<Model.Reports.EntitlementDeduction>(new EntitlementDeductionComparer());
            //HashSet<Model.Reports.EntitlementDeduction> des = new HashSet<Model.Reports.EntitlementDeduction>(new EntitlementDeductionComparer());
            //resp.Items.ForEach(x =>
            //{
            //    Model.Reports.EntitlementDeduction DE = new Model.Reports.EntitlementDeduction();

            //    if (x.edType == 1)
            //    {

            //        try
            //        {
            //            DE.name = GetLocalResourceObject(x.edName.Trim()).ToString().TrimEnd();
            //            DE.amount = 0; DE.isTaxable = x.isTaxable;
            //        }
            //        catch { DE.name = x.edName; DE.amount = 0; DE.isTaxable = x.isTaxable; }
            //        ens.Add(DE);
            //    }
            //    else
            //    {

            //        try
            //        {
            //            DE.name = GetLocalResourceObject(x.edName.Trim()).ToString().TrimEnd();
            //            DE.amount = 0;
            //        }
            //        catch { DE.name = x.edName; DE.amount = 0; }
            //        des.Add(DE);
            //    }
            //});

            //foreach (var item in d)
            //{
            //    var list = item.ToList();
            //    list.ForEach(y =>
            //    {

            //        try
            //        {
            //            y.edName = GetLocalResourceObject(y.edName.Trim()).ToString().TrimEnd();

            //        }
            //        catch { y.edName = y.edName; }

            //    });
            //    PayrollLine line = new PayrollLine(ens, des, list, GetLocalResourceObject("taxableeAmount").ToString(), GetLocalResourceObject("eAmount").ToString(), GetLocalResourceObject("dAmount").ToString(), GetLocalResourceObject("net").ToString(), GetLocalResourceObject("essString").ToString(), GetLocalResourceObject("cssString").ToString(), _systemService.SessionHelper.GetDateformat(),GetLocalResourceObject("netSalaryString").ToString());
            //    lines.Add(line);
            //}

            //MonthlyPayrollCollection s = new MonthlyPayrollCollection();


            //if (lines.Count > 0)
            //{
            //    MonthlyPayrollSet p = new MonthlyPayrollSet(GetLocalResourceObject("Entitlements").ToString(), GetLocalResourceObject("Taxable").ToString(), GetLocalResourceObject("Deductions").ToString());
            //    p.PayPeriodString = resp.Items[0].startDate.ToString(_systemService.SessionHelper.GetDateformat()) + " - " + resp.Items[0].endDate.ToString(_systemService.SessionHelper.GetDateformat());
            //    p.PayDate = GetLocalResourceObject("PaidAt")+" "+ resp.Items[0].payDate.ToString(_systemService.SessionHelper.GetDateformat());
            //    p.Names = (lines[0] as PayrollLine).Entitlements;
            //    p.DIndex = ens.Count;
            //    p.taxableIndex = ens.Count(x => x.isTaxable);
            //    p.Payrolls = lines;
            //    s.Add(p);
            //}
            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            //EmployeePayrollCrossReport h = new EmployeePayrollCrossReport(resp.Items, isArabic, parameters);
            EmployeePayrollCrossReport h = new EmployeePayrollCrossReport(resp.Items, getLan, parameters);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.PrintingSystem.Document.AutoFitToPagesWidth = 1;

            //h.DataSource = s;
            //h.objectDataSource2.DataSource = resp.Items.Where(x => x.edType == 2).ToList();



            h.Parameters["User"].Value = user;
            // h.Parameters["Filters"].Value = texts.Text;



            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #27
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params = vals.Text;
            TimeAttendanceViewListRequest req = new TimeAttendanceViewListRequest();

            req.paramString = rep_params;
            req.StartAt     = "0";

            req.Size   = "1000";
            req.sortBy = "dayId";



            //ListResponse<AttendanceDay> resp = _timeAttendanceService.ChildGetAll<AttendanceDay>(req);
            ListResponse <AttendanceDay> resp = _reportsService.ChildGetAll <AttendanceDay>(req);

            //if (!resp.Success)
            //{


            //        throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");

            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            bool rtl = _systemService.SessionHelper.CheckIfArabicSession();

            resp.Items.ForEach(x =>
            {
                x.dayId = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString(_systemService.SessionHelper.GetDateformat());
            }
                               );

            double OTL    = 0;
            double OTO    = 0;
            double TET    = 0;
            string getLan = _systemService.SessionHelper.getLangauge();
            Dictionary <string, string>   parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            DetailedAttendanceWOVariation h          = new DetailedAttendanceWOVariation(parameters, getLan);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            List <Model.Reports.RT303> data = new List <Model.Reports.RT303>();

            if (resp.Items.Count != 0)
            {
                Model.Reports.RT303 Item;
                resp.Items.ForEach(x =>
                {
                    Item                = new Model.Reports.RT303();
                    Item.dayId          = x.dayId;
                    Item.employeeName   = x.employeeName;
                    Item.employeeRef    = x.employeeRef;
                    Item.branchName     = x.branchName;
                    Item.positionName   = x.positionName;
                    Item.departmentName = x.departmentName;
                    Item.effectiveTime  = x.effectiveTime;
                    if (x.firstPunch == null)
                    {
                        Item.firstPunch = "";
                    }
                    else
                    {
                        Item.firstPunch = x.firstPunch;
                    }

                    if (x.lastPunch == null)
                    {
                        Item.lastPunch = "";
                    }
                    else
                    {
                        Item.lastPunch = x.lastPunch;
                    }

                    Item.dayStatus        = x.dayStatus;
                    Item.totEffectiveTime = Convert.ToDouble(x.effectiveTime);//calculateTimeInMinutes(x.effectiveTime);
                    if (timeformat(Convert.ToInt32(x.effectiveTime)) == "00:00")
                    {
                        Item.strEffectiveTime = "";
                    }
                    else
                    {
                        Item.strEffectiveTime = timeformat(Convert.ToInt32(x.effectiveTime));
                    }


                    if (x.LATE_CHECKIN == 0)
                    {
                        Item.lateCheckin = "";
                    }
                    else
                    {
                        Item.lateCheckin = time(Convert.ToInt32(x.LATE_CHECKIN), false);
                    }
                    //Item.lateCheckin = x.variationsList.Where(y => y.timeCode == 31).Count() != 0 ? time(x.variationsList.Where(y => y.timeCode == 31).First().duration, false) : "00:00";
                    //Item.duringShiftLeave = x.variationsList.Where(y => y.timeCode == 32).Count() != 0 ? time(x.variationsList.Where(y => y.timeCode == 32).First().duration, false) : "";
                    double dsl           = 0;
                    double totalLatness  = 0;
                    double totalOverTime = 0;
                    double totEarlyCI    = 0;
                    double totlateCI     = 0;
                    double totEarlyLe    = 0;
                    double missedShift   = 0;

                    foreach (DetailedAttendanceVariation obj in x.variationsList)
                    {
                        if (obj.timeCode == 32)
                        {
                            dsl += obj.duration;
                        }
                        if (obj.timeCode == 31 || obj.timeCode == 33)
                        {
                            totalLatness += obj.duration;
                        }
                        if (obj.timeCode == 51 || obj.timeCode == 52)
                        {
                            totalOverTime += obj.duration;
                        }
                        if (obj.timeCode == 51)
                        {
                            totEarlyCI += obj.duration;
                        }
                        if (obj.timeCode == 31)
                        {
                            totlateCI += obj.duration;
                        }
                        if (obj.timeCode == 33)
                        {
                            totEarlyLe += obj.duration;
                        }
                        if (obj.timeCode == 21)
                        {
                            missedShift += obj.duration;
                        }
                    }

                    Item.duringShiftLeave  = x.DURING_SHIFT_LEAVE.ToString(); //dsl.ToString();
                    Item.totTotalLateness  = x.NET_LATENESS;                  //totalLatness;
                    Item.totTotalOvertime  = x.NET_OVERTIME;                  // totalOverTime;
                    Item.lineTotalOvertime = x.OVERTIME;                      //totalOverTime;
                    Item.missedShift       = missedShift;

                    Item.lineDuringShiftLeave = x.DURING_SHIFT_LEAVE;
                    Item.lineEarlyCheckIn     = x.EARLY_CHECKIN; //totEarlyCI;
                    Item.lineLateCheckIn      = x.LATE_CHECKIN;  //totlateCI;
                    Item.lineEarlyLeave       = x.EARLY_LEAVE;

                    Item.totTotalLateness  = x.NET_LATENESS;
                    Item.bTotTotalLateness = x.NET_LATENESS.ToString();                   //totalLatness.ToString();
                    Item.bTotTotalOvertime = x.NET_OVERTIME.ToString();                   //totalOverTime.ToString();
                    Item.strMissedShift    = timeformat(Convert.ToInt32(missedShift));    //totalLatness.ToString();
                    Item.totalLateness     = timeformat(Convert.ToInt32(x.NET_LATENESS)); //timeformat(Convert.ToInt32(totalLatness + dsl+missedShift));//totalLatness.ToString();
                    Item.totalOvertime     = timeformat(Convert.ToInt32(x.NET_OVERTIME)); //timeformat(Convert.ToInt32(totalOverTime));//totalOverTime.ToString();
                    //Item.earlyLeave = x.variationsList.Where(y => y.timeCode == 33).Count() != 0 ? time(x.variationsList.Where(y => y.timeCode == 33).First().duration, false) : "00:00";
                    //Item.earlyCheckin = x.variationsList.Where(y => y.timeCode == 51).Count() != 0 ? time(x.variationsList.Where(y => y.timeCode == 51).First().duration, false) : "00:00";

                    if (x.EARLY_LEAVE == 0)
                    {
                        Item.earlyLeave = "00:00";
                    }
                    else
                    {
                        Item.earlyLeave = time(Convert.ToInt32(x.EARLY_LEAVE), false);
                    }

                    if (x.EARLY_CHECKIN == 0)
                    {
                        Item.earlyCheckin = "00:00";
                    }
                    else
                    {
                        Item.earlyCheckin = time(Convert.ToInt32(x.EARLY_CHECKIN), false);
                    }

                    if (x.OVERTIME == 0)
                    {
                        Item.overtime = "00:00";
                    }
                    else
                    {
                        Item.overtime = time(Convert.ToInt32(x.OVERTIME), false);
                    }

                    //Item.overtime = time(Convert.ToInt32(x.netOvertime),false);//x.variationsList.Where(y => y.timeCode == 52).Count() != 0 ? time(x.variationsList.Where(y => y.timeCode == 52).First().duration, false) : "";

                    TET += Convert.ToDouble(x.effectiveTime);

                    Item.ttEffTime = timeformat(Convert.ToInt32(TET));

                    data.Add(Item);
                });

                //data[data.Count - 1].ttEffTime = timeformat(Convert.ToInt32(TET));

                h.DataSource = data;
            }
            else
            {
                h.DataSource = resp.Items;
            }

            string user = _systemService.SessionHelper.GetCurrentUser();


            h.Parameters["User"].Value = user;



            h.CreateDocument();
            ASPxWebDocumentViewer1.OpenReport(h);
            ASPxWebDocumentViewer1.DataBind();
        }
Example #28
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT302> resp = _reportsService.ChildGetAll <Model.Reports.RT302>(req);

            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");

            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            string getLan = _systemService.SessionHelper.getLangauge();

            foreach (var item in resp.Items)

            {
                item.Absent        = item.absentDays;   // item.calendarDays - item.workingDays;
                item.totLateness   = item.NET_LATENESS; //item.LATE_CHECKIN + item.DURING_SHIFT_LEAVE + item.EARLY_LEAVE+item.SHIFT_LEAVE_WITHOUT_EXCUSE;
                item.totOvertime   = item.NET_OVERTIME; //item.OVERTIME + item.EARLY_CHECKIN;
                item.Total_Absent += item.Absent;
                //if (item.SHIFT_LEAVE_WITHOUT_EXCUSE >= 1)
                //{
                //    item.SHIFT_LEAVE_WITHOUT_EXCUSE = item.SHIFT_LEAVE_WITHOUT_EXCUSE * 60;
                //}

                //if (item.LATE_CHECKIN >= 1)
                //{
                //    item.LATE_CHECKIN = item.LATE_CHECKIN * 60;
                //}
            }

            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);
            PeriodSummary h = new PeriodSummary(parameters, getLan);

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = resp.Items;

            //string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            //string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string user = _systemService.SessionHelper.GetCurrentUser();


            h.Parameters["User"].Value = user;



            //h.Parameters["Fitlers"].Value = texts.Text;

            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #29
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            ReportCompositeRequest req = GetRequest();

            ListResponse <Model.Reports.RT301> resp = _reportsService.ChildGetAll <Model.Reports.RT301>(req);

            //if (!resp.Success)
            //{
            //    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
            //}
            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }


            List <Model.Reports.DailyAttendance> atts = new List <Model.Reports.DailyAttendance>();

            resp.Items.ForEach(x => atts.Add(new Model.Reports.DailyAttendance()
            {
                name               = x.name,
                branchName         = x.branchName,
                departmentName     = x.departmentName,
                Date               = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")),
                lateness           = x.OL_A_SIGN[0] == '-' ? (new TimeSpan(Convert.ToInt32(x.OL_A.Substring(1, 2)), -Convert.ToInt32(x.OL_A.Substring(4, 2)), 0)) : (new TimeSpan(Convert.ToInt32(x.OL_A.Substring(0, 2)), Convert.ToInt32(x.OL_A.Substring(3, 2)), 0)),
                early              = x.OL_D_SIGN[0] == '-' ? (new TimeSpan(Convert.ToInt32(x.OL_D.Substring(1, 2)), Convert.ToInt32(x.OL_D.Substring(4, 2)), 0)) : (new TimeSpan(Convert.ToInt32(x.OL_D.Substring(0, 2)), Convert.ToInt32(x.OL_D.Substring(3, 2)), 0)),
                workingHours       = new TimeSpan(Convert.ToInt32(x.workingTime.Substring(0, 2)), Convert.ToInt32(x.workingTime.Substring(3, 2)), 0),
                workingHoursString = x.workingTime,
                earlyString        = x.OL_D,
                latenessString     = x.OL_A
            }));
            atts.ForEach(x => { x.DOW = GetGlobalResourceObject("Common", x.Date.DayOfWeek.ToString() + "Text").ToString(); x.DateString = x.Date.ToString(_systemService.SessionHelper.GetDateformat(), CultureInfo.CurrentUICulture); });


            DailyAttendance h = new DailyAttendance();

            h.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            h.DataSource        = atts;


            h.Parameters["From"].Value = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            h.Parameters["To"].Value   = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            h.Parameters["User"].Value = _systemService.SessionHelper.GetCurrentUser();
            if (resp.Items.Count > 0)
            {
                if (req.Parameters["_employeeId"] != "0")
                {
                    h.Parameters["Employee"].Value = resp.Items[0].name;
                }
                else
                {
                    h.Parameters["Employee"].Value = GetGlobalResourceObject("Common", "All");
                }
            }
            h.CreateDocument();


            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(h);
        }
Example #30
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            //ReportCompositeRequest req = GetRequest();

            //ListResponse<Model.Reports.RT102A> resp = _reportsService.ChildGetAll<Model.Reports.RT102A>(req);
            //if (!resp.Success)
            //{
            //    if (throwException)
            //        throw new Exception(resp.Summary);
            //    else
            //    {
            //        X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
            //       Common.errorMessage(resp);
            //        return;
            //    }
            //}
            //resp.Items.ForEach(x => x.DateString = x.date.ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en")));
            //Hirings h = new Hirings();


            //h.RightToLeft = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            //h.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;
            //h.DataSource = resp.Items;



            string rep_params        = vals.Text;
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = rep_params;

            ListResponse <Model.Reports.RT102B> resp = _reportsService.ChildGetAll <Model.Reports.RT102B>(req);

            if (!resp.Success)
            {
                Common.ReportErrorMessage(resp, GetGlobalResourceObject("Errors", "Error_1").ToString(), GetGlobalResourceObject("Errors", "ErrorLogId").ToString());
            }
            resp.Items.ForEach(x => x.DateString = x.date.ToString(_systemService.SessionHelper.GetDateformat()));

            //string from = DateTime.Parse(req.Parameters["_fromDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            //string to = DateTime.Parse(req.Parameters["_toDate"]).ToString(_systemService.SessionHelper.GetDateformat());
            string user = _systemService.SessionHelper.GetCurrentUser();


            Dictionary <string, string> parameters = Web.UI.Forms.Common.FetchReportParameters(texts.Text);

            Terminations t = new Terminations(parameters);

            t.RightToLeft       = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeft.Yes : DevExpress.XtraReports.UI.RightToLeft.No;
            t.RightToLeftLayout = _systemService.SessionHelper.CheckIfArabicSession() ? DevExpress.XtraReports.UI.RightToLeftLayout.Yes : DevExpress.XtraReports.UI.RightToLeftLayout.No;


            t.Parameters["User"].Value = user;
            //t.Parameters["BranchName"].Value = jobInfo1.GetBranch();

            //   t.Parameters["DepartmentName"].Value = jobInfo1.GetDepartment();
            t.DataSource = resp.Items;
            //if (resp.Items.Count > 0)
            //{
            //    if (req.Parameters["_departmentId"] != "0")
            //        t.Parameters["DepartmentName"].Value = resp.Items[0].departmentName;
            //    else
            //        t.Parameters["DepartmentName"].Value = GetGlobalResourceObject("Common", "All");

            //    if (req.Parameters["_branchId"] != "0")
            //        t.Parameters["BranchName"].Value = resp.Items[0].branchName;
            //    else
            //        t.Parameters["BranchName"].Value = GetGlobalResourceObject("Common", "All");
            //}

            t.CreateDocument();

            //h.Pages.AddRange(t.Pages);
            t.CreateDocument();
            ASPxWebDocumentViewer1.DataBind();
            ASPxWebDocumentViewer1.OpenReport(t);
        }