public IHttpActionResult UpdateCommite(CommiteRecord objCommiteRec) { try { _CommiteService.Update(objCommiteRec); return(Ok(objCommiteRec)); } catch (Exception ex) { throw ex; } }
public IHttpActionResult AddCommite(CommiteRecord objCommiteRec) { try { _CommiteService.Create(objCommiteRec); AddInstallmentRecord(objCommiteRec); return(Ok(objCommiteRec)); } catch (Exception ex) { throw ex; } }
private void AddInstallmentRecord(CommiteRecord ObjCommiteRecord) { try { for (int i = 0; i < ObjCommiteRecord.CommiteMonths; i++) { InstallmentRec objInstallmentRec = new InstallmentRec(); objInstallmentRec.FK_CommiteId = ObjCommiteRecord.Id; objInstallmentRec.InstallmentAmount = ObjCommiteRecord.CommiteAmount; objInstallmentRec.InstallmentNumber = i + 1; objInstallmentRec.InstallmentMonth = ObjCommiteRecord.CommiteStartDate.Value.AddMonths(i); _InstallmentService.Create(objInstallmentRec); } } catch (Exception ex) { throw ex; } }