public ActionResult CreateAWC(NewAWC _newawc) { SPCreateAWC_Result Data = new SPCreateAWC_Result(); try { if (ModelState.IsValid) { _newawc.UserCode = Session["UserCode"].ToString(); var _loginBuss = new LoginBusiness(); Data = _awcBuss.CreateAWC(_newawc); return(Json(Data, JsonRequestBehavior.AllowGet)); } else { Data = new SPCreateAWC_Result() { Code = "001", Message = "Please fill All the fields", AWCCode = 0 }; return(Json(Data, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { Data = new SPCreateAWC_Result() { Code = "001", Message = ex.Message.ToString(), AWCCode = 0 }; return(Json(Data, JsonRequestBehavior.AllowGet)); } }
public SPCreateAWC_Result CreateAWC(NewAWC _newawc) { try { using (var db = new DBEntities()) { var Data = db.SPCreateAWC(_newawc.Center, _newawc.MobileNo, _newawc.Email, _newawc.Address, _newawc.AWCType, _newawc.StateID, _newawc.DistrictID, _newawc.ProjectID, _newawc.SectorID, Convert.ToInt32(_newawc.UserCode)).FirstOrDefault(); return(Data); } } catch (Exception ex) { throw null; } }
public SPCreateAWC_Result CreateAWC(NewAWC _newawc) { return(_awcData.CreateAWC(_newawc)); }