Пример #1
0
        public string GetResultFileName(SearchFilters searchFilters)
        {
            Log.Instance.Warn("---Begin: GetResultFileName");
            string   fileName = "";
            SiteBase site     = null;

            try
            {
                if (ModelState.IsValid)
                {
                    DbUpdates.PdfCreated(searchFilters, User.Identity.Name);

                    return(fileName = new Rates().GetPdfLocation(site, searchFilters));
                }
                else
                {
                    Log.Instance.Warn("---ModelState not Valid: GetResultFileName");

                    return("");
                }
            }
            catch (Exception ex)
            {
                Log.Instance.Error("--- " + ex.Message + "\n " + ex.InnerException + "\n" + ex.StackTrace);
                return("");
            }
        }
Пример #2
0
        public string InitiateDates(PricingModel searchFilters)
        {
            if (ModelState.IsValid)
            {
                DbUpdates.UpdatedRates(searchFilters, User.Identity.Name);

                PricingHelper pr = new PricingHelper(searchFilters,
                                                     allClasses.Where(s => s.LocationId == searchFilters.Location && s.IntervalNum == searchFilters.IntervalNum && searchFilters.Classes.FirstOrDefault().Contains(s.ClassName)).ToArray());

                return(pr.SetDates());
            }
            else
            {
                return("");
            }
        }
Пример #3
0
        public string GeneratePrices(PricingModel searchFilters)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    DbUpdates.UpdatedRates(searchFilters, User.Identity.Name);

                    PricingHelper pr = new PricingHelper(searchFilters,
                                                         allClasses.Where(s => s.LocationId == searchFilters.Location && s.IntervalNum == searchFilters.IntervalNum && searchFilters.Classes.FirstOrDefault().Contains(s.ClassName)).ToArray());
                    return(pr.Excecute());
                }
                else
                {
                    return("");
                }
            }
            catch (Exception ex)
            {
                Log.Instance.Error("--- " + ex.Message + "\n " + ex.InnerException + "\n" + ex.StackTrace);
                return("");
            }
        }