Esempio n. 1
0
        //không cần tạo mã

        //insert
        public bool Insert(string MaDS, string MaDL, int SoPhieuX, int TongTG, int TyLe)
        {
            DOANHSO_DAILY temp = new DOANHSO_DAILY();

            temp.MaBaoCaoDoanhSo = MaDS;
            temp.MaDaiLy         = MaDL;

            temp.SoPhieuXuat = SoPhieuX;
            temp.TongTriGia  = TongTG;
            temp.TyLe        = TyLe;

            return(DoanhSo_DaiLyDAO.Instance.Insert(temp));
        }
Esempio n. 2
0
        //không phải Create Code


        //insert
        public bool Insert(DOANHSO_DAILY ds)
        {
            using (QLDLDataContext db = new QLDLDataContext())
            {
                try
                {
                    db.DOANHSO_DAILies.InsertOnSubmit(ds);
                    db.SubmitChanges();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
        }
Esempio n. 3
0
        //update
        public bool Update(string MaDS, string MaDL, DOANHSO_DAILY ds)
        {
            using (QLDLDataContext db = new QLDLDataContext())
            {
                DOANHSO_DAILY temp = db.DOANHSO_DAILies.Where(p => p.MaBaoCaoDoanhSo == MaDS && p.MaDaiLy == MaDL).FirstOrDefault();

                temp.SoPhieuXuat = ds.SoPhieuXuat;
                temp.TongTriGia  = ds.TongTriGia;
                temp.TyLe        = ds.TyLe;

                try
                {
                    db.SubmitChanges();
                    return(true);
                }
                catch
                {
                    return(false);
                }
            }
        }
Esempio n. 4
0
 //Updadte
 public bool Update(string MaDS, string MaDL, DOANHSO_DAILY ds)
 {
     return(DoanhSo_DaiLyDAO.Instance.Update(MaDS, MaDL, ds));
 }