Exemplo n.º 1
0
        private Dictionary <string, object> prepareBrandParameters(clsBrand prBrand)
        {
            Dictionary <string, object> par = new Dictionary <string, object>(2);

            par.Add("Name", prBrand.Name);
            par.Add("Type", prBrand.Type);

            return(par);
        }
Exemplo n.º 2
0
 public string InsertBrand(clsBrand prBrand)
 {
     try
     {
         int lcRecCount = clsDbConnectioncs.Execute(
             "INSERT INTO tbl_brand (Name, Type) VALUES (@Name, @Type)",
             prepareBrandParameters(prBrand));
         if (lcRecCount == 1)
         {
             return("One Brand Inserted");
         }
         else
         {
             return("Unexpected artist count: " + lcRecCount);
         }
     }
     catch (Exception ex)
     {
         return(ex.GetBaseException().Message);
     }
 }