public ActionResult CostResult(int id) { CreateZakazViewModel model = new CreateZakazViewModel(); model.Cost = (int)dataManager.PricesRepository.GetPricesById(id).Цена; return View(model); }
public ActionResult Index(CreateZakazViewModel model) { if (ModelState.IsValid) { dataManager.ZakazyRepository.CreateZakaz(0, model.uslId, model.NumberOfDogovor, model.Cost); return RedirectToAction("ZakazOfDogovor", "Zakaz", new { id = model.NumberOfDogovor }); } model.SpisokUslug = from usl in dataManager.PricesRepository.GetPrices().OrderBy(x => x.Наименование) select new SelectListItem { Text = usl.Наименование, Value = usl.Код_услуги.ToString() }; return View(model); }
public ActionResult UslugiType(string id) { CreateZakazViewModel model = new CreateZakazViewModel(); model.SpisokUslug = from usl in dataManager.PricesRepository.GetPrices().OrderBy(x => x.Наименование).Where(z=>z.Тип==id) select new SelectListItem { Text = usl.Наименование, Value = usl.Код_услуги.ToString() }; return View(model); }
public ActionResult Index(int id, bool newdogovor) { //создадим пустой договор if (newdogovor) { string name = System.Web.HttpContext.Current.User.Identity.Name.ToString(); //получим по логину код сотрудника!!!!!!!!!!!!!!!!!!!!!!!!!!!! int Kod = dataManager.UsersRepository.GetRegisterUser().Where(x => x.Логин == name).FirstOrDefault().Код_сотрудника; dataManager.DogovorRepository.CreateDogovora(0, Kod, id, DateTime.Now, DateTime.Now.AddDays(3), 0, "к оплате", "нет"); } CreateZakazViewModel model = new CreateZakazViewModel(); model.NumberOfDogovor = dataManager.DogovorRepository.GetDogovora().OrderBy(x => x.Номер_договора).Last().Номер_договора; //заполняем список для выпадающего списка model.SpisokType = from usl in dataManager.PricesRepository.GetPrices().OrderBy(x => x.Тип).GroupBy(t => t.Тип) select new SelectListItem { Text = usl.Key, Value = usl.Key }; return View(model); }