private ResultDto InsertUpdateLoanSecurity(LoanSecurityMasterDto loansecurity) { ResultDto resultDto = new ResultDto(); string obectName = "Loan Security"; try { ObjectParameter paramLoanSecurityID = new ObjectParameter("LoanSecurityID", loansecurity.LoanSecurityID); ObjectParameter paramLoanSecurityCode = new ObjectParameter("LoanSecurityCode", string.Empty); int count = _dbContext.uspLoanSecurityMasterInsertUpdate(paramLoanSecurityID, loansecurity.Type, loansecurity.LoanSecurityName, loansecurity.UserID, paramLoanSecurityCode); resultDto.ObjectId = (int)paramLoanSecurityID.Value; resultDto.ObjectCode = string.IsNullOrEmpty((string)paramLoanSecurityCode.Value) ? loansecurity.LoanSecurityCode : (string)paramLoanSecurityCode.Value; if (resultDto.ObjectId > 0) { resultDto.Message = string.Format("{0} details saved successfully with code : {1}", obectName, resultDto.ObjectCode); } else if (resultDto.ObjectId == -1) { resultDto.Message = string.Format("Error occured while generating {0} code", obectName); } else { resultDto.Message = string.Format("Error occured while saving {0} details", obectName); } } catch (Exception) { resultDto.Message = string.Format("Service layer error occured while saving the {0} details", obectName); resultDto.ObjectId = -98; } return(resultDto); }
public ActionResult CreateLoanSecurityMaster(string id) { int loanSecurityMasteId = string.IsNullOrEmpty(id.DecryptString()) ? default(int) : Convert.ToInt32(id.DecryptString()); SelectList loansecuritymaster = GetDropDownListByMasterCode(Enums.RefMasterCodes.LOAN_SECURITY_TYPE); ViewBag.LoanSecurityMaster = loansecuritymaster; LoanSecurityMasterDto loanSecurityMasterDto = new LoanSecurityMasterDto(); if (loanSecurityMasteId > 0) { loanSecurityMasterDto = _loansecurityMasterService.GetByID(loanSecurityMasteId); } LoanSecurityMasterModel objLoanSecurityMasterModel = Mapper.Map <LoanSecurityMasterDto, LoanSecurityMasterModel>(loanSecurityMasterDto); return(View(objLoanSecurityMasterModel)); }
public ResultDto Update(LoanSecurityMasterDto loansecurity) { return(InsertUpdateLoanSecurity(loansecurity)); }