protected void Page_Load(object sender, EventArgs e) { try { string madh = Request.QueryString["MaDH"].ToString(); List <DTOChiTietDH> dsCTDH = daoEntities.LayDSChiTietDH(madh); //XuLy_TiepNhanDonHang control = new XuLy_TiepNhanDonHang(); //control.laychitietdh(madh); GridView1.DataSource = dsCTDH; GridView1.DataBind(); int tongtien = 0; foreach (DTOChiTietDH dtoChiTiet in dsCTDH) { tongtien += dtoChiTiet.ThanhTien; } lbTongTien.Text = tongtien.ToString(); lbTongSP.Text = dsCTDH.Count.ToString(); } catch { Response.Write("<script>alert('Loi tai du lieu!')</script>"); } if (IsPostBack == false) { string maDH = Request.QueryString["MaDH"].ToString(); DTODonDatHang dtoDH = daoEntities.LayDHTheoMa(maDH); lbMadh.Text = dtoDH.MaDH.ToString(); lbMaKH.Text = dtoDH.MaKH.ToString(); tenKH.Text = dtoDH.TenKH.ToString(); if (GridView1.Rows.Count != 0 && dtoDH.TongTien != 0) { btLuuCt.Visible = false; } else { //lbTong.Visible = false; //txtTongtien.Visible = false; btLuuCt.Visible = true; } int sum = GridView1.Rows.Count; } }
protected void Page_Load(object sender, EventArgs e) { try { if (IsPostBack == false) { if (Request.QueryString["MaDH"] != null) { string maDH = Request.QueryString["MaDH"].ToString(); DTODonDatHang dtoDH = daoEntities.LayDonHangTraHang(maDH); lbMaDH.Text = dtoDH.MaDH.ToString(); lbMaKH.Text = dtoDH.MaKH.ToString(); lbTenKH.Text = dtoDH.TenKH.ToString(); List <DTOChiTietDH> dsChiTietDonHang = daoEntities.LayDSChiTietDH(maDH); gridChiTietDonHang.DataSource = dsChiTietDonHang; gridChiTietDonHang.DataBind(); gridDSCanTra.DataSource = dsChiTietDonHang; gridDSCanTra.DataBind(); int tongtien = 0; foreach (DTOChiTietDH dtoCT in dsChiTietDonHang) { tongtien += dtoCT.ThanhTien; } lbTongTienDaDat.Text = tongtien.ToString(); } } } catch { Response.Write("<script>alert('Loi tai du lieu!')</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { string maDH = Request.QueryString["MaDH"].ToString(); Xuly_PhanboThanhPham control = new Xuly_PhanboThanhPham(); control.LayDonHangTheoMa(maDH); DAO_Entity daoDH = new DAO_Entity(); DTODonDatHang dtoDH = daoDH.LayDHTheoMa(maDH); lbMaDH.Text = dtoDH.MaDH.ToString(); lbKH.Text = dtoDH.MaKH.ToString(); } try { string madh = Request.QueryString["MaDH"].ToString(); Xuly_PhanboThanhPham control = new Xuly_PhanboThanhPham(); control.LayCTDH(madh); DAO_Entity daokh = new DAO_Entity(); List <DTOChiTietDH> dtoct = daokh.LayDSChiTietDH(madh); GridView1.DataSource = dtoct; GridView1.DataBind(); List <DTOXuLyPhieuGiao> dto = daokh.LayDSPhieuGiao(madh); GridView3.DataSource = dto; GridView3.DataBind(); control.LayDSkhosp(); List <DTOKhoSP> dtok = daokh.LayDSKhoSP(); GridView2.DataSource = dtok; GridView2.DataBind(); } catch { Response.Write("<script>alert('Loi tai du lieu!')</script>"); } }
public void LayCTDH(string ma) { DAO_Entity dao = new DAO_Entity(); dao.LayDSChiTietDH(ma); }
//ThemNhapThanhPham public void layCT_DonHang(string ma) { DAO_Entity dao = new DAO_Entity(); dao.LayDSChiTietDH(ma); }