public DataMessage Edit(EditFamily model) { DataMessage message; message = familyRepository.Edit(model); return(message); }
public DataMessage Edit(EditFamily model) { DataHelper helper = new DataHelper(Configuration); DataMessage message; SqlParameter[] sqlParameters = { new SqlParameter("@AuditUserID", UserId), new SqlParameter("@InsuranceNumberOfHead", model.HeadOfFamilyId), new SqlParameter("@VillageCode", model.VillageCode), new SqlParameter("@OtherNames", model.OtherName), new SqlParameter("@LastName", model.LastName), new SqlParameter("@BirthDate", model.BirthDate), new SqlParameter("@Gender", model.Gender), new SqlParameter("@PovertyStatus", model.PovertyStatus), new SqlParameter("@ConfirmationType", model.ConfirmationType), new SqlParameter("@GroupType", model.GroupType), new SqlParameter("@ConfirmationNumber", model.ConfrimationNo), new SqlParameter("@PermanentAddress", model.PermanentAddressDetails), new SqlParameter("@MaritalStatus", model.MaritalStatus), new SqlParameter("@BeneficiaryCard", model.BeneficiaryCard), new SqlParameter("@CurrentVillageCode", model.CurrentVillageCode), new SqlParameter("@CurrentAddress", model.CurrentAddressDetails), new SqlParameter("@Proffesion", model.Profession), new SqlParameter("@Education", model.Education), new SqlParameter("@PhoneNumber", model.PhoneNumber), new SqlParameter("@Email", model.Email), new SqlParameter("@IdentificationType", model.IdentificationType), new SqlParameter("@IdentificationNumber", model.IdentificationNumber), new SqlParameter("@FSPCode", model.FspCode), }; try { var response = helper.Procedure("uspAPIEditFamily", sqlParameters); message = new EditFamilyResponse(response.Code, false, response.Data, 0).Message; return(message); } catch (Exception e) { message = new EditFamilyResponse(e).Message; } return(message); }
public IActionResult Edit_Family([FromBody] EditFamily model) { if (!ModelState.IsValid) { var error = ModelState.Values.FirstOrDefault().Errors.FirstOrDefault().ErrorMessage; return(BadRequest(new { error_occured = true, error_message = error })); } int userId = Convert.ToInt32(HttpContext.User.Claims .Where(w => w.Type == "UserId") .Select(x => x.Value) .FirstOrDefault()); _imisModules.GetInsureeModule().GetFamilyLogic().SetUserId(userId); var response = _imisModules.GetInsureeModule().GetFamilyLogic().Edit(model); return(Json(response)); }