public ActionResult InsertCallCategoryFromPopUp(CallCategory CallCategory) { try { CallCategory.CreateBy = AppUtils.GetLoginUserID(); CallCategory.CreateDate = AppUtils.GetDateTimeNow(); CallCategory.Status = AppUtils.TableStatusIsActive; db.CallCategory.Add(CallCategory); db.SaveChanges(); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }
public ActionResult DeleteCallCategory(int CallCategoryID) { CallCategory callCategory = new CallCategory(); callCategory = db.CallCategory.Find(CallCategoryID); callCategory.DeleteBy = AppUtils.GetLoginUserID(); callCategory.DeleteDate = AppUtils.GetDateTimeNow(); callCategory.Status = AppUtils.TableStatusIsDelete; db.Entry(callCategory).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); var JSON = Json(new { success = true }, JsonRequestBehavior.AllowGet); JSON.MaxJsonLength = int.MaxValue; return(JSON); }
public ActionResult UpdateCallCategory(CallCategory CallCategory) { try { CallCategory dbCallCategory = new CallCategory(); dbCallCategory = db.CallCategory.Find(CallCategory.CallCategoryID); dbCallCategory.CallCategoryName = CallCategory.CallCategoryName; dbCallCategory.UpdateBy = AppUtils.GetLoginUserID(); dbCallCategory.UpdateDate = AppUtils.GetDateTimeNow(); db.Entry(dbCallCategory).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); var JSON = Json(new { success = true }, JsonRequestBehavior.AllowGet); JSON.MaxJsonLength = int.MaxValue; return(JSON); } catch (Exception ex) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }