Пример #1
0
        public bool ThemThuaDatThayDoiTrongBienDongDuBi(string MaDangKyBienDong, string MaSoThuaDat, string NoiDungKhac)
        {
            try
            {
                long _maTD = long.Parse(MaSoThuaDat);
                tblThuaDat ThuaGoc = db.tblThuaDats.SingleOrDefault(n => n.MaThuaDat == _maTD);
                if (ThuaGoc != null)
                {
                    long _maBD = long.Parse(MaDangKyBienDong);
                    tblThuaDatThayDoiTrongBienDongDuBi thuamoi = new tblThuaDatThayDoiTrongBienDongDuBi();
                    thuamoi.MaDangKyBienDong = _maBD;
                    thuamoi.ToBanDo = ThuaGoc.ToBanDo;
                    thuamoi.SoThua = ThuaGoc.SoThua;
                    thuamoi.DienTich = ThuaGoc.DienTich;
                    thuamoi.NoiDungThayDoiKhac = NoiDungKhac;

                    db.tblThuaDatThayDoiTrongBienDongDuBis.Add(thuamoi);
                    db.SaveChanges();

                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception)
            {

                return false;
            }
        }
Пример #2
0
        public bool ThemThuaDatThayDoiTrongBienDongDuBi(string MaDangKyBienDong, string ToBanDo, string SoThua, string DienTich, string NoiDungKhac, string ToBanDo2, string SoThua2, string DienTich2, string NoiDungThayDoiKhac2)
        {
            try
            {
                long _maBD = long.Parse(MaDangKyBienDong);
                tblThuaDatThayDoiTrongBienDongDuBi thuamoi = new tblThuaDatThayDoiTrongBienDongDuBi();
                thuamoi.MaDangKyBienDong = _maBD;
                thuamoi.ToBanDo = ToBanDo;
                thuamoi.SoThua = SoThua;
                thuamoi.DienTich = DienTich;
                thuamoi.NoiDungThayDoiKhac = NoiDungKhac;

                thuamoi.ToBanDoMoi = ToBanDo2;
                thuamoi.SoThuaMoi = SoThua2;
                thuamoi.DienTichMoi = DienTich2;
                thuamoi.NoiDungThayDoiKhacMoi = NoiDungThayDoiKhac2;

                db.tblThuaDatThayDoiTrongBienDongDuBis.Add(thuamoi);
                db.SaveChanges();

                return true;
            }
            catch (Exception)
            {

                return false;
            }
        }