Esempio n. 1
0
        public List <ItemThongBao> listItemThongBao()
        {
            string query = "select ct.trigia, ct.sohd, thoigianxacnhan, trangthai, masp  " +
                           " , ct.thongbaoxacnhan_xem , ct.thongbaodagiao_xem " +
                           "from cthd ct, hoadon hd where ct.sohd = hd.sohd and id_ngmua = @id and hienthongbao=0 and " +
                           " thoigianxacnhan is not null and(ct.trangthai = 'dang giao hang' or " +
                           " ct.trangthai = 'da giao hang') order by thoigianxacnhan desc";
            List <ItemThongBao> listThongBao = new List <ItemThongBao>();
            DataTable           dataTable    = this.ExcuteQuery(query, new object[] { Account.Instance.id });

            foreach (DataRow row in dataTable.Rows)
            {
                int temp = -1;
                if (row["thongbaoxacnhan_xem"].ToString() == "False" || row["thongbaodagiao_xem"].ToString() == "False")
                {
                    temp = 0;
                }
                else
                {
                    temp = 1;
                }
                ItemThongBao item = new ItemThongBao(Int32.Parse(row["trigia"].ToString()),
                                                     row["sohd"].ToString(), DateTime.Parse(row["thoigianxacnhan"].ToString())
                                                     , row["trangthai"].ToString(), row["masp"].ToString(), temp);
                listThongBao.Add(item);
            }
            return(listThongBao);
        }
Esempio n. 2
0
 public ucThongBaoDonHang(ItemThongBao thongbao, Form_Infor parent)
 {
     InitializeComponent();
     this.parent = parent;
     _masp       = thongbao.Masp;
     _mahd       = thongbao.Madh;
     if (thongbao.Checknew == 1)
     {
         picNew.Visible = false;
     }
     this.lblTime.Text = thongbao.ThoiGian.ToString("dd/MM/yyyy");
     if (thongbao.TrangThai == "dang giao hang")
     {
         lblTitle.Text = "Đơn hàng #" + thongbao.Madh + " đang được giao đến bạn, " +
                         "chuẩn bị số tiền " + Data.Instance.giaFix(thongbao.Tien) + " để thanh toán";
         picTrangThai.Image = BuyGear.Properties.Resources.B_danggiao;
     }
     else
     {
         lblTitle.Text = "Đơn hàng #" + thongbao.Madh + " đã hoàn tất giao đến bạn, " +
                         "tổng giá trị đơn hàng " + Data.Instance.giaFix(thongbao.Tien);
         picTrangThai.Image = BuyGear.Properties.Resources.B_dagiao;
     }
 }