public ActionResult EditSpalni([Bind(Include = "Id,CatNumber,Color,Description,Price,Name,Razmeri,Type,SupplierId,ImageName")] EditIzdlieBindingModel model) { if (ModelState.IsValid) { this.service.EditSpalnq(model); return(this.RedirectToAction("Spalni")); } return(this.RedirectToAction("EditSpalni")); }
public void EditSpalnq(EditIzdlieBindingModel model) { Spalnq spalnq = this.Context.Spalni.Find(model.Id); spalnq.CatNumber = model.CatNumber; spalnq.Color = model.Color; spalnq.Description = model.Description; spalnq.NalichnostBr = model.NalichnostBr; spalnq.Name = model.Name; spalnq.Price = model.Price; spalnq.Razmeri = model.Razmeri; spalnq.Type = model.Type; if (model.ImageName != null && model.ImageName.ContentLength > 0) { using (var reader = new BinaryReader(model.ImageName.InputStream)) { spalnq.ImagePicture = reader.ReadBytes(model.ImageName.ContentLength); } } this.Context.SaveChanges(); }
public void EditMasi(EditIzdlieBindingModel model) { Masa masa = this.Context.Masi.Find(model.Id); masa.CatNumber = model.CatNumber; masa.Color = model.Color; masa.Description = model.Description; masa.NalichnostBr = model.NalichnostBr; masa.Name = model.Name; masa.Price = model.Price; masa.Razmeri = model.Razmeri; masa.Type = model.Type; if (model.ImageName != null && model.ImageName.ContentLength > 0) { using (var reader = new BinaryReader(model.ImageName.InputStream)) { masa.ImagePicture = reader.ReadBytes(model.ImageName.ContentLength); } } this.Context.SaveChanges(); }
public void EditPortmanta(EditIzdlieBindingModel model) { Portmanto portmanto = this.Context.Portmanta.Find(model.Id); portmanto.CatNumber = model.CatNumber; portmanto.Color = model.Color; portmanto.Description = model.Description; portmanto.NalichnostBr = model.NalichnostBr; portmanto.Name = model.Name; portmanto.Price = model.Price; portmanto.Razmeri = model.Razmeri; portmanto.Type = model.Type; if (model.ImageName != null && model.ImageName.ContentLength > 0) { using (var reader = new BinaryReader(model.ImageName.InputStream)) { portmanto.ImagePicture = reader.ReadBytes(model.ImageName.ContentLength); } } this.Context.SaveChanges(); }
public void EditSpalnq(EditIzdlieBindingModel model) { throw new NotImplementedException(); }
public void EditPortmanta(EditIzdlieBindingModel model) { throw new NotImplementedException(); }