Beispiel #1
0
        public void SetTrungTamHTSS(TrungTamHTSS tthtss)
        {
            dtb_profile tt = new dtb_profile();

            tt.name    = tthtss.TenTrungTam;
            tt.email   = tthtss.Email;
            tt.address = tthtss.DiaChi;
            tt.phone   = tthtss.SoDienThoai;
            tt.website = tthtss.Website;
            tt.code    = tthtss.MaTTHTSS;

            db.dtb_profiles.InsertOnSubmit(tt);
            db.SubmitChanges();
        }
Beispiel #2
0
        public TrungTamHTSS GetTrungTamHTSS()
        {
            if (db.dtb_profiles.Any())
            {
                dtb_profile  tt     = (from s in db.dtb_profiles select s).ToList()[0];
                TrungTamHTSS tthtss = new TrungTamHTSS();
                tthtss.Id          = tt.id;
                tthtss.TenTrungTam = tt.name;
                tthtss.Email       = tt.email;
                tthtss.DiaChi      = tt.address;
                tthtss.SoDienThoai = tt.phone;
                tthtss.Website     = tt.website;
                tthtss.MaTTHTSS    = tt.code;

                return(tthtss);
            }
            else
            {
                return(null);
            }
        }