public List <GroupInterestRatesDto> GetInterestByID(int groupID, string type) { List <uspGroupDepositLoanInterestByID_Result> lstGroupDepositLoanIntrerest_Result = _dbContext.uspGroupDepositLoanInterestByID(groupID, type).ToList(); List <GroupInterestRatesDto> objGroupInterestRatesDto = new List <GroupInterestRatesDto>(); foreach (var obj in lstGroupDepositLoanIntrerest_Result) { GroupInterestRatesDto objGroupInterestRatesDto1 = new GroupInterestRatesDto() { GroupInterestID = obj.GroupInterestID, Base = obj.Base, BaseText = obj.BaseText, PrincipalAHID = obj.PrincipalAHID, PenalAHID = Convert.ToInt32(obj.PenalAHID), InterestAHID = obj.InterestAHID, ROI = obj.ROI, PenalROI = obj.PenalROI.HasValue ? obj.PenalROI.Value : default(decimal), FromDate = obj.FromDate, ToDate = obj.ToDate.HasValue ? obj.ToDate.Value : default(DateTime), IsActive = obj.IsActive, CaluculationMethodId = obj.CaluculationMethodID.HasValue ? obj.CaluculationMethodID.Value : default(int), CaluculationMethod = obj.CaluculationMethod, PenalAH = obj.PenalAH, InterestAH = obj.InterestAH, PrincipalAH = obj.PrincipalAH }; objGroupInterestRatesDto.Add(objGroupInterestRatesDto1); } return(objGroupInterestRatesDto); }
public ActionResult CreateLoanInterestDetails(FormCollection Form) { int count = Convert.ToInt32(Request.Form["hdnMaxLoanIndex"]); int GroupId = Convert.ToInt32(Request.Form["hdnObjectID"]); string type = "L"; List <GroupInterestRatesDto> lstobj = new List <GroupInterestRatesDto>(); for (int i = 1; i <= count; i++) { GroupInterestRatesDto objGroupInterestdto = new GroupInterestRatesDto(); if (!string.IsNullOrEmpty(Form["hdnloanentryId_" + i])) { objGroupInterestdto.GroupInterestID = Convert.ToInt32(Form["hdnloanentryId_" + i]); } if (!string.IsNullOrEmpty(Form["hdnloanprincipleAChead_" + i])) { objGroupInterestdto.InterestAHID = Convert.ToInt32(Form["hdnloanInterestACHead_" + i]); objGroupInterestdto.PenalAHID = Convert.ToInt32(Form["hdnLoanpenalACHead_" + i]); objGroupInterestdto.PrincipalAHID = Convert.ToInt32(Form["hdnloanprincipleAChead_" + i]); objGroupInterestdto.Base = Convert.ToInt32(Form["hdnBase_" + i]); objGroupInterestdto.CaluculationMethodId = Convert.ToInt32(Form["hdnCalMethod_" + i]); objGroupInterestdto.ROI = Convert.ToDecimal(Form["hdnrateofint_" + i]); objGroupInterestdto.PenalROI = Convert.ToDecimal(Form["hdnpenalrateofinterest_" + i]); objGroupInterestdto.FromDate = Convert.ToDateTime(Form["hdnfromdate_" + i]); objGroupInterestdto.ToDate = Convert.ToDateTime(Form["hdntodate_" + i]); lstobj.Add(objGroupInterestdto); } } LoadLoanInterestDropDowns(); ResultDto resultdto = _groupService.InsertDepositLoanRates(lstobj, GroupId, UserInfo.UserID, type); return(Json(new { groupid = GroupId, ObjectCode = resultdto.ObjectCode, Message = resultdto.Message })); }