Esempio n. 1
0
        protected void reportStore_ReadData(object sender, StoreReadDataEventArgs e)
        {
            ReportCompositeRequest req = new ReportCompositeRequest();

            req.Size    = "1000";
            req.StartAt = "0";
            req.SortBy  = "departmentName";
            ListResponse <Model.Reports.RT01> resp = _reportsService.ChildGetAll <Model.Reports.RT01>(req);

            if (!resp.Success)
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(resp);
                return;
            }
            List <object> l = new List <object>();


            l.Add(new { id = GetLocalResourceObject("age00_18").ToString(), count = resp.Items.Sum(x => x.age00_18) });
            l.Add(new { id = GetLocalResourceObject("age18_25").ToString(), count = resp.Items.Sum(x => x.age18_25) });
            l.Add(new { id = GetLocalResourceObject("age26_30").ToString(), count = resp.Items.Sum(x => x.age26_30) });
            l.Add(new { id = GetLocalResourceObject("age30_40").ToString(), count = resp.Items.Sum(x => x.age30_40) });
            l.Add(new { id = GetLocalResourceObject("age40_50").ToString(), count = resp.Items.Sum(x => x.age40_50) });
            l.Add(new { id = GetLocalResourceObject("age50_60").ToString(), count = resp.Items.Sum(x => x.age50_60) });
            l.Add(new { id = GetLocalResourceObject("age60_99").ToString(), count = resp.Items.Sum(x => x.age60_99) });
            summaryStore.DataSource = l;
            summaryStore.DataBind();
            reportStore.DataSource = resp.Items;
            reportStore.DataBind();
        }
Esempio n. 2
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            int    id   = Convert.ToInt32(e.ExtraParams["id"]);
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgAttach":
                //panelRecordDetails.ActiveIndex = 0;

                ReportCompositeRequest comp = new ReportCompositeRequest();
                comp.Add(GetActivePreferance());
                comp.Add(new MissingFieldParameterSet()
                {
                    fieldId = id.ToString()
                });

                ListResponse <RT107B> resp = _reportService.ChildGetAll <RT107B>(comp);
                if (!resp.Success)
                {
                    Common.errorMessage(resp);
                    return;
                }
                employeesStore.DataSource = resp.Items;
                employeesStore.DataBind();
                Viewport1.ActiveIndex = 1;

                break;



            default:
                break;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Adding new record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>


        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            //GEtting the filter from the page
            string filter     = string.Empty;
            int    totalCount = 1;

            ReportCompositeRequest req = new ReportCompositeRequest();


            req.Add(GetActivePreferance());

            //Fetching the corresponding list

            //in this test will take a list of News


            ListResponse <Model.Reports.RT107> branches = _reportService.ChildGetAll <Model.Reports.RT107>(req);

            if (!branches.Success)
            {
                X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", branches.ErrorCode) != null ? GetGlobalResourceObject("Errors", branches.ErrorCode).ToString() : branches.Summary).Show();
                return;
            }
            this.Store1.DataSource = branches.Items;
            e.Total = branches.count;

            this.Store1.DataBind();
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        private ReportCompositeRequest GetRequest()
        {
            ReportCompositeRequest request = new ReportCompositeRequest();

            request.Size    = "1000";
            request.StartAt = "0";


            return(request);
        }
Esempio n. 6
0
        private ReportCompositeRequest GetRequest()
        {
            ReportCompositeRequest req = new ReportCompositeRequest();

            req.Size    = "1000";
            req.StartAt = "0";

            req.Add(jobInfo1.GetJobInfo());


            return(req);
        }
Esempio n. 7
0
        private ReportCompositeRequest GetRequest()
        {
            ReportCompositeRequest req = new ReportCompositeRequest();

            req.Size    = "1000";
            req.StartAt = "0";


            req.Add(dateRange1.GetRange());
            req.Add(employeeCombo1.GetEmployee());
            return(req);
        }
Esempio n. 8
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);
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportCompositeRequest req = GetRequest();

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



            SalaryHistory h = new SalaryHistory(new Dictionary <string, string> (), "");

            h.DataSource = resp.Items;

            ASPxWebDocumentViewer1.OpenReport(h);
        }
Esempio n. 10
0
        private ReportCompositeRequest GetRequest()
        {
            ReportCompositeRequest req = new ReportCompositeRequest();

            req.Size    = "1000";
            req.StartAt = "0";
            req.SortBy  = "eventDt";


            req.Add(dateRange1.GetRange());


            //req.Add();
            return(req);
        }
Esempio n. 11
0
        private ReportCompositeRequest GetRequest()
        {
            ReportCompositeRequest req = new ReportCompositeRequest();

            req.Size    = "1000";
            req.StartAt = "0";
            req.SortBy  = "firstName";
            JobInfoParameterSet p = GetJobInfo();

            req.Add(p);

            ActiveStatusParameterSet s = new ActiveStatusParameterSet();

            s.active = DropDownList1.SelectedIndex;
            req.Add(s);
            return(req);
        }
Esempio n. 12
0
        private ReportCompositeRequest GetRequest()
        {
            ReportCompositeRequest request = new ReportCompositeRequest();

            request.Size    = "1000";
            request.StartAt = "0";
            request.SortBy  = "hireDate";
            request.Add(jobInfo1.GetJobInfo());
            request.Add(activeControl.GetActiveStatus());
            request.Add(GetCountryInfo());
            request.Add(employeeFilter.GetEmployee());
            request.Add(GetGenderFilter());
            request.Add(GetSponserFilter());
            request.Add(GetLocalsFilter());



            return(request);
        }
Esempio n. 13
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();
        }
Esempio n. 14
0
        protected void Unnamed_Event(object sender, DirectEventArgs e)
        {
            ReportCompositeRequest request = GetRequest();

            if (string.IsNullOrEmpty(e.ExtraParams["week"]))
            {
                return;
            }
            string   week           = e.ExtraParams["week"];
            int      year           = Convert.ToInt32(week.Split('-')[0]);
            int      weekNo         = Convert.ToInt32(week.Split('-')[1]);
            DateTime d              = FirstDateOfWeekISO8601(year, weekNo);
            DateTime dF             = d.AddDays(6);
            DateRangeParameterSet r = new DateRangeParameterSet();

            r.DateFrom = d;
            r.DateTo   = dF;
            r.IsDayId  = true;
            request.Add(r);
            ListResponse <Model.Reports.RT304> resp = _reportsService.ChildGetAll <Model.Reports.RT304>(request);

            if (!resp.Success)
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(resp);
                return;
            }
            if (resp.Items.Count > 0)
            {
                DisplayResult(resp.Items);
            }
            else
            {
                firstStore.DataSource = new List <departmentAvailability>();
                firstStore.DataBind();
            }
        }
Esempio n. 15
0
 protected void firstStore_ReadData(object sender, StoreReadDataEventArgs e)
 {
     ReportCompositeRequest requst = GetRequest();
 }
Esempio n. 16
0
        private void FillReport(bool isInitial = false, bool throwException = true)
        {
            ReportCompositeRequest req = GetRequest();

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

            if (!resp.Success)
            {
                if (throwException)
                {
                    throw new Exception(resp.Error + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId + "</br>");
                }
                else
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(resp);
                    return;
                }
            }

            resp.Items.ForEach(x =>
            {
                DateTime date     = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en"));
                x.dateString      = date.ToString(_systemService.SessionHelper.GetDateformat());
                x.dowString       = GetGlobalResourceObject("Common", date.DayOfWeek.ToString() + "Text").ToString();
                x.specialTasks    = x.jobTasks = "00:00";
                x.specialTasks    = x.unpaidLeaves;
                x.jobTasks        = x.paidLeaves;
                x.dayStatusString = GetLocalResourceObject("status" + x.dayStatus.ToString()).ToString();
                //if (x.workingHours != "00:00")
                //{

                //    x.unpaidLeaves = "00:00";
                //    x.jobTasks = x.paidLeaves;
                //    x.paidLeaves = "00:00";
                //    x.specialTasks = x.unpaidLeaves;

                //}
                //else
            }
                               );


            DayStatus h = new DayStatus();

            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.ParseExact(req.Parameters["_fromDayId"], "yyyyMMdd", new CultureInfo("en")).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string to   = DateTime.ParseExact(req.Parameters["_toDayId"], "yyyyMMdd", new CultureInfo("en")).ToString(_systemService.SessionHelper.GetDateformat(), new CultureInfo("en"));
            string user = _systemService.SessionHelper.GetCurrentUser();

            h.Parameters["FromParameter"].Value = from;
            h.Parameters["ToParameter"].Value   = to;
            h.Parameters["UserParameter"].Value = user;
            if (req.Parameters["_dayStatus"] != "0")
            {
                h.Parameters["dayStatusParameter"].Value = dayStatus.SelectedItem.Text;
            }
            else
            {
                h.Parameters["dayStatusParameter"].Value = GetGlobalResourceObject("Common", "All");
            }
            if (req.Parameters["_punchStatus"] != "0")
            {
                h.Parameters["punchStatus"].Value = punchStatus.SelectedItem.Text;
            }
            else
            {
                h.Parameters["punchStatus"].Value = GetGlobalResourceObject("Common", "All");
            }
            if (req.Parameters["_departmentId"] != "0")
            {
                h.Parameters["DepartmentName"].Value = jobInfo1.GetDepartment();
            }
            else
            {
                h.Parameters["DepartmentName"].Value = GetGlobalResourceObject("Common", "All");
            }



            //ListRequest def = new ListRequest();
            //int lateness = 0;
            //ListResponse<KeyValuePair<string, string>> items = _systemService.ChildGetAll<KeyValuePair<string, string>>(def);
            //try
            //{
            //    lateness = Convert.ToInt32(items.Items.Where(s => s.Key == "allowedLateness").First().Value);
            //}
            //catch
            //{

            //}
            //h.Parameters["AllowedLatenessParameter"].Value = lateness;

            h.PrintingSystem.Document.ScaleFactor = 4;
            h.CreateDocument();


            ASPxWebDocumentViewer1.OpenReport(h);
        }
Esempio n. 17
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);
        }