Ejemplo n.º 1
0
        protected void gridBangGia_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            string TenBangGia = e.NewValues["TenBangGia"].ToString();

            data = new dtBangGia();
            object ID = data.ThemMoi(TenBangGia);

            if (ID != null)
            {
                dtHangHoa hh = new dtHangHoa();
                DataTable db = hh.LayDanhSachHangHoa();
                foreach (DataRow dr in db.Rows)
                {
                    string IDHangHoa = dr["ID"].ToString();
                    string GiaBan    = dr["GiaBan"].ToString();
                    data = new dtBangGia();
                    data.ThemIDHangHoaVaoChiTietGia(IDHangHoa, ID, GiaBan);
                }
            }
            e.Cancel = true;
            gridBangGia.CancelEdit();
            LoadGrid();
        }
Ejemplo n.º 2
0
 private void LoadGrid()
 {
     data = new dtHangHoa();
     gridHangHoa.DataSource = data.LayDanhSachHangHoa();
     gridHangHoa.DataBind();
 }
Ejemplo n.º 3
0
 private void LoadGrid()
 {
     data = new dtHangHoa();
     gridHangHoa.DataSource = data.LayDanhSachHangHoa(Session["IDChiNhanh"].ToString());
     gridHangHoa.DataBind();
 }