public List <CatFareTypeCodes> GetFareTypeCodes(string connectionName) { Database db = DatabaseFactory.CreateDatabase(connectionName); DbCommand dbCommand = db.GetStoredProcCommand(Resources.CatFareTypeCodesResources.SP_GetCatalog_FareTypesCodes); List <CatFareTypeCodes> FareTypeCodesList = new List <CatFareTypeCodes>(); using (IDataReader dr = db.ExecuteReader(dbCommand)) { int _value = dr.GetOrdinal(Resources.CatFareTypeCodesResources.PARAM_VALUE); int _text = dr.GetOrdinal(Resources.CatFareTypeCodesResources.PARAM_TEXT); int _text2 = dr.GetOrdinal(Resources.CatFareTypeCodesResources.PARAM_TEXT2); while (dr.Read()) { CatFareTypeCodes item = new CatFareTypeCodes(); item.Value = (dr[_value] == DBNull.Value) ? Types.StringNullValue : dr.GetString(_value); item.Text = (dr[_text] == DBNull.Value) ? Types.StringNullValue : dr.GetString(_text); item.Text2 = (dr[_text2] == DBNull.Value) ? Types.StringNullValue : dr.GetString(_text2); FareTypeCodesList.Add(item); } } return(FareTypeCodesList); }
private void LoadFareTypeCatalog() { List <CatFareTypeCodes> FareTypeList = CatFareTypeCodesBL.GetFareTypeCodes(); foreach (CatFareTypeCodes FareType in FareTypeList) { CatFareTypeCodes item = new CatFareTypeCodes(); item.Text = FareType.Text; item.Value = FareType.Value; cmbFareType.Items.Add(item); } }
/// <summary> /// Envia comando a MySabre para consultar tarifa por tipo de esta /// </summary> private void CommandsSend() { string send = string.Empty; send = string.Concat("FQ", txtOrigin.Text, txtDestination.Text, txtDateSelected.Text); if (!string.IsNullOrEmpty(txtDateReturn.Text)) { send = string.Concat(send, "‡R", txtDateReturn.Text); } if (cmbFareType.SelectedIndex > 0) { CatFareTypeCodes item = (CatFareTypeCodes)cmbFareType.SelectedItem; send = string.Concat(send, item.Value); } if (chkAdult.Checked.Equals(true) || chkChild.Checked.Equals(true) || chkInfant.Checked.Equals(true)) { send = string.Concat(send, ","); } if (chkAdult.Checked.Equals(true)) { send = string.Concat(send, "A"); } if (chkChild.Checked.Equals(true)) { send = string.Concat(send, "C"); } if (chkInfant.Checked.Equals(true)) { send = string.Concat(send, "I"); } if (!string.IsNullOrEmpty(txtAirLine1.Text)) { send = string.Concat(send, Resources.Constants.INDENT, txtAirLine1.Text); } if (!string.IsNullOrEmpty(txtAirLine2.Text)) { send = string.Concat(send, Resources.Constants.INDENT, txtAirLine2.Text); } if (!string.IsNullOrEmpty(txtAirLine3.Text)) { send = string.Concat(send, Resources.Constants.INDENT, txtAirLine3.Text); } if (!string.IsNullOrEmpty(txtAirLine4.Text)) { send = string.Concat(send, Resources.Constants.INDENT, txtAirLine4.Text); } if (!string.IsNullOrEmpty(txtAirLine5.Text)) { send = string.Concat(send, Resources.Constants.INDENT, txtAirLine5.Text); } if (!string.IsNullOrEmpty(txtAirLine6.Text)) { send = string.Concat(send, Resources.Constants.INDENT, txtAirLine6.Text); } if (!string.IsNullOrEmpty(txtMoneyCode.Text)) { send = string.Concat(send, Resources.Constants.SLASH, txtMoneyCode.Text); } if (chkNoAdvPurchase.Checked.Equals(true)) { send = string.Concat(send, "ΣXA"); } else if (chkNoPenalties.Checked.Equals(true)) { send = string.Concat(send, "ΣXP"); } else if (chkNoMinMaxStay.Checked.Equals(true)) { send = string.Concat(send, "ΣXS"); } else if (chkNoRestrictions.Checked.Equals(true)) { send = string.Concat(send, "ΣXR"); } else if (chkClassifiedFare.Checked.Equals(true)) { send = string.Concat(send, "*PVT"); } else if (chkNUC.Checked.Equals(true)) { send = string.Concat(send, "‡HR"); } else if (chkOneWay.Checked.Equals(true)) { send = string.Concat(send, "‡OW"); } else if (chkRoundTrip.Checked.Equals(true)) { send = string.Concat(send, "‡RT"); } if (chkPublic.Checked.Equals(true)) { send = string.Concat(send, Resources.Constants.COMMANDS_CROSSLORAINE_PL); } else if (chkPrivate.Checked.Equals(true)) { send = string.Concat(send, Resources.Constants.COMMANDS_CROSSLORAINE_PV); } using (CommandsAPI objCommand = new CommandsAPI()) { objCommand.SendReceive(send); } }