Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,Name,Ploshad,Teplota,Teplota12,HotWater,ColdWater,Date")] Arendator arendator)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arendator).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId = new SelectList(db.Adres, "Id", "Adress", arendator.AdresId);
     return(View(arendator));
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutWork(int id, Work work)
        {
            if (id != work.Id)
            {
                return(BadRequest());
            }

            _context.Entry(work).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WorkExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "Id,Type,Summ")] TableService tableService)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tableService).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tableService));
 }
Ejemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "Id,Uteplenie")] FasadUteplenie fasadUteplenie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fasadUteplenie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fasadUteplenie));
 }
Ejemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "ProjectID,Name,Description")] Project project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(project));
 }
Ejemplo n.º 6
0
        public IActionResult Work(int id)
        {
            var item = _workContext.works.Find(id);

            if (item == null)
            {
                return(null);
            }
            //显式加载
            _workContext.Entry(item).Collection(w => w.imgs).Load(); //加载集合使用Collection方法
            _workContext.Entry(item).Reference(w => w.proj).Load();  //加载单个实体使用Reference方法
            //item.proj = _workContext.projects.Find(item.projId);
            //var query = from img in _workContext.imgs
            //            where img.wId == id
            //            select img;
            //item.imgs = query.ToList();
            item.imgs.ForEach(p => p.Src = p.Src.Replace("~", ".."));
            return(View(item));
        }
Ejemplo n.º 7
0
 public ActionResult Edit([Bind(Include = "Id,Type,Ico")] TypeAvto typeAvto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(typeAvto).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(typeAvto));
 }
Ejemplo n.º 8
0
 public ActionResult Edit([Bind(Include = "Id")] DOMVodootvod dOMVodootvod)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dOMVodootvod).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dOMVodootvod));
 }
Ejemplo n.º 9
0
 public ActionResult Edit([Bind(Include = "Id,Name,Date,AvtoID,Mesta,ObiemIn,ObiemOut,KgOut")] Musor musor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(musor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(musor));
 }
Ejemplo n.º 10
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Marshrut marshrut)
 {
     if (ModelState.IsValid)
     {
         db.Entry(marshrut).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(marshrut));
 }
Ejemplo n.º 11
0
 public ActionResult Edit([Bind(Include = "Id,Form")] RoofForm roofForm)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roofForm).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(roofForm));
 }
Ejemplo n.º 12
0
 public ActionResult Edit([Bind(Include = "Id,Type")] FundamentType fundamentType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fundamentType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fundamentType));
 }
Ejemplo n.º 13
0
 public ActionResult Edit([Bind(Include = "Id,HotWater,ColdWater,OtoplenieEnergy,TeplotaVKube,Date")] Tarif tarif)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tarif).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tarif));
 }
Ejemplo n.º 14
0
 public ActionResult Edit([Bind(Include = "Id,CodeOBSD")] Negilaya negilaya)
 {
     if (ModelState.IsValid)
     {
         db.Entry(negilaya).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(negilaya));
 }
Ejemplo n.º 15
0
 public ActionResult Edit([Bind(Include = "Id,PeriodichnostName")] Periodichnost periodichnost)
 {
     if (ModelState.IsValid)
     {
         db.Entry(periodichnost).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(periodichnost));
 }
Ejemplo n.º 16
0
 public ActionResult Edit([Bind(Include = "WorkId,Name,Group,Izmerenie,Code")] Work work)
 {
     if (ModelState.IsValid)
     {
         db.Entry(work).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(work));
 }
Ejemplo n.º 17
0
 public ActionResult Edit([Bind(Include = "Id,WhatToDo,Date")] Log log)
 {
     if (ModelState.IsValid)
     {
         db.Entry(log).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(log));
 }
Ejemplo n.º 18
0
 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));
 }
Ejemplo n.º 19
0
 public ActionResult Edit([Bind(Include = "Id,From,To,Text")] ChatMessage chatMessage)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chatMessage).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(chatMessage));
 }
Ejemplo n.º 20
0
 public ActionResult Edit([Bind(Include = "Id,Name,SNorm,WNorm,Toplivo,KmMoto,EzdkaPricep,NormaEzdka")] MarkaAvtomobil markaAvtomobil)
 {
     if (ModelState.IsValid)
     {
         db.Entry(markaAvtomobil).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(markaAvtomobil));
 }
Ejemplo n.º 21
0
 public ActionResult Edit([Bind(Include = "Id,StartWeek,UserId")] WorkWeek workWeek)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workWeek).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.UserId = new SelectList(db.Users, "Id", "Email", workWeek.UserId);
     return(View(workWeek));
 }
Ejemplo n.º 22
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,Name,KodUEV,Pribor,OtEnergyRub,OtEnergyGkal,HwEnergyRub,HwEnergyGkal,HwVodaRub,HwVodaM3,Date")] UEV uEV)
 {
     if (ModelState.IsValid)
     {
         db.Entry(uEV).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId = new SelectList(db.Adres, "Id", "Adress", uEV.AdresId);
     return(View(uEV));
 }
Ejemplo n.º 23
0
 public ActionResult Edit([Bind(Include = "Id,PeriodichnostId,Poryadok,Name")] Usluga usluga)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usluga).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PeriodichnostId = new SelectList(db.Periodichnosts, "Id", "PeriodichnostName", usluga.PeriodichnostId);
     return(View(usluga));
 }
Ejemplo n.º 24
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,OtopGkal,GWM3,HWM3,OtopRub,GWRub,HWRub,Primech,Date")] OPU oPU)
 {
     if (ModelState.IsValid)
     {
         db.Entry(oPU).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId = new SelectList(db.Adres, "Id", "Adress", oPU.AdresId);
     return(View(oPU));
 }
Ejemplo n.º 25
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,Electrovvods,RemontElectro,IznosElectro")] DOMElectro dOMElectro)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dOMElectro).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId = new SelectList(db.Adres, "Id", "Adress", dOMElectro.AdresId);
     return(View(dOMElectro));
 }
Ejemplo n.º 26
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,OtEnergyRub,OtEnergyGkal,NomerSchetchika,Date")] IPU iPU)
 {
     if (ModelState.IsValid)
     {
         db.Entry(iPU).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId = new SelectList(db.Adres, "Id", "Adress", iPU.AdresId);
     return(View(iPU));
 }
Ejemplo n.º 27
0
 public ActionResult Edit([Bind(Include = "Id,Name,IzmerenieId,Cost,DOMPartId")] OsmotrWork osmotrWork)
 {
     if (ModelState.IsValid)
     {
         db.Entry(osmotrWork).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DOMPartId   = new SelectList(db.DOMParts, "Id", "Name", osmotrWork.DOMPartId);
     ViewBag.IzmerenieId = new SelectList(db.Izmerenies, "Id", "Name", osmotrWork.IzmerenieId);
     return(View(osmotrWork));
 }
Ejemplo n.º 28
0
 public ActionResult Edit([Bind(Include = "Id,Date,AdresId,UslugaId,StoimostNaM2,StoimostNaMonth")] VipolnennieUslugi vipolnennieUslugi)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vipolnennieUslugi).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId  = new SelectList(db.Adres, "Id", "Adress", vipolnennieUslugi.AdresId);
     ViewBag.UslugaId = new SelectList(db.Usluga, "Id", "Name", vipolnennieUslugi.UslugaId);
     return(View(vipolnennieUslugi));
 }
Ejemplo n.º 29
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,IznosCW,MaterialCWId,RemontCW")] DOMCW dOMCW)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dOMCW).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId      = new SelectList(db.Adres, "Id", "Adress", dOMCW.AdresId);
     ViewBag.MaterialCWId = new SelectList(db.Materials, "Id", "Name", dOMCW.MaterialCWId);
     return(View(dOMCW));
 }
Ejemplo n.º 30
0
 public ActionResult Edit([Bind(Include = "Id,AdresId,TableServiceId,Nachislenie,Licevoi,Date")] OBSD oBSD)
 {
     if (ModelState.IsValid)
     {
         db.Entry(oBSD).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AdresId        = new SelectList(db.Adres, "Id", "Adress", oBSD.AdresId);
     ViewBag.TableServiceId = new SelectList(db.TableServices, "Id", "Type", oBSD.TableServiceId);
     return(View(oBSD));
 }