예제 #1
0
 public Product(ProductType type, string name, Brand brand, string remark)
 {
     ID = -1;
     Type = type;
     Name = name;
     Brand = brand;
     Remark = remark;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
 public void RemoveType(ProductType type)
 {
     Types.Remove(type);
 }
예제 #5
0
 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);
 }
예제 #10
0
 public void DeleteProductType(ProductType type)
 {
     productTypeList.RemoveType(type);
     DBAccessor.DeleteProductType(type.ID);
 }