Esempio n. 1
0
 public Product(ProductType type, string name, Brand brand, string remark)
 {
     ID = -1;
     Type = type;
     Name = name;
     Brand = brand;
     Remark = remark;
 }
 private static ProductType LoadProductType(DataRow dataRow)
 {
     int id = Convert.ToInt32(dataRow["PID"]);
     string name = dataRow["ProductType"].ToString();
     int parentID = Convert.ToInt32(dataRow["ParentPID"]);
     ProductType productType = new ProductType(id, name, parentID);
     return productType;
 }
 public bool AddProductType(string typeName, int parentID)
 {
     int id = DBAccessor.AddProductType(typeName, parentID);
     if (id == -1)
     {
         return false;
     }
     ProductType type = new ProductType(id, typeName, parentID);
     productTypeList.AddType(type);
     return true;
 }
Esempio n. 4
0
 public void RemoveType(ProductType type)
 {
     Types.Remove(type);
 }
Esempio n. 5
0
 public void AddType(ProductType type)
 {
     Types.Add(type);
 }
Esempio n. 6
0
        public ProductType GetType(string typeName)
        {
            ProductType result = Types.Find(type => type.Name == typeName);

            return(result);
        }
Esempio n. 7
0
        public ProductType GetType(int id)
        {
            ProductType result = Types.Find(type => type.ID == id);

            return(result);
        }
Esempio n. 8
0
 public void RemoveType(ProductType type)
 {
     Types.Remove(type);
 }
Esempio n. 9
0
 public void AddType(ProductType type)
 {
     Types.Add(type);
 }
Esempio n. 10
0
 public void DeleteProductType(ProductType type)
 {
     productTypeList.RemoveType(type);
     DBAccessor.DeleteProductType(type.ID);
 }