Example #1
0
        public void Delete(int id)
        {
            jurnalnomera pac = dbjurnalnomera.jurnalnomera.Where(c => c.id == id).FirstOrDefault();

            dbjurnalnomera.jurnalnomera.DeleteOnSubmit(pac);
            dbjurnalnomera.SubmitChanges();
        }
Example #2
0
 public void ADD(string nalichbroni, int idbroni, int idnomera, int idclienta, DateTime datazaezda, DateTime dataviezda)
 {
     if ("Да" == nalichbroni)
     {
         jurnalnomera pac = new jurnalnomera();
         pac.nalichbroni = nalichbroni;
         pac.idbroni     = idbroni;
         pac.idnomera    = idnomera;
         pac.idclienta   = idclienta;
         pac.datazaezda  = datazaezda;
         pac.dataviezda  = dataviezda;
         dbjurnalnomera.jurnalnomera.InsertOnSubmit(pac);
         dbjurnalnomera.SubmitChanges();
     }
     else
     {
         jurnalnomera pac = new jurnalnomera();
         pac.nalichbroni = nalichbroni;
         pac.idnomera    = idnomera;
         pac.idclienta   = idclienta;
         pac.datazaezda  = datazaezda;
         pac.dataviezda  = dataviezda;
         dbjurnalnomera.jurnalnomera.InsertOnSubmit(pac);
         dbjurnalnomera.SubmitChanges();
     }
 }
Example #3
0
        public void Edit(int id, string nalichbroni, int idbroni, int idnomera, int idclienta, DateTime datazaezda, DateTime dataviezda)
        {
            jurnalnomera pac = dbjurnalnomera.jurnalnomera.Where(c => c.id == id).FirstOrDefault();

            pac.id          = id;
            pac.nalichbroni = nalichbroni;
            pac.idbroni     = idbroni;
            pac.idnomera    = idnomera;
            pac.idclienta   = idclienta;
            pac.datazaezda  = datazaezda;
            pac.dataviezda  = dataviezda;
            dbjurnalnomera.SubmitChanges();
        }