コード例 #1
0
 public void selectQuantity(ClothesStore clothesStore)
 {
     connection.open();
     command = new SqlCommand("select quantity from ClothesStore where name='" + clothesStore.getName() + "'", connection.getConnection());
     clothesStore.setQuantity(double.Parse(command.ExecuteScalar().ToString()));
     connection.close();
 }
コード例 #2
0
    public Boolean UpdateClothe(string prevoiusName, string name, double price, double quantity, double total)
    {
        Boolean check = false;

        clothesStore   = new ClothesStore();
        clothesStoreDB = new ClothesStoreDB();

        if (prevoiusName.Equals("NOT CHANAGEE"))
        {
            clothesStore.setName(name);
        }
        else
        {
            clothesStore.setName(name);
            check = clothesStoreDB.checkCloth(clothesStore);
            clothesStore.setName(prevoiusName);
        }
        clothesStore.setPrice(price);
        clothesStore.setQuantity(quantity);
        clothesStore.setTotal(total);

        if (check == true)
        {
            return(false);
        }
        else
        {
            int ID = clothesStoreDB.selectClotheId(clothesStore);
            clothesStore.setID(ID);
            clothesStore.setName(name);
            clothesStoreDB.update(clothesStore);
            return(true);
        }
    }
コード例 #3
0
 public void updateQuantityPlus(string clothesName, double quantity)
 {
     clothesStore   = new ClothesStore();
     clothesStoreDB = new ClothesStoreDB();
     clothesStore.setName(clothesName);
     clothesStore.setQuantity(quantity);
     clothesStoreDB.updateQuantityPlus(clothesStore);
 }
コード例 #4
0
 public Boolean insertClothes(string name, double price, double quantity, double total)
 {
     clothesStore   = new ClothesStore();
     clothesStoreDB = new ClothesStoreDB();
     clothesStore.setName(name);
     clothesStore.setPrice(price);
     clothesStore.setQuantity(quantity);
     clothesStore.setTotal(total);
     check = clothesStoreDB.checkCloth(clothesStore);
     if (check == true)
     {
         return(false);
     }
     else
     {
         clothesStoreDB.insert(clothesStore);
         return(true);
     }
 }