コード例 #1
0
 private void getInfoPN(ref phieunhap phieu)
 {
     phieu.maphieunhap  = edt_maphieunhap.Text;
     phieu.ngaynhap     = datepicker_ngaynhap.Value.ToString("MM/dd/yyyy");
     phieu.manv         = int.Parse(cmb_nv.SelectedValue.ToString());
     phieu.thanhtien    = float.Parse(edt_tongtien.Text.ToString());
     phieu.manhacungcap = int.Parse(cmb_nhacungcap.SelectedValue.ToString());
 }
コード例 #2
0
        public static void ThemPhieuNhap(phieunhap info)
        {
            string q = "insert into PHIEUNHAPKHO(maphieunhap,ngaynhap,manv,thanhtien,manhacungcap) VALUES" +
                       " ('@MAPHIEUNHAP','@NGAYNHAP','@MANV','@THANHTIEN','@MANHACUNGCAP');";

            q = q.Replace("@MAPHIEUNHAP", info.maphieunhap);
            q = q.Replace("@NGAYNHAP", info.ngaynhap.ToString());
            q = q.Replace("@MANV", info.manv.ToString());
            q = q.Replace("@THANHTIEN", info.thanhtien.ToString());
            q = q.Replace("@MANHACUNGCAP", info.manhacungcap.ToString());

            DataProvider.query(q);
        }
コード例 #3
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            List <ctphieunhap> list = new List <ctphieunhap>();

            createListCTNHAP(ref list);

            phieunhap pn = new phieunhap();

            getInfoPN(ref pn);
            pn.ThemPhieuNhap();

            ctphieunhap ctpn = new ctphieunhap();

            ctpn.ThemCTPhieuNhap(list);
        }