private void Save_Data(bool msg)
 {
     try
     {
         _KTLCTGRepo = new KTLCTGRepo();
         int i = 0;
         foreach (int pos in _listUpdate)
         {
             int id = Utils.CIntDef(gridView1.GetRowCellValue(pos, "ID"), 0);
             KT_LCTG obj = _KTLCTGRepo.GetById(id);
             if (obj != null)
             {
                 obj.ID_LOAI = Utils.CStrDef(gridView1.GetRowCellValue(pos, "ID_LOAI"), "");
                 obj.TEN_CT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TEN_CT"), "");
                 obj.TK_THUE = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_THUE"), "");
                 obj.CO_TK_DU_TK_THUE = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_TK_DU_TK_THUE"), "");
                 obj.CO_THUE_GTGT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_THUE_GTGT"), "");
                 obj.CO_HANG_HOA = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_HANG_HOA"), "");
                 obj.SERI_HD = Utils.CStrDef(gridView1.GetRowCellValue(pos, "SERI_HD"), "");
                 obj.LOAI_TIEN = Utils.CStrDef(gridView1.GetRowCellValue(pos, "LOAI_TIEN"), "");
                 obj.SO_CT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "SO_CT"), "");
                 obj.SO_HD = Utils.CStrDef(gridView1.GetRowCellValue(pos, "SO_HD"), "");
                 obj.CO_XUAT_KHO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_XUAT_KHO"), "");
                 obj.CO_NHIEU_HD = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_NHIEU_HD"), "");
                 //obj.MAN_HINH = Utils.CStrDef(gridView1.GetRowCellValue(pos, "MAN_HINH"), "");
                 obj.TK_NO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_NO"), "");
                 obj.TK_CO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_CO"), "");
                 //obj.VONG_LAP = Utils.CStrDef(gridView1.GetRowCellValue(pos, "VONG_LAP"), "");
                 obj.TK_THUE_NK = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_THUE_NK"), "");
                 //obj.HAM_IN = Utils.CStrDef(gridView1.GetRowCellValue(pos, "HAM_IN"), "");
                 obj.CO_UN_CHI = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_UN_CHI"), "");
                 obj.CO_XK_CUM = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_XK_CUM"), "");
                 obj.NGUOI_GD = Utils.CStrDef(gridView1.GetRowCellValue(pos, "NGUOI_GD"), "");
                 obj.CO_VUNG_BAN = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_VUNG_BAN"), "");
                 obj.CO_DON_TRONG = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_DON_TRONG"), "");
                 obj.CO_LO_NHAP = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_LO_NHAP"), "");
                 obj.FILE_MAU = Utils.CStrDef(gridView1.GetRowCellValue(pos, "FILE_MAU"), "");
                 obj.NHIEU_LIEN = Utils.CStrDef(gridView1.GetRowCellValue(pos, "NHIEU_LIEN"), "");
                 obj.CLTG = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CLTG"), "");
                 obj.HOI_IN = Utils.CStrDef(gridView1.GetRowCellValue(pos, "HOI_IN"), "");
                 obj.DIEN_GIAI = Utils.CStrDef(gridView1.GetRowCellValue(pos, "DIEN_GIAI"), "");
                 obj.SO_DONG_IN = Utils.CIntDef(gridView1.GetRowCellValue(pos, "SO_DONG_IN"), 0);
                 obj.MA_TIEP_THI = Utils.CStrDef(gridView1.GetRowCellValue(pos, "MA_TIEP_THI"), "");
                 obj.NHIEU_DV = Utils.CStrDef(gridView1.GetRowCellValue(pos, "NHIEU_DV"), "");
                 obj.CO_DIEN_GIAI2 = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_DIEN_GIAI2"), "");
                 obj.CO_CK = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_CK"), "");
                 obj.TK_CLTG_LAI = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_CLTG_LAI"), "");
                 obj.TK_CLTG_LO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_CLTG_LO"), "");
                 obj.CO_CHUYEN_KHO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_CHUYEN_KHO"), "");
                 obj.CO_TIEN_HANG = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_TIEN_HANG"), "");
                 obj.CO_FORM_RIENG = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_FORM_RIENG"), "");
                 obj.CO_CK_TRUOC = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_CK_TRUOC"), "");
                 obj.CO_DV_PHU = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_DV_PHU"), "");
                 obj.CO_QUY_CACH = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_QUY_CACH"), "");
                 obj.CO_PHE_LIEU = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_PHE_LIEU"), "");
                 obj.CO_MS_KH = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_MS_KH"), "");
                 obj.LOAI_THUE = Utils.CStrDef(gridView1.GetRowCellValue(pos, "LOAI_THUE"), "");
                 //obj.CO_DG_NHAP = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_DG_NHAP"), "");
                 obj.MA_DTPN_NO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "MA_DTPN_NO"), "");
                 obj.MA_DTPN_CO = Utils.CStrDef(gridView1.GetRowCellValue(pos, "MA_DTPN_CO"), "");
                 obj.CO_THUE_TTDB = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_THUE_TTDB"), "");
                 obj.NHIEU_USER = Utils.CStrDef(gridView1.GetRowCellValue(pos, "NHIEU_USER"), "");
                 obj.TRANG_THAI = Utils.CIntDef(gridView1.GetRowCellValue(pos, "TRANG_THAI"), 0);
                 obj.CO_TK_XUAT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_TK_XUAT"), "");
                 obj.TK_XUAT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_XUAT"), "");
                 obj.TK_GIA_VON = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TK_GIA_VON"), "");
                 obj.NHOM_CT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "NHOM_CT"), "");
                 //obj.NHOM_DS_COT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "NHOM_DS_COT"), "");
                 obj.TS_GTGT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "TS_GTGT"), "");
                 obj.KIEU_CONGTY = Utils.CStrDef(gridView1.GetRowCellValue(pos, "KIEU_CONGTY"), "");
                 obj.CO_CK_TM = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_CK_TM"), "");
                 obj.CO_CK_TT = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_CK_TT"), "");
                 obj.CO_VANCHUYEN = Utils.CStrDef(gridView1.GetRowCellValue(pos, "CO_VANCHUYEN"), "");
                 
                 _KTLCTGRepo.Update(obj);
                 i++;
             }
         }
         _listUpdate = new List<int>();
         //if (i > 0 && msg)
         //{
         //    MessageBox.Show("Lưu thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         //}
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        private void gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;
                _KTLCTGRepo = new KTLCTGRepo();
                //Kiểm tra đây là dòng dữ liệu mới hay cũ, nếu là mới thì mình insert
                if (view.IsNewItemRow(e.RowHandle))
                {
                    //e.RowHandle trả về giá trị int là thứ tự của dòng hiện tại
                    KT_LCTG obj = new KT_LCTG();
                    obj.ID_LOAI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "ID_LOAI"), "");
                    obj.TEN_CT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TEN_CT"), "");
                    obj.TK_THUE = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_THUE"), "");
                    obj.CO_TK_DU_TK_THUE = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_TK_DU_TK_THUE"), "");
                    obj.CO_THUE_GTGT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_THUE_GTGT"), "");
                    obj.CO_HANG_HOA = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_HANG_HOA"), "");
                    obj.SERI_HD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "SERI_HD"), "");
                    obj.LOAI_TIEN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "LOAI_TIEN"), "");
                    obj.SO_CT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "SO_CT"), "");
                    obj.SO_HD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "SO_HD"), "");
                    obj.CO_XUAT_KHO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_XUAT_KHO"), "");
                    obj.CO_NHIEU_HD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_NHIEU_HD"), "");
                    //obj.MAN_HINH = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MAN_HINH"), "");
                    obj.TK_NO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_NO"), "");
                    obj.TK_CO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_CO"), "");
                    //obj.VONG_LAP = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "VONG_LAP"), "");
                    obj.TK_THUE_NK = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_THUE_NK"), "");
                    //obj.HAM_IN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "HAM_IN"), "");
                    obj.CO_UN_CHI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_UN_CHI"), "");
                    obj.CO_XK_CUM = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_XK_CUM"), "");
                    obj.NGUOI_GD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NGUOI_GD"), "");
                    obj.CO_VUNG_BAN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_VUNG_BAN"), "");
                    obj.CO_DON_TRONG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DON_TRONG"), "");
                    obj.CO_LO_NHAP = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_LO_NHAP"), "");
                    obj.FILE_MAU = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "FILE_MAU"), "");
                    obj.NHIEU_LIEN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHIEU_LIEN"), "");
                    obj.CLTG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CLTG"), "");
                    obj.HOI_IN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "HOI_IN"), "");
                    obj.DIEN_GIAI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "DIEN_GIAI"), "");
                    obj.SO_DONG_IN = Utils.CIntDef(view.GetRowCellValue(e.RowHandle, "SO_DONG_IN"), 0);
                    obj.MA_TIEP_THI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MA_TIEP_THI"), "");
                    obj.NHIEU_DV = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHIEU_DV"), "");
                    obj.CO_DIEN_GIAI2 = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DIEN_GIAI2"), "");
                    obj.CO_CK = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK"), "");
                    obj.TK_CLTG_LAI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_CLTG_LAI"), "");
                    obj.TK_CLTG_LO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_CLTG_LO"), "");
                    obj.CO_CHUYEN_KHO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CHUYEN_KHO"), "");
                    obj.CO_TIEN_HANG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_TIEN_HANG"), "");
                    obj.CO_FORM_RIENG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_FORM_RIENG"), "");
                    obj.CO_CK_TRUOC = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK_TRUOC"), "");
                    obj.CO_DV_PHU = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DV_PHU"), "");
                    obj.CO_QUY_CACH = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_QUY_CACH"), "");
                    obj.CO_PHE_LIEU = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_PHE_LIEU"), "");
                    obj.CO_MS_KH = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_MS_KH"), "");
                    obj.LOAI_THUE = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "LOAI_THUE"), "");
                    //obj.CO_DG_NHAP = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DG_NHAP"), "");
                    obj.MA_DTPN_NO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MA_DTPN_NO"), "");
                    obj.MA_DTPN_CO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MA_DTPN_CO"), "");
                    obj.CO_THUE_TTDB = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_THUE_TTDB"), "");
                    obj.NHIEU_USER = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHIEU_USER"), "");
                    obj.TRANG_THAI = Utils.CIntDef(view.GetRowCellValue(e.RowHandle, "TRANG_THAI"), 0);
                    obj.CO_TK_XUAT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_TK_XUAT"), "");
                    obj.TK_XUAT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_XUAT"), "");
                    obj.TK_GIA_VON = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_GIA_VON"), "");
                    obj.NHOM_CT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHOM_CT"), "");
                    //obj.NHOM_DS_COT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHOM_DS_COT"), "");
                    obj.TS_GTGT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TS_GTGT"), "");
                    obj.KIEU_CONGTY = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "KIEU_CONGTY"), "");
                    obj.CO_CK_TM = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK_TM"), "");
                    obj.CO_CK_TT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK_TT"), "");
                    obj.CO_VANCHUYEN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_VANCHUYEN"), "");

                    _KTLCTGRepo.Create(obj);

                }
                //Cũ thì update
                else
                {
                    int id = Utils.CIntDef(view.GetRowCellValue(e.RowHandle, "ID"), 0);
                    KT_LCTG obj = _KTLCTGRepo.GetById(id);
                    if (obj != null)
                    {
                        obj.ID_LOAI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "ID_LOAI"), "");
                        obj.TEN_CT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TEN_CT"), "");
                        obj.TK_THUE = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_THUE"), "");
                        obj.CO_TK_DU_TK_THUE = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_TK_DU_TK_THUE"), "");
                        obj.CO_THUE_GTGT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_THUE_GTGT"), "");
                        obj.CO_HANG_HOA = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_HANG_HOA"), "");
                        obj.SERI_HD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "SERI_HD"), "");
                        obj.LOAI_TIEN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "LOAI_TIEN"), "");
                        obj.SO_CT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "SO_CT"), "");
                        obj.SO_HD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "SO_HD"), "");
                        obj.CO_XUAT_KHO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_XUAT_KHO"), "");
                        obj.CO_NHIEU_HD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_NHIEU_HD"), "");
                        //obj.MAN_HINH = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MAN_HINH"), "");
                        obj.TK_NO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_NO"), "");
                        obj.TK_CO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_CO"), "");
                        //obj.VONG_LAP = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "VONG_LAP"), "");
                        obj.TK_THUE_NK = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_THUE_NK"), "");
                        //obj.HAM_IN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "HAM_IN"), "");
                        obj.CO_UN_CHI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_UN_CHI"), "");
                        obj.CO_XK_CUM = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_XK_CUM"), "");
                        obj.NGUOI_GD = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NGUOI_GD"), "");
                        obj.CO_VUNG_BAN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_VUNG_BAN"), "");
                        obj.CO_DON_TRONG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DON_TRONG"), "");
                        obj.CO_LO_NHAP = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_LO_NHAP"), "");
                        obj.FILE_MAU = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "FILE_MAU"), "");
                        obj.NHIEU_LIEN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHIEU_LIEN"), "");
                        obj.CLTG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CLTG"), "");
                        obj.HOI_IN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "HOI_IN"), "");
                        obj.DIEN_GIAI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "DIEN_GIAI"), "");
                        obj.SO_DONG_IN = Utils.CIntDef(view.GetRowCellValue(e.RowHandle, "SO_DONG_IN"), 0);
                        obj.MA_TIEP_THI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MA_TIEP_THI"), "");
                        obj.NHIEU_DV = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHIEU_DV"), "");
                        obj.CO_DIEN_GIAI2 = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DIEN_GIAI2"), "");
                        obj.CO_CK = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK"), "");
                        obj.TK_CLTG_LAI = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_CLTG_LAI"), "");
                        obj.TK_CLTG_LO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_CLTG_LO"), "");
                        obj.CO_CHUYEN_KHO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CHUYEN_KHO"), "");
                        obj.CO_TIEN_HANG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_TIEN_HANG"), "");
                        obj.CO_FORM_RIENG = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_FORM_RIENG"), "");
                        obj.CO_CK_TRUOC = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK_TRUOC"), "");
                        obj.CO_DV_PHU = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DV_PHU"), "");
                        obj.CO_QUY_CACH = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_QUY_CACH"), "");
                        obj.CO_PHE_LIEU = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_PHE_LIEU"), "");
                        obj.CO_MS_KH = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_MS_KH"), "");
                        obj.LOAI_THUE = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "LOAI_THUE"), "");
                        //obj.CO_DG_NHAP = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_DG_NHAP"), "");
                        obj.MA_DTPN_NO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MA_DTPN_NO"), "");
                        obj.MA_DTPN_CO = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "MA_DTPN_CO"), "");
                        obj.CO_THUE_TTDB = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_THUE_TTDB"), "");
                        obj.NHIEU_USER = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHIEU_USER"), "");
                        obj.TRANG_THAI = Utils.CIntDef(view.GetRowCellValue(e.RowHandle, "TRANG_THAI"), 0);
                        obj.CO_TK_XUAT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_TK_XUAT"), "");
                        obj.TK_XUAT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_XUAT"), "");
                        obj.TK_GIA_VON = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TK_GIA_VON"), "");
                        obj.NHOM_CT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHOM_CT"), "");
                        //obj.NHOM_DS_COT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "NHOM_DS_COT"), "");
                        obj.TS_GTGT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "TS_GTGT"), "");
                        obj.KIEU_CONGTY = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "KIEU_CONGTY"), "");
                        obj.CO_CK_TM = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK_TM"), "");
                        obj.CO_CK_TT = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_CK_TT"), "");
                        obj.CO_VANCHUYEN = Utils.CStrDef(view.GetRowCellValue(e.RowHandle, "CO_VANCHUYEN"), "");

                        _KTLCTGRepo.Update(obj);
                    }
                }
                Load_Data();
            }
            catch (Exception ex)
            {
                e.Valid = false;
                MessageBox.Show(ex.Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }