public JsonResult Edit(ReligiousFundVM vmObj) { var result = Mapper.Map <ReligiousFundType>(vmObj); result.IsActive = true; // int isUpdated = _Manager.Update(result); if (isUpdated > 0) { status = true; message = "Updated Successfully!!"; } else { status = false; message = "Error In Update!!"; } return(new JsonResult { Data = new { status = status, message = message } }); }
public JsonResult Create(ReligiousFundVM vmObj) { vmObj.CreatedBy = 1; vmObj.CreatedDate = DateTime.Now; vmObj.UpdatedBy = 1; vmObj.UpdatedDate = DateTime.Now; int isSaved = 0; if (ModelState.IsValid) { var result = Mapper.Map <ReligiousFundType>(vmObj); result.IsActive = true; isSaved = _Manager.Add(result); if (isSaved > 0) { status = true; message = "Succesfully Saved"; } else { status = true; message = "Error! Please try again."; } return(new JsonResult { Data = new { status = status, message = message } }); } else { status = false; message = "ReligiousFundType Allready Exsists !!!"; return(new JsonResult { Data = new { status = status, message = message } }); } }