public BaseController() { _userappservice = new UserAppService(); _roleappservice = new RoleAppService(); _settingdataservice = new SettingDataService(); _generalsettingservice = new GeneralSettingService(); _carihesapyetkiliORM = new CariHesapYetkiliORM(); _iliskiORM = new iliskierORM(); _iliskilerViewORM = new iliskilerViewORM(); _carihesapYetkiliORM = new CariHesapYetkiliORM(); _carihesapadresleriORM = new CariHesapAdresORM(); _carihesaplarORM = new CariHesaplarORM(); _hizmethesaplarORM = new HizmetHesapORM(); _stoklarORM = new StoklarORM(); _carihesaplarORM = new CariHesaplarORM(); _siparisORM = new SiparisORM(); _stoksatisFiyatORM = new StokSatisFiyatlariORM(); _evrakAciklamaORM = new EvrakAciklamaORM(); _viewproformaSiparisORM = new viewProformaSiparisORM(); _proformaSiparisORM = new ProformaSiparisORM(); _caripersonelTanimORM = new CariPersonelTanimlariORM(); _viewCustomerReportORM = new viewCustomerReportORM(); _myeTextDataOrm = new myeTextDataOrm(); _cleanderservice = new CleanderService(); _customersearchORM = new CustomerSearchORM(); _customerreportORM = new CustomerReportORM(); _bankahesaplarORM = new BankaHesaplarOrm(); _viewBankReportORM = new viewBankReportORM(); }
public ActionResult Detail(int Id = 0) { GeneralSettingModel generalSettingModel; generalSettingService = new GeneralSettingService(); generalSettingModel = generalSettingService.GetById(Id); return(View(VIEW_DETAIL, generalSettingModel)); }
public ActionResult DetailPartial(int Id = 0) { GeneralSettingModel generalSettingModel; generalSettingService = new GeneralSettingService(); generalSettingModel = generalSettingService.GetById(Id); return(PartialView(VIEW_FORM_PARTIAL, generalSettingModel)); }
public static GeneralSetting GeneralSettingData(this Controller h) { var userapp = (UserApp)HttpContext.Current.Session["UserAccount"]; GeneralSettingService _generalservice = new GeneralSettingService(); GeneralSetting set = _generalservice.Get(x => x.UserId == userapp.Id); if (set != null) { return(set); } else { set = new GeneralSetting(); set.DocSeri = "YS"; return(set); } }
public ActionResult Update([ModelBinder(typeof(DevExpressEditorsBinder))] GeneralSettingModel generalSettingModel) { generalSettingModel._UserId = (int)Session["userId"]; generalSettingService = new GeneralSettingService(); if (ModelState.IsValid) { generalSettingService.Update(generalSettingModel); generalSettingModel = generalSettingService.GetById(generalSettingModel.Id); } else { string message = GetErrorModel(); throw new Exception(string.Format("[VALIDATION] {0}", message)); } return(PartialView(VIEW_FORM_PARTIAL, generalSettingModel)); }
private Tuple <DateTime, DateTime> GetPeriod(PeriodFilterType period) { var settingsService = new GeneralSettingService(App.Db); var firstDayOfWeek = settingsService.GetForUser(user.Id).FirstDayOfWeek; DateTime from, until; int tmp1, tmp2; switch (period) { case PeriodFilterType.Today: from = DateTime.Today; until = DateTime.Today.AddDays(1).AddMinutes(-1); break; case PeriodFilterType.Yesterday: from = DateTime.Today.AddDays(-1); until = DateTime.Today.AddMinutes(-1); break; case PeriodFilterType.ThisWeek: tmp1 = (int)DateTime.Today.DayOfWeek; tmp2 = 0; while (tmp1 != (int)firstDayOfWeek) { if (tmp1 == 0) { tmp1 = (int)DayOfWeek.Saturday; } else { tmp1--; } tmp2++; } from = DateTime.Today.AddDays(-tmp2); until = DateTime.Today.AddDays(7 - tmp2).AddMinutes(-1); break; case PeriodFilterType.PreviousWeek: tmp1 = (int)DateTime.Today.DayOfWeek; tmp2 = 0; while (tmp1 != (int)firstDayOfWeek) { if (tmp1 == 0) { tmp1 = (int)DayOfWeek.Saturday; } else { tmp1--; } tmp2++; } from = DateTime.Today.AddDays(-tmp2 - 7); until = DateTime.Today.AddDays(-tmp2).AddMinutes(-1); break; case PeriodFilterType.ThisMonth: from = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); until = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month)).AddDays(1).AddMinutes(-1); break; case PeriodFilterType.PreviousMonth: tmp1 = DateTime.Today.Month > 1 ? DateTime.Today.Year : DateTime.Today.Year - 1; tmp2 = DateTime.Today.Month > 1 ? DateTime.Today.Month - 1 : 12; from = new DateTime(tmp1, tmp2, 1); until = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMinutes(-1); break; case PeriodFilterType.ThisYear: from = new DateTime(DateTime.Today.Year, 1, 1); until = new DateTime(DateTime.Today.Year + 1, 1, 1).AddMinutes(-1); break; case PeriodFilterType.PreviousYear: from = new DateTime(DateTime.Today.Year - 1, 1, 1); until = new DateTime(DateTime.Today.Year, 1, 1).AddMinutes(-1); break; default: var rand = new Random(); from = DateTime.Today.AddDays(-rand.Next(365)); until = DateTime.Today.AddDays(rand.Next(365)); break; } return(new Tuple <DateTime, DateTime>(from, until)); }
private List <Record> CreateRecords(PeriodFilterType period, RecordType recordType, Action <Record> overrides = null) { var settingsService = new GeneralSettingService(App.Db); var firstDayOfWeek = settingsService.GetForUser(user.Id).FirstDayOfWeek; DateTime from, until; int tmp1, tmp2; switch (period) { case PeriodFilterType.Today: from = DateTime.Today; until = DateTime.Today.AddDays(1).AddMinutes(-1); break; case PeriodFilterType.Yesterday: from = DateTime.Today.AddDays(-1); until = DateTime.Today.AddMinutes(-1); break; case PeriodFilterType.ThisWeek: tmp1 = (int)DateTime.Today.DayOfWeek; tmp2 = 0; while (tmp1 != (int)firstDayOfWeek) { tmp1--; tmp2++; } from = DateTime.Today.AddDays(-tmp2); until = DateTime.Today.AddDays(7 - tmp2).AddMinutes(-1); break; case PeriodFilterType.PreviousWeek: tmp1 = (int)DateTime.Today.DayOfWeek; tmp2 = 0; while (tmp1 != (int)firstDayOfWeek) { tmp1--; tmp2++; } from = DateTime.Today.AddDays(-tmp2 - 7); until = DateTime.Today.AddDays(-tmp2).AddMinutes(-1); break; case PeriodFilterType.ThisMonth: from = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); until = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month)).AddDays(1).AddMinutes(-1); break; case PeriodFilterType.PreviousMonth: tmp1 = DateTime.Today.Month > 1 ? DateTime.Today.Year : DateTime.Today.Year - 1; tmp2 = DateTime.Today.Month > 1 ? DateTime.Today.Month - 1 : 12; from = new DateTime(tmp1, tmp2, 1); until = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).AddMinutes(-1); break; case PeriodFilterType.ThisYear: from = new DateTime(DateTime.Today.Year, 1, 1); until = new DateTime(DateTime.Today.Year + 1, 1, 1).AddMinutes(-1); break; case PeriodFilterType.PreviousYear: from = new DateTime(DateTime.Today.Year - 1, 1, 1); until = new DateTime(DateTime.Today.Year, 1, 1).AddMinutes(-1); break; default: var rand = new Random(); from = DateTime.Today.AddDays(-rand.Next(365)); until = DateTime.Today.AddDays(rand.Next(365)); break; } return(App.Factory.CreateRecords(user.Id, from, until, record => { record.RecordType = recordType; overrides?.Invoke(record); })); }
public GeneralSettingController() { _generalSettingService = new GeneralSettingService(); }