public PricingSkill GetPricingByType(string pricingType) { try { PricingDAL repository = new PricingDAL(); PricingSkill pricingSkill = new PricingSkill(); return(pricingSkill = repository.GetPricingByType(pricingType)); } catch (Exception ex) { throw ex; } }
public List <PricingSkill> GetCollectionPricingSkillByType(string pricingSkillType) { try { List <PricingSkill> listPricingSkill = new List <PricingSkill>(); db = new DbConnect(); command = new MySqlCommand("GetPricingSkillByType", db.GetConnection()); command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.Add("@p_PricingSkillType", MySqlDbType.VarChar).Value = pricingSkillType; reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { pricingSkill = new PricingSkill() { PricingEntityID = reader.GetInt32("PricingEntityID"), PricingSkillEntityID = reader.GetInt32("PricingSkillEntityID"), Price = reader.GetInt32("Price"), PricingType = reader.GetString("PricingType"), PricingSkillDescription = reader.GetString("SkillDescription"), PricingSkillEnabled = reader.GetBoolean("PricingSkillEnabled"), Period = reader.GetString("Period"), ModifiedDate = reader.GetDateTime("ModifiedDate") }; listPricingSkill.Add(pricingSkill); } } reader.Close(); reader.Dispose(); return(listPricingSkill); } catch (Exception ex) { throw ex; } }
public PricingSkill GetPricingByType(string pricingType) { try { db = new DbConnect(); command = new MySqlCommand("GetPricingByType", db.GetConnection()); command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.Add("@p_PricingType", MySqlDbType.VarChar).Value = pricingType; reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { pricingSkill = new PricingSkill { PricingEntityID = reader.GetInt32("PricingEntityID"), Price = reader.GetInt32("Price"), PricingType = reader.GetString("PricingType"), Period = reader.GetString("Period"), ModifiedDate = reader.GetDateTime("ModifiedDate") } } ; } reader.Close(); reader.Dispose(); return(pricingSkill); } catch (MySqlException mysqlEx) { throw mysqlEx; } }