public ActionResult IsEmri_Update([DataSourceRequest] DataSourceRequest request, IsEmri IsEmri) { if (ModelState.IsValid) { using (var matbaa = new matbaaEntities()) { // Create a new Product entity and set its properties from the posted ProductViewModel var entity = new IsEmri { IsEmriId = IsEmri.IsEmriId, IsNo = IsEmri.IsNo, TarihSayi = IsEmri.TarihSayi, Adi = IsEmri.Adi, Birim = IsEmri.Birim, Personel = IsEmri.Personel, Telefon = IsEmri.Telefon, KabulTarihi = IsEmri.KabulTarihi, TeslimTarihi = IsEmri.TeslimTarihi, Aciklama = IsEmri.Aciklama, BirimId = IsEmri.BirimId, Silindi = IsEmri.Silindi.Value, IlgiliEPosta = IsEmri.IlgiliEPosta, IKBSBirimUN = IsEmri.IKBSBirimUN }; // Attach the entity matbaa.IsEmri.Attach(entity); // Change its state to Modified so Entity Framework can update the existing product instead of creating a new one matbaa.Entry(entity).State = EntityState.Modified; // Or use ObjectStateManager if using a previous version of Entity Framework // northwind.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified); // Update the entity in the database matbaa.SaveChanges(); } } // Return the updated product. Also return any validation errors. return Json(new[] {IsEmri}.ToDataSourceResult(request, ModelState)); }
public ActionResult IsEmri_Delete([DataSourceRequest] DataSourceRequest request, IsEmri IsEmri) { IsEmriniSilindiOlarakGuncelle(IsEmri.IsEmriId); return Json(new[] {IsEmri}.ToDataSourceResult(request, ModelState)); }