コード例 #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));
 }
コード例 #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());
        }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
        }
コード例 #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));
 }
コード例 #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));
 }
コード例 #9
0
ファイル: MusorsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #13
0
ファイル: TarifsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #16
0
ファイル: WorksController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #17
0
ファイル: LogsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #18
0
ファイル: GEUsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #24
0
ファイル: OPUsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #29
0
ファイル: DOMCWsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }
コード例 #30
0
ファイル: OBSDsController.cs プロジェクト: Nazgulator/GKHNNC
 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));
 }