コード例 #1
0
        public void Delete(int ID)
        {
            Nastroiki pac = db8.Nastroiki.Where(c => c.ID == ID).FirstOrDefault();

            db8.Nastroiki.DeleteOnSubmit(pac);
            db8.SubmitChanges();
        }
コード例 #2
0
        public void ADD(string login, string pass)
        {
            Nastroiki pac = new Nastroiki();

            pac.login = login;
            pac.pass  = pass;
            db8.Nastroiki.InsertOnSubmit(pac);
            db8.SubmitChanges();
        }
コード例 #3
0
 public void Edit(int ID, string login, string pass)
 {
     try
     {
         Nastroiki pac = db8.Nastroiki.Where(c => c.ID == ID).FirstOrDefault();
         pac.login = login;
         pac.pass  = pass;
         db8.SubmitChanges();
     }
     catch (NullReferenceException)
     {
         Nastroiki pac = new Nastroiki();
         pac.ID    = ID;
         pac.login = login;
         pac.pass  = pass;
         db8.Nastroiki.InsertOnSubmit(pac);
         db8.SubmitChanges();
     }
 }