예제 #1
0
        public int themhoadon(eHDBanSi hdbs)
        {
            if (kiemtra(hdbs.maHD))
            {
                return(0);
            }
            Tbl_HDBanSi n = new Tbl_HDBanSi();

            n.maHD    = hdbs.maHD;
            n.maKH    = hdbs.maKH;
            n.maNV    = hdbs.maNV;
            n.ngayLap = Convert.ToDateTime(hdbs.ngayLap);
            n.ghiChu  = hdbs.ghiChu;
            db.Tbl_HDBanSis.InsertOnSubmit(n);
            db.SubmitChanges();
            //Tbl_CTHDBanSi si = new Tbl_CTHDBanSi();
            //si.maHD = ctbs.maHD;
            //si.maSP = si.maSP;
            //si.soluong = ctbs.soluong;
            //si.ghiChu = ctbs.ghiChu;
            //si.dongiaBan =Convert.ToInt16(ctbs.dongiaBan);
            //db.Tbl_CTHDBanSis.InsertOnSubmit(si);
            //db.SubmitChanges();
            return(1);
        }
예제 #2
0
        public bool kiemtra1(string nv, string kh)
        {
            Tbl_HDBanSi r = db.Tbl_HDBanSis.Where(x => x.maNV == nv && x.maKH == kh).FirstOrDefault();

            if (r != null)
            {
                return(true);
            }
            return(false);
        }
예제 #3
0
        public bool kiemtra(string ma)
        {
            Tbl_HDBanSi r = db.Tbl_HDBanSis.Where(x => x.maHD == ma).FirstOrDefault();

            if (r != null)
            {
                return(true);
            }
            return(false);
        }
예제 #4
0
 public static eHDBanSi e(Tbl_HDBanSi p)
 {
     return(new eHDBanSi(p.maHD, Convert.ToString(p.ngayLap), p.maKH, Convert.ToString(p.maNV), p.ghiChu));
 }