public ActionResult DeleteConfirmed(int id) { GEU gEU = db.GEUs.Find(id); db.GEUs.Remove(gEU); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Director,Doverennost,IngenerPTO,IngenerOEGF,EU")] GEU gEU) { if (ModelState.IsValid) { db.Entry(gEU).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gEU)); }
public ActionResult Create([Bind(Include = "Id,Name,Director,Doverennost,IngenerPTO")] GEU gEU) { if (ModelState.IsValid) { db.GEUs.Add(gEU); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gEU)); }
public ActionResult OtchetMonth(FormCollection form) { string Month = form["Month"].ToString(); string GEU = form["GEU"].ToString(); string Year = form["Year"].ToString(); string Adres = form["Adres"].ToString(); string Prikaz = ""; int Y = Convert.ToInt16(Year);//год в цифру //string geu = GEU.Replace(" ", ""); string s = GEU.Replace(" ", ""); int A = 0; try { A = db.Adres.Where(x => x.Adress.Replace(" ", "").Equals(Adres.Replace("-", ""))).First().Id;//ищем айдишник адреса в ДБ } catch { A = 0; } GEU GeuIsBasi = db.GEUs.Where(x => x.Name.Replace(" ", "").Equals(s)).First(); if (Request.Form["b1"] != null) { int m = 0; Obratno(Month, out m); IEnumerable <VipolnennieUslugi> vu = db.VipolnennieUslugis; List <VipolnennieUslugi> ww = db.VipolnennieUslugis.Where(x => x.Date.Year == Y && x.Date.Month == m && x.AdresId == A).Include(y => y.Usluga.Periodichnost).Include(f => f.Usluga).ToList(); ViewBag.patch = GEU.Replace("-", ""); if (ww.Count == 0) { ViewBag.Adres = Adres; ViewBag.GEU = GEU.Replace("-", ""); ViewBag.Month = Month; ViewBag.Year = Year; return(View("Error")); } string path = Server.MapPath("~/" + "АКТ_" + GEU + ".xlsx");//Server.MapPath("~/" + "АКТ_" + GEU + ".xlsx");"C:\\inetpub\\Otchets\\" + "АКТ_" + GEU + ".xlsx"; ViewBag.path = path; decimal Summa = 0; foreach (VipolnennieUslugi V in ww) { Summa += V.StoimostNaMonth; } ExcelExportDomVipolnennieUslugi.EXPORT(ww, Month, GEU.Replace("-", ""), Year, Adres, GeuIsBasi.Director, GeuIsBasi.Doverennost, path, Summa.ToString()); return(View()); } return(View()); }
// GET: GEUs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GEU gEU = db.GEUs.Find(id); if (gEU == null) { return(HttpNotFound()); } return(View(gEU)); }