Exemple #1
0
        private void frmChiTietSanPham_Load(object sender, EventArgs e)
        {
            try
            {
                lblMaSP.Text = "CHI TIẾT CỦA SẢN PHẨM MÃ: " + info[0];
                clsSanPham_DTO sp = clsSanPham_BUS.Retrieve_SanPham(info[0]);
                lblSLTK.Text  = Program.convertToCurrency(Convert.ToInt32(info[1])) + " cái";
                lblTenSP.Text = sp.TenSP;

                List <clsNhaSanXuat_DTO> nsx = clsNhaSanXuat_BUS.LayDSNSX(sp.MaNhaSX);
                lblNSX.Text = nsx[0].TenNhaSX;

                clsMau_DTO mau = clsMau_BUS.LayMau(info[2]);
                lblMau.Text = mau.TenMau;

                clsSize_DTO size = clsSize_BUS.LaySize(info[3]);
                lblSize.Text = size.TenSize;

                clsChatLieu_DTO CL = clsChatLieu_BUS.LayDSChatLieu(info[4]);
                lblChatLieu.Text = CL.TenChatLieu;

                clsLoaiSanPham_DTO loai = clsLoaiSanPham_BUS.Retrieve_LoaiSanPham(sp.MaLoaiSP);
                lblLoaiSP.Text = loai.TenLoaiSP;

                lblGiaBan.Text = Program.convertToCurrency(Convert.ToInt32(info[5])) + " VNĐ / cái";

                lblNgayNhap.Text = sp.NgayNhapKho.ToString("dd/MM/yyyy");

                picHinhAnh.Image = Image.FromFile(info[6]);
            }
            catch (Exception ex)
            {
            }
        }
Exemple #2
0
        public static List <clsSize_DTO> Retrieve_Size(string condition)
        {
            List <clsSize_DTO> dsSize = new List <clsSize_DTO>();
            string             sql    = @"select * from Size where trangthai = 1";
            SqlDataReader      dr     = DataProvider.Retrieve_Table(sql);

            while (dr.Read())
            {
                clsSize_DTO size = new clsSize_DTO();
                if (!dr.IsDBNull(0))
                {
                    size.MaSize = (string)dr["MaSize"];
                }
                if (!dr.IsDBNull(1))
                {
                    size.TenSize = (string)dr["TenSize"];
                }
                if (!dr.IsDBNull(2))
                {
                    size.TrangThai = (Boolean)dr["TrangThai"];
                }
                dsSize.Add(size);
            }
            DataProvider.CloseConnect();
            return(dsSize);
        }
Exemple #3
0
        public static clsSize_DTO LaySize(string maSize)
        {
            clsSize_DTO   size = new clsSize_DTO();
            string        sql  = string.Format("select * from Size where trangthai = 1 and MaSize = '{0}'", maSize);
            SqlDataReader dr   = DataProvider.Retrieve_Table(sql);

            if (dr.Read())
            {
                if (!dr.IsDBNull(0))
                {
                    size.MaSize = (string)dr["MaSize"];
                }
                if (!dr.IsDBNull(1))
                {
                    size.TenSize = (string)dr["TenSize"];
                }
                if (!dr.IsDBNull(2))
                {
                    size.TrangThai = (Boolean)dr["TrangThai"];
                }
            }
            DataProvider.CloseConnect();
            return(size);
        }