public virtual void Remove(LUONG_DANHSACH b)
 {
     try
     {
         db.LUONG_DANHSACHes.DeleteOnSubmit(b);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Remove(int id)
 {
     try
     {
         LUONG_DANHSACH b = this.GetById(id);
         this.Remove(b);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Create(LUONG_DANHSACH cus)
 {
     try
     {
         this.db.LUONG_DANHSACHes.InsertOnSubmit(cus);
         db.SubmitChanges();
     }
     catch //(Exception e)
     {
         //throw new Exception(e.Message);
     }
 }
 public virtual void Remove(LUONG_DANHSACH b)
 {
     try
     {
         db.LUONG_DANHSACHes.DeleteOnSubmit(b);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Create(LUONG_DANHSACH cus)
 {
     try
     {
         this.db.LUONG_DANHSACHes.InsertOnSubmit(cus);
         db.SubmitChanges();
     }
     catch //(Exception e)
     {
         //throw new Exception(e.Message);
     }
 }
 public virtual void Update(LUONG_DANHSACH cus)
 {
     try
     {
         LUONG_DANHSACH cusOld = this.GetById(cus.ID);
         cusOld = cus;
         db.SubmitChanges();
     }
     catch //(Exception e)
     {
         //throw new Exception(e.Message);
     }
 }
 public virtual void Update(LUONG_DANHSACH cus)
 {
     try
     {
         LUONG_DANHSACH cusOld = this.GetById(cus.ID);
         cusOld = cus;
         db.SubmitChanges();
     }
     catch //(Exception e)
     {
         //throw new Exception(e.Message);
     }
 }
Ejemplo n.º 8
0
        private void Save_Data(int _year, int _month, int _phongban)
        {
            _DoanhThuSPData.RemoveByPhongBan(_year, _month, _phongban); //Xóa doanh thu có phòng ban đã chọn
            _BangLuongData.RemoveByYearMonth(_year, _month, _phongban); //Xóa bảng lương có phòng ban đã chọn
            var list = _UserRepo.GetByGroupBangLuong(_phongban);

            foreach (var u in list)
            {
                LUONG_DANHSACH i = new LUONG_DANHSACH();

                //Lưu doanh thu trước
                if (Utils.CIntDef(u.GROUP_ID, 0) == 3 || Utils.CIntDef(u.GROUP_ID, 0) == 9 || Utils.CIntDef(u.GROUP_ID, 0) == 14)
                {
                    Save_DoanhThuSp(Utils.CIntDef(u.GROUP_ID, 0), Utils.CIntDef(u.USER_ID, 0)
                                    , u.USER_UN, _year, _month, Utils.CIntDef(txtTyLeLuongSP.Text));
                }
                i.BL_MANV              = u.USER_UN;
                i.BL_TENNV             = u.USER_NAME;
                i.BL_THANG             = month;
                i.BL_NAM               = year;
                i.BL_LUONG_CB          = u.USER_LUONG_CB;
                i.BL_DT_SPDV           = getDanhThuAll(_year, _month, u.USER_UN);
                i.BL_LUONG_SP          = getLuongSPAll(_year, _month, u.USER_UN);
                i.BL_LUONG_DA_TV       = getDatvAll(_year, _month, u.USER_UN);
                i.BL_PC_THUONG         = null;
                i.BL_PC_KHAC           = null;
                i.BL_BHXH              = u.USER_BHXH;
                i.BL_BHYT              = u.USER_BHYT;
                i.BL_BHTN              = u.USER_BHTN;
                i.BL_KHAUTRU_KHAC      = null;
                i.BL_THUNHAP_TRUOCTHUE = null;
                i.BL_TAMUNG            = null;
                i.BL_LUONG_THUCNHAN    = null;
                i.BL_PHONGBAN          = u.GROUP_ID;
                _BangLuongData.Create(i);
            }
        }
        private void Save_Data(int _year, int _month, int _phongban)
        {
            _DoanhThuSPData.RemoveByPhongBan(_year, _month, _phongban);//Xóa doanh thu có phòng ban đã chọn
            _BangLuongData.RemoveByYearMonth(_year, _month, _phongban);//Xóa bảng lương có phòng ban đã chọn
            var list = _UserRepo.GetByGroupBangLuong(_phongban);
            foreach(var u in list)
            {
                LUONG_DANHSACH i = new LUONG_DANHSACH();

                //Lưu doanh thu trước
                if (Utils.CIntDef(u.GROUP_ID, 0) == 3 || Utils.CIntDef(u.GROUP_ID, 0) == 9 || Utils.CIntDef(u.GROUP_ID, 0) == 14)
                {
                    Save_DoanhThuSp(Utils.CIntDef(u.GROUP_ID, 0), Utils.CIntDef(u.USER_ID, 0)
                        , u.USER_UN, _year, _month, Utils.CIntDef(txtTyLeLuongSP.Text));
                }
                i.BL_MANV = u.USER_UN;
                i.BL_TENNV = u.USER_NAME;
                i.BL_THANG = month;
                i.BL_NAM = year;
                i.BL_LUONG_CB = u.USER_LUONG_CB;
                i.BL_DT_SPDV = getDanhThuAll(_year, _month, u.USER_UN);
                i.BL_LUONG_SP = getLuongSPAll(_year, _month, u.USER_UN);
                i.BL_LUONG_DA_TV = getDatvAll(_year, _month, u.USER_UN);
                i.BL_PC_THUONG = null;
                i.BL_PC_KHAC = null;
                i.BL_BHXH = u.USER_BHXH;
                i.BL_BHYT = u.USER_BHYT;
                i.BL_BHTN = u.USER_BHTN;
                i.BL_KHAUTRU_KHAC = null;
                i.BL_THUNHAP_TRUOCTHUE = null;
                i.BL_TAMUNG = null;
                i.BL_LUONG_THUCNHAN = null;
                i.BL_PHONGBAN = u.GROUP_ID;
                _BangLuongData.Create(i);
            }
        }