public JsonResult Deactivate_Api(FeeAccount account) { FeeAccount accountEdit = db.FeeAccount.Where(b => b.AccountId == account.AccountId).FirstOrDefault(); accountEdit.IsDelete = true; if (db.SaveChanges() == 1) { return(Json(1, JsonRequestBehavior.AllowGet)); } else { return(Json(0, JsonRequestBehavior.AllowGet)); } }
public JsonResult Update_Api(FeeAccount account) { FeeAccount accountEdit = db.FeeAccount.Where(b => b.AccountId == account.AccountId).FirstOrDefault(); accountEdit.Username = account.Username; accountEdit.Password = account.Password; accountEdit.IsDelete = account.IsDelete; accountEdit.RoleId = account.RoleId; if (db.SaveChanges() == 1) { return(Json(1, JsonRequestBehavior.AllowGet)); } else { return(Json(0, JsonRequestBehavior.AllowGet)); } }
public JsonResult Create_Api(FeeAccount account) { try { db.FeeAccount.Add(account); if (db.SaveChanges() == 1) { return(Json(1, JsonRequestBehavior.AllowGet)); } else { return(Json(0, JsonRequestBehavior.AllowGet)); } } catch (Exception e) { return(Json(e.Message, JsonRequestBehavior.AllowGet)); } }