protected void btnLuu_Click(object sender, EventArgs e) { DTOCongNoVatLieu dtovl = new DTOCongNoVatLieu(); dtovl.MaPDVLCC = int.Parse(lbMPD.Text); dtovl.MaNCC = int.Parse(lbNCC.Text); dtovl.MaNV = int.Parse(TextBox1.Text); dtovl.NgayTraNo = Convert.ToDateTime(lbNTT.Text); dtovl.Sotien = int.Parse(TextBox2.Text); DAO_Entity dao = new DAO_Entity(); dao.ThemCongNoNCC(dtovl); DTOPhieuDatVatLieuCC dtopd = new DTOPhieuDatVatLieuCC(); dtopd.MaPDVLCC = lbMPD.Text; int tong = int.Parse(lbTong.Text); int no = int.Parse(TextBox2.Text); dtopd.CongNoNCC = tong - no; dao.CapNhatCongNoNCC(dtopd); Response.Redirect("~/QLBoPhan_VatLieu/QLCongNoNCC/DanhSachCongNo.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { string maPD = Request.QueryString["MaPDVLCC"].ToString(); DAO_Entity daoPD = new DAO_Entity(); DTOPhieuDatVatLieuCC dtoDH = daoPD.LayTTPhieuDatTheoMa(maPD); lbMPD.Text = dtoDH.MaPDVLCC.ToString(); lbNCC.Text = dtoDH.dtoncc.MaNCC.ToString(); lbTenNCC.Text = dtoDH.TenNCC.ToString(); lbNTT.Text = DateTime.Now.ToShortDateString(); lbTong.Text = dtoDH.CongNoNCC.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["maPhieu"] != null) { string maPhieu = Request.QueryString["maPhieu"].ToString(); List <DTOChiTietPhieuDatNCC> DSChitietPhieuDat = daoEntities.layDSVatLieuDaDat(maPhieu); gridDSVatLieu.DataSource = DSChitietPhieuDat; gridDSVatLieu.DataBind(); DTOPhieuDatVatLieuCC dtoPhieudat = DSChitietPhieuDat[0].PhieuDat; MaPhieuDat.Text = dtoPhieudat.MaPDVLCC; lbNgayNhap.Text = DateTime.Now.ToShortDateString(); } } }