private void BindFeeTypeDropDownList() { _feeType = new FeeType(); List <FeeTypeModel> _listFeeList = _feeType.GetFeeType(); /*----Display only those fee type those are map in fee seeting form----------------------------------------------------------*/ FeeSetting _feeSetting = new FeeSetting(); List <FeeSettingModel> _listFeeSetting = _feeSetting.GetFeeSetting(Convert.ToInt32(ddlAcademicYear.SelectedValue)); if (_listFeeList != null && _listFeeSetting != null) { _listFeeList = _listFeeList.Where(p => _listFeeSetting.Any(p2 => p2.FeeTypeID == p.FeeTypeID)).ToList(); } /*--------------------------------------------------------------------------------------------------------------------------*/ if (_listFeeList != null) { _listFeeList.Add(new FeeTypeModel { FeeTypeID = 0, FeeType = "Select" }); ddlFeeType.DataSource = _listFeeList.OrderBy(x => x.FeeTypeID).ToList(); ddlFeeType.DisplayMember = "FeeType"; ddlFeeType.ValueMember = "FeeTypeID"; } }
private void BindFeeSettingGrid(int Academic_Year) { _feeSetting = new FeeSetting(); List <FeeSettingModel> _listFeeSettingModel = _feeSetting.GetFeeSetting(Academic_Year); if (_listFeeSettingModel != null && _listFeeSettingModel.Count > 0) { // gridFeeSetting.DataSource = bindingSource; //_listFeeSettingModel.ToList(); BindGridContols(_listFeeSettingModel); } else { DialogResult dResult = MessageBox.Show("There is no record for this academic year.\nDo you want to copy previous academic year data?", "Fee Setting", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dResult == DialogResult.Yes) { Copy_Previous_Academic_Year_Setting(); } } }
private void btnSave_Click(object sender, EventArgs e) { bool isValidGrid = ValidateGrid(); if (isValidGrid) { _feeSetting = new FeeSetting(); xmlString = ConvertGridToXML(ConvertGridToList()); if (!string.IsNullOrWhiteSpace(xmlString)) { try { short output = _feeSetting.SaveFeeSetting(xmlString, Convert.ToInt32(ddlAcademicYear.SelectedValue)); if (output == 1) { // lblError.Visible = false; ShowMessage("Record Successfully Saved."); // MessageBox.Show("Record Successfully Saved.", "Fee Setting", MessageBoxButtons.OK, MessageBoxIcon.Information); BindFeeSettingGrid(Convert.ToInt32(ddlAcademicYear.SelectedValue)); } if (output == -1) { //lblError.Visible = true; ShowMessage("Error occured while saving records.\n Please contact to admin."); //lblError.Text = "Error! Please contact to admin."; } } catch (Exception ex) { // lblError.Visible = true; // lblError.Text = "Error! Please contact to admin."; ShowMessage("Error! Please contact to admin."); } } else { //lblError.Visible = true; //lblError.Text = "Error! Please contact to admin."; ShowMessage("Error! Please contact to admin."); } } }
/// <summary> /// Description : Get the ClientFeeSetting and ClientFeeMapping Information by ClientCode /// Created By : Shiva /// Created Date : 2nd July 2014 /// Modified By : Shiva /// Modified Date: 4 July 2014 /// </summary> public static BillingInfo GetFeeSettingAndMappingsByClientCode(int ClientCode, string SourceID) { var GetFeeSettingAndMappingInfo = new BillingInfo(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { SqlParameter[] sqlParams = new SqlParameter[2]; sqlParams[0] = new SqlParameter("@ClientCode", ClientCode); sqlParams[1] = new SqlParameter("@SourceID", SourceID); var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetFeeSettingAndMappingsByClientCode", sqlParams); var safe = new SafeDataReader(reader); while (reader.Read()) { var feeSetting = new FeeSetting(); feeSetting.FetchClientFeeSettingInfo(feeSetting, safe); GetFeeSettingAndMappingInfo.ClientFeeSettingList.Add(feeSetting); } reader.NextResult(); while (reader.Read()) { var feeMapping = new FeeMapping(); feeMapping.FetchClientFeeMappingInfo(feeMapping, safe); GetFeeSettingAndMappingInfo.ClientFeeMappingList.Add(feeMapping); } return GetFeeSettingAndMappingInfo; } catch (Exception ex) { log.Error("Error: " + ex); return GetFeeSettingAndMappingInfo; } finally { log.Debug("End: " + methodBase.Name); } }
/// <summary> /// Description : To get Company from Billing third party details. /// Created By : Shiva /// Created Date : 27 Aug 2014 /// Modified By : /// Modified Date: /// </summary> public static BillingInfo GetCompanyFromBillingThirdParty() { var billingDataInfo = new BillingInfo(); System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Reflection.MethodBase methodBase = stackFrame.GetMethod(); log.Debug("Start: " + methodBase.Name); try { var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetCompanyFromBillingThirdParty"); var safe = new SafeDataReader(reader); while (reader.Read()) { var billing = new FeeSetting(); billing.FetCompanyFromBillingData(billing, safe); billingDataInfo.ClientFeeSettingList.Add(billing); } return billingDataInfo; } catch (Exception ex) { log.Error("Error: " + ex); return billingDataInfo; } finally { log.Debug("End: " + methodBase.Name); } }
public FeeSetting FetCompanyFromBillingData(FeeSetting objBillingData, SafeDataReader dr) { objBillingData.ID = dr.GetInt32("ID"); objBillingData.CompanyName = dr.GetString("CompanyName"); return objBillingData; }
public FeeSetting FetchClientFeeSettingInfo(FeeSetting getClientFeeSettingInfo, SafeDataReader dr) { getClientFeeSettingInfo.BillTo = dr.GetInt32("BillTo"); getClientFeeSettingInfo.BillingPartyCode = dr.GetString("BillingPartyCode"); getClientFeeSettingInfo.IsClubFee = dr.GetBoolean("IsClubFee"); getClientFeeSettingInfo.AccountCode = dr.GetString("AccountCode"); return getClientFeeSettingInfo; }