public async Task <AddEditResponse> Add(GovIDTypeRequest gtData) { var response = new AddEditResponse(); try { if (gtData.isActive.ToLower() != "true") { gtData.isActive = "false"; } if (string.IsNullOrEmpty(gtData.govIdTypeName)) { response.Status = "false"; response.Message = "Please enter gov id type"; } else { var addEditResponse = _govidTypeData.Add(gtData); response.Status = "true"; response.Message = addEditResponse.message; } return(response); } catch (Exception e) { response.Status = "false"; response.Message = $"Unable to process - {e.Message}"; return(response); } }
public async Task <ActionResult> Add(GovIDTypeRequest gtData) { var addEditResponse = await _govidTypeService.Add(gtData); return(Ok(new AddEditResponse { Status = addEditResponse.Status, Message = addEditResponse.Message, })); }
public AddEditMasters Add(GovIDTypeRequest gtData) { try { string stProc = AddGovIDType; var pList = new List <SqlParameter> { new SqlParameter("@GovIDType", gtData.govIdTypeName ?? gtData.govIdTypeName), new SqlParameter("@Isactive", gtData.isActive ?? gtData.isActive), new SqlParameter("@Comments", gtData.comments ?? gtData.comments), new SqlParameter("@Createdby", gtData.createdBy), new SqlParameter("@Updatedby", gtData.updatedBy), }; var returnData = UtilityDL.FillEntity <AddEditMasters>(stProc, pList); return(returnData); } catch (Exception e) { throw e; } }