コード例 #1
0
        public void ADD(string nazvanie, string fioglbuha, string adres, string email)
        {
            hotel pac = new hotel();

            pac.nazvanie  = nazvanie;
            pac.fioglbuha = fioglbuha;
            pac.adres     = adres;
            pac.email     = email;
            dbhotel.hotel.InsertOnSubmit(pac);
            dbhotel.SubmitChanges();
        }
コード例 #2
0
 public void Edit(int id, string nazvanie, string fioglbuha, string adres, string email)
 {
     try
     {
         hotel pac = dbhotel.hotel.Where(c => c.id == id).FirstOrDefault();
         pac.nazvanie  = nazvanie;
         pac.fioglbuha = fioglbuha;
         pac.adres     = adres;
         pac.email     = email;
         dbhotel.SubmitChanges();
     }
     catch (NullReferenceException)
     {
         ADD(nazvanie, fioglbuha, adres, email);
     }
 }