public void UpdateStatus(DTO.LABURNUM.COM.FeeModel model) { if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password)) { new FrontEndApi.FeeApi().UpdateIsActive(model); } }
public void Update(DTO.LABURNUM.COM.FeeModel model) { model.FeeId.TryValidate(); IQueryable <API.LABURNUM.COM.Fee> iQuery = this._laburnum.Fees.Where(x => x.FeeId == model.FeeId && x.IsActive == true); List <API.LABURNUM.COM.Fee> dbFees = iQuery.ToList(); if (dbFees.Count == 0) { throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND); } if (dbFees.Count > 1) { throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND); } dbFees[0].AdmissionTypeId = model.AdmissionTypeId; dbFees[0].AdmissionFee = model.AdmissionFee; dbFees[0].AnnualCharges = model.AnnualCharges; dbFees[0].ClassId = model.ClassId; dbFees[0].DevelopementCharges = model.DevelopementCharges; dbFees[0].ExamFee = model.ExamFee; dbFees[0].SportsFee = model.SportsFee; dbFees[0].SecurityFee = model.SecurityFee; dbFees[0].MonthlyFee = model.MonthlyFee; dbFees[0].LastUpdated = new Component.Utility().GetISTDateTime(); this._laburnum.SaveChanges(); }
public List <API.LABURNUM.COM.Fee> GetFeeByAdvanceSearch(DTO.LABURNUM.COM.FeeModel model) { IQueryable <API.LABURNUM.COM.Fee> iQuery = null; if (model.FeeId > 0) { iQuery = this._laburnum.Fees.Where(x => x.FeeId == model.FeeId && x.IsActive == true); } if (iQuery != null) { if (model.ClassId > 0) { iQuery = iQuery.Where(x => x.ClassId == model.ClassId && x.IsActive == true); } } else { if (model.ClassId > 0) { iQuery = this._laburnum.Fees.Where(x => x.ClassId == model.ClassId && x.IsActive == true); } } if (iQuery != null) { if (model.AdmissionTypeId > 0) { iQuery = iQuery.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true); } } else { if (model.AdmissionTypeId > 0) { iQuery = this._laburnum.Fees.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true); } } if (iQuery != null) { if (model.ClassId > 0) { iQuery = iQuery.Where(x => x.ClassId == model.ClassId && x.IsActive == true); } } else { if (model.ClassId > 0) { iQuery = this._laburnum.Fees.Where(x => x.ClassId == model.ClassId && x.IsActive == true); } } List <API.LABURNUM.COM.Fee> dbFees = iQuery.ToList(); return(dbFees); }
public List <DTO.LABURNUM.COM.FeeModel> SearchFeeByAdvanceSearch(DTO.LABURNUM.COM.FeeModel model) { if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password)) { return(new FeeHelper(new FrontEndApi.FeeApi().GetFeeByAdvanceSearch(model)).Map()); } else { return(null); } }
public long Add(DTO.LABURNUM.COM.FeeModel model) { if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password)) { return(new FrontEndApi.FeeApi().Add(model)); } else { return(-1); } }
public void UpdateIsActive(DTO.LABURNUM.COM.FeeModel model) { model.FeeId.TryValidate(); IQueryable <API.LABURNUM.COM.Fee> iQuery = this._laburnum.Fees.Where(x => x.FeeId == model.FeeId && x.IsActive == true); List <API.LABURNUM.COM.Fee> dbFees = iQuery.ToList(); if (dbFees.Count == 0) { throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND); } if (dbFees.Count > 1) { throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND); } dbFees[0].IsActive = model.IsActive; dbFees[0].LastUpdated = new Component.Utility().GetISTDateTime(); this._laburnum.SaveChanges(); }
private long AddFee(DTO.LABURNUM.COM.FeeModel model) { API.LABURNUM.COM.Fee apifee = new Fee() { ClassId = model.ClassId, AdmissionTypeId = model.AdmissionTypeId, AdmissionFee = model.AdmissionFee, AnnualCharges = model.AnnualCharges, DevelopementCharges = model.DevelopementCharges, ExamFee = model.ExamFee, MonthlyFee = model.MonthlyFee, SportsFee = model.SportsFee, CreatedOn = System.DateTime.Now, IsActive = true }; this._laburnum.Fees.Add(apifee); this._laburnum.SaveChanges(); return(apifee.FeeId); }
public void UpdateFeeStatus(DTO.LABURNUM.COM.FeeModel model) { try { model.ApiClientModel = new LABURNUM.COM.Component.Common().GetApiClientModel(); HttpClient client = new LABURNUM.COM.Component.Common().GetHTTPClient("application/json"); HttpResponseMessage response = client.PostAsJsonAsync("Fee/UpdateStatus", model).Result; if (response.IsSuccessStatusCode) { } else { } } catch (Exception) { throw new Exception("Error While Updating Fee Status"); } }
private DTO.LABURNUM.COM.FeeModel MapCore(API.LABURNUM.COM.Fee fee) { DTO.LABURNUM.COM.FeeModel dtoFee = new DTO.LABURNUM.COM.FeeModel() { FeeId = fee.FeeId, AdmissionTypeId = fee.AdmissionTypeId, AnnualCharges = fee.AnnualCharges, DevelopementCharges = fee.DevelopementCharges, AdmissionFee = fee.AdmissionFee, ExamFee = fee.ExamFee, MonthlyFee = fee.MonthlyFee, SportsFee = fee.SportsFee, ClassId = fee.ClassId, CreatedOn = fee.CreatedOn, IsActive = fee.IsActive, LastUpdated = fee.LastUpdated }; return(dtoFee); }
public long Add(DTO.LABURNUM.COM.FeeModel model) { return(AddValidation(model)); }
private long AddValidation(DTO.LABURNUM.COM.FeeModel model) { model.TryValidate(); return(AddFee(model)); }
public static void TryValidate(this DTO.LABURNUM.COM.FeeModel item) { item.ClassId.TryValidate(); item.AdmissionTypeId.TryValidate(); item.AdmissionFee.TryValidate(); }