public static ResultSet CRUD(Cate cate, EntityState state) { using (AccDeficitEntities s = new AccDeficitEntities()) { s.Entry(cate).State = state; if (s.SaveChanges() > 0) { r.isSuccess = true; if (state == EntityState.Added) { r.Message = "Kategori sisteme başarıyla eklendi!"; } else if (state == EntityState.Modified) { r.Message = null; } else if (state == EntityState.Deleted) { r.Message = "Kategori silindi!"; } r.Cate = cate; r.iconType = IconType.ok; } else { r.isSuccess = false; r.Message = "Hata!!"; r.Cate = cate; r.iconType = IconType.warning; } return(r); } }
public static ResultSet CRUD(Signin sign, EntityState state) { using (AccDeficitEntities s = new AccDeficitEntities()) { s.Entry(sign).State = state; if (s.SaveChanges() > 0) { r.isSuccess = true; r.Message = "Şifre başarıyla değiştirildi!"; r.Signin = sign; r.iconType = IconType.ok; } else { r.isSuccess = false; r.Message = "Hata!!"; r.Signin = sign; r.iconType = IconType.warning; } return(r); } }
public static ResultSet CRUD(Orders ord, EntityState state) { using (AccDeficitEntities s = new AccDeficitEntities()) { s.Entry(ord).State = state; if (s.SaveChanges() > 0) { r.isSuccess = true; r.Message = "Satış kaydı eklendi!"; r.Order = ord; r.iconType = IconType.ok; } else { r.isSuccess = false; r.Message = "Hata!!"; r.Order = ord; r.iconType = IconType.warning; } return(r); } }