public ClientRevenueQueryOptions(ScopeOptions scope, string sortColumn, string sortDirection, int pageSize, int pageNumber, string filters = null)
            : base(sortColumn, sortDirection, pageSize, pageNumber, filters)
        {
            Scope = scope;

            BranchId     = new List <Guid>();
            UserId       = new List <Guid>();
            PolicyTypeId = new List <Guid>();

            //Defaults
            var lastMonth = DateTime.UtcNow.AddMonths(-1);

            YearEnding  = lastMonth.Year;
            MonthEnding = lastMonth.Month;

            var result = GetFilterValue <int>("YearEnding");

            if (result.Success)
            {
                YearEnding = result.Value;
            }

            result = GetFilterValue <int>("MonthEnding");
            if (result.Success)
            {
                MonthEnding = result.Value;
            }

            var resultString = GetFilterValue <string>("ClientLastName");

            if (resultString.Success)
            {
                ClientLastName = resultString.Value;
            }

            var resultGuids = GetFilterValues <Guid>("BranchId");

            if (resultGuids.Success)
            {
                BranchId = resultGuids.Value;
            }

            resultGuids = GetFilterValues <Guid>("UserId");
            if (resultGuids.Success)
            {
                UserId = resultGuids.Value;
            }

            resultGuids = GetFilterValues <Guid>("PolicyTypeId");
            if (resultGuids.Success)
            {
                PolicyTypeId = resultGuids.Value;
            }

            //Set start and end dates
            var date = new DateTime(YearEnding, MonthEnding, 1);

            EndDate   = date.LastDayOfMonth();
            StartDate = EndDate.AddYears(-1);
        }
Exemple #2
0
        internal void SetRange(string range)
        {
            switch (range)
            {
            case "OneMonth":
                StartDate = EndDate.AddMonths(-1);
                break;

            case "ThreeMonth":
                StartDate = EndDate.AddMonths(-3);

                break;

            case "SixMonth":
                StartDate = EndDate.AddMonths(-6);
                break;

            case "YTD":
                int count    = StockPriceDetails.Count;
                var dateTime = StockPriceDetails[count - 1].Date;
                EndDate   = dateTime;
                StartDate = new DateTime(dateTime.Year, 1, 1);
                break;

            case "OneYear":
                StartDate = EndDate.AddYears(-1);
                break;

            default:
                int count2 = StockPriceDetails.Count;
                StartDate = StockPriceDetails[0].Date;
                EndDate   = StockPriceDetails[count2 - 1].Date;
                break;
            }
        }
 private void RefreshDates()
 {
     EndDate     = DateTime.Now;
     InitDate    = EndDate.AddYears(-1);
     MinimumDate = EndDate.AddYears(-1);
     MaximumDate = DateTime.Now;
 }
Exemple #4
0
        public void Init()
        {
            var para = Remark.Split('|');

            MemberCardNo = !string.IsNullOrEmpty(para[0]) ? para[0] : string.Empty;

            if (para.Length > 1)
            {
                AlterMethod = !string.IsNullOrEmpty(para[1]) ? para[1] : string.Empty;
            }
            else
            {
                AlterMethod = string.Empty;
            }

            DateTime date;

            if (!string.IsNullOrEmpty(Size) && DateTime.TryParse(Size, out date))
            {
                EndDate = date;
            }
            else
            {
                throw new Exception("Can't get EndDate of OrdrItmMemShip.Size");
            }

            Season = $"{EndDate.AddYears(-1).Year}/{EndDate.ToString("yy")}";
        }
        public ServicesHistoryPageViewModel(IApiService apiService, IDialogService dialogService, ILoginViewModel loginViewModel, INavigationService navigationService, IPhoneService phoneService, IValidatorService validatorService, IPermissionService permissionService)
        {
            EndDate     = DateTime.Now;
            InitDate    = EndDate.AddYears(-1);
            MaximumDate = DateTime.Now;

            IsCO = AppConfigurations.Brand == "emi";
            IsUY = AppConfigurations.Brand == "ucm";

            Cities           = new ObservableCollection <City>();
            Doctors          = new ObservableCollection <Doctor>();
            Services         = new ObservableCollection <ServicesType>();
            ServicesHistory  = new ObservableCollection <ServiceHistoryViewModel>();
            Specialities     = new ObservableCollection <Speciality>();
            Minors           = new ObservableCollection <Minor>();
            IsVisiblePatient = false;

            this.apiService        = apiService;
            this.dialogService     = dialogService;
            this.loginViewModel    = loginViewModel;
            this.navigationService = navigationService;
            this.phoneService      = phoneService;
            this.validatorService  = validatorService;
            this.permissionService = permissionService;
        }
        protected void ButtonShowReport_Click(object sender, EventArgs e)
        {
            string   CustomerId, LocationName, ReportName, DataSetName, URL;
            DateTime StartDate, EndDate, StartDate1, EndDate1, StartDate2, EndDate2, StartDate3, EndDate3;


            StartDate = CalendarControlStartPeriod.SelectedDate;
            EndDate   = CalendarControlEndPeriod.SelectedDate;
            if (BulletedListDateSelection.SelectedValue == "Today")
            {
                StartDate = Common.CurrentClientDate(Session);
                EndDate   = Common.CurrentClientDate(Session);
            }
            if (BulletedListDateSelection.SelectedValue == "Yesterday")
            {
                StartDate = Common.CurrentClientDate(Session).AddDays(-1);
                EndDate   = Common.CurrentClientDate(Session).AddDays(-1);
            }
            if (BulletedListDateSelection.SelectedValue == "ThisMonth")
            {
                DateTime BaseDate = new DateTime(Common.CurrentClientDate(Session).Year, Common.CurrentClientDate(Session).Month, 1);
                StartDate = BaseDate;
                EndDate   = BaseDate.AddMonths(1).AddDays(-1);
            }
            if (BulletedListDateSelection.SelectedValue == "PreviousMonth")
            {
                DateTime BaseDate = new DateTime(Common.CurrentClientDate(Session).Year, Common.CurrentClientDate(Session).Month, 1);
                StartDate = BaseDate.AddMonths(-1);
                EndDate   = BaseDate.AddDays(-1);
            }
            if (BulletedListDateSelection.SelectedValue == "ThisYear")
            {
                StartDate = new DateTime(Common.CurrentClientDate(Session).Year, 1, 1);
                EndDate   = Common.CurrentClientDate(Session);
            }
            if (BulletedListDateSelection.SelectedValue == "All")
            {
                StartDate = new DateTime(2000, 1, 1);
                EndDate   = new DateTime(2100, 1, 1);
            }
            StartDate1 = StartDate.AddYears(-1);
            EndDate1   = EndDate.AddYears(-1);
            StartDate2 = StartDate.AddYears(-2);
            EndDate2   = EndDate.AddYears(-2);
            StartDate3 = StartDate.AddYears(-3);
            EndDate3   = EndDate.AddYears(-3);

            LocationName = ComboBoxSelectedLocation.Text;

            CustomerId = "";
            if (RadioButtonListCustomerSelection.SelectedValue == "Select")
            {
                CustomerId = ComboBoxCustomerSelection.SelectedValue;
            }

            ReportName  = "";
            DataSetName = "";
            switch (RadioButtonListReportType.SelectedValue)
            {
            case "All":
                ReportName  = "ReportComparisonTotals";
                DataSetName = "DataSetComparisonTotals";
                break;

            case "Material":
                ReportName  = "ReportComparisonMaterialTotals";
                DataSetName = "DataSetComparisonMaterialTotals";
                break;

            case "Customer":
                ReportName  = "ReportComparisonCustomerTotals";
                DataSetName = "DataSetComparisonCustomerTotals";
                break;
            }

            // load up the iframe
            URL = "WebFormPopup.aspx?UC=ShowReport&d=" + DataSetName +
                  "&r=" + ReportName +
                  "&CustomerId=" + CustomerId +
                  "&LocationName=" + LocationName +
                  "&StartDate=" + StartDate.ToString() +
                  "&EndDate=" + EndDate.ToString() +
                  "&StartDate1=" + StartDate1.ToString() +
                  "&EndDate1=" + EndDate1.ToString() +
                  "&StartDate2=" + StartDate2.ToString() +
                  "&EndDate2=" + EndDate2.ToString() +
                  "&StartDate3=" + StartDate3.ToString() +
                  "&EndDate3=" + EndDate3.ToString();
            LabelURL.Text = URL;
            FrameShowReport.Attributes["src"] = URL;
        }
Exemple #7
0
        public bool IsCurrentSeason(int year = 0)
        {
            var date = DateTime.Now.AddYears(year);

            return(EndDate.AddYears(-1) <= date && EndDate >= date);
        }