示例#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;
 }
 public void RemoveType(ProductType type)
 {
     Types.Remove(type);
 }
 public void AddType(ProductType type)
 {
     Types.Add(type);
 }
示例#6
0
        public ProductType GetType(string typeName)
        {
            ProductType result = Types.Find(type => type.Name == typeName);

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

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