public JsonResult AddNewAssetDetails(AssetDetailsModel assetDetailsModel) { string message = ""; string Emp_id = ""; if (ModelState.IsValid) { var isExist = AssetAlreadyExist(assetDetailsModel.AssetId_unique); var SerialExist = AssetAlreadyExist(assetDetailsModel.SerialNo); var CheckEmployeeExist = Employee_Exist(assetDetailsModel.EmpId); if (isExist == false || SerialExist == false) { message = "Asset Already Exist"; } else if (CheckEmployeeExist == true) { message = "Employee Not Exist in GMDA !!"; } else if (isExist == true || SerialExist == true) { Emp_id = repositories.AddNewAsset(assetDetailsModel); if (Emp_id != null) { ModelState.Clear(); message = "Asset Added Successfully"; //return Json(new { message=message},JsonRequestBehavior.AllowGet); } } } return(Json(new { message = message, Emp_id = Emp_id }, JsonRequestBehavior.AllowGet)); }