// public void CreateFeeStructure(int finId, int classId, int feeId) { cls_FeeDTO obj = new cls_FeeDTO(); var item = obj.GetFeeDetail(feeId, finId, classId); var structure = GetFEE_STRUCTURE(finId, classId, feeId); MST_FEE_STRUCTURE structureNew = new MST_FEE_STRUCTURE(); structureNew.FeeDuration = item.MST_FEE.FeeDuration; structureNew.Fin_ID = finId; structureNew.ClassId = classId; structureNew.FeeId = feeId; var paymentType = ((EnumConstants.FeeDuration)item.MST_FEE.FeeDuration).ToString(); if (paymentType == EnumConstants.FeeDuration.Anually.ToString()) { structureNew.TermCount = 1; } else if (paymentType == EnumConstants.FeeDuration.HalfYearly.ToString()) { structureNew.TermCount = item.MST_FEE.MST_FEE_TERM.Count(); } else if (paymentType == EnumConstants.FeeDuration.Monthly.ToString()) { structureNew.TermCount = item.MST_FEE.MST_FEE_TERM.Count(); } else if (paymentType == EnumConstants.FeeDuration.OneTime.ToString()) { structureNew.TermCount = 1; } else if (paymentType == EnumConstants.FeeDuration.Quartly.ToString()) { structureNew.TermCount = item.MST_FEE.MST_FEE_TERM.Count(); } structureNew.Fee_New_Amt = item.FeeAmount_New; structureNew.Total_New_Amt = item.FeeAmount_New * structureNew.TermCount; structureNew.Fee_Old_Amt = item.FeeAmount_Old; structureNew.Total_Old_Amt = item.FeeAmount_Old * structureNew.TermCount; //fEE_STRUCTURE.ClassId= if (structure != null) { structure.Fee_New_Amt = structureNew.Fee_New_Amt; // item.FeeAmount_New; structure.Total_New_Amt = structureNew.Total_New_Amt; // item.FeeAmount_New * structure.TermCount; structure.Fee_Old_Amt = structureNew.Fee_Old_Amt; // item.FeeAmount_Old; structure.Total_Old_Amt = structureNew.Total_Old_Amt; // item.FeeAmount_New * structure.TermCount; Update(structure); } else { Save(structureNew); } }
public bool Update(MST_FEE_STRUCTURE data) { try { unitOfWork.FeeStructureRepository.Update(data); unitOfWork.Save(); return(true); } catch (Exception ex) { return(false); } }