예제 #1
0
 public PricingSkill GetPricingByType(string pricingType)
 {
     try
     {
         PricingDAL   repository   = new PricingDAL();
         PricingSkill pricingSkill = new PricingSkill();
         return(pricingSkill = repository.GetPricingByType(pricingType));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #2
0
        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;
            }
        }
예제 #3
0
        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;
            }
        }