Ejemplo n.º 1
0
 public static Cloth FindClothByID(string _id)
 {
     Cloth temp = new Cloth();
     temp.id = _id;
     ConnectDB db = new ConnectDB();
     SqlParameter[] a = new SqlParameter[1];
     a[0] = new SqlParameter("@ID", "" + temp.id + "");
     DataTable dt = db.ReturnDataTable("Clothes_SelectByID", a);
     DataRow dr = dt.Rows[0];
     temp.colorID = dr["ID"].ToString();
     temp.name = dr["Name"].ToString();
     temp.groupClothesID = dr["GroupClothesID"].ToString();
     temp.description = dr["Description"].ToString();
     temp.priceIn = dr["PriceIn"].ToString();
     temp.priceOut = dr["PriceOut"].ToString();
     temp.newPrice = dr["NewPrice"].ToString();
     temp.sex = dr["Sex"].ToString();
     temp.colorID = dr["ColorID"].ToString();
     temp.sizeID = dr["SizeID"].ToString();
     temp.images = dr["Images"].ToString();
     temp.materialID = dr["MaterialID"].ToString();
     temp.quantity = "1"; // Trường hợp truy vấn để thêm vào giỏ nên số lượng cần lấy là 1
     temp.order = dr["Order"].ToString();
     temp.status = dr["Status"].ToString();
     return temp;
 }
Ejemplo n.º 2
0
 public OrderControl(Order _order,Bag _bag,Customer _customer,Cloth _chonseClothes)
 {
     this.order = _order;
     this.bag = _bag;
     this.customer = _customer;
     this.chonseCloth = _chonseClothes;
 }
Ejemplo n.º 3
0
Archivo: Bag.cs Proyecto: DatDaiGia/SPM
 public void AddCloth(string _id)
 {
     int temp = 1;
     // Kiểm tra nếu Cloth đã tồn tại thì tăng số lượng
     foreach (Cloth item in listClothes)
     {
         if (item.id == _id)
         {
             item.quantity = (int.Parse(item.quantity) + 1).ToString();
             temp = 0;
         }
     }
     //Nếu chưa tồm tại thì thêm mới
     if (temp == 1)
     {
         Cloth temp1 = new Cloth(_id);
         this.listClothes.Add(temp1);
     }
 }
Ejemplo n.º 4
0
 // Hàm lấy chi tiết sản phẩm, truyền vào mã sản phẩm
 public DataTable ShowClothByID(string _id)
 {
    chonseCloth = Cloth.FindClothByID(_id);
    return chonseCloth.ShowDetail();
 }