public void DeleteSertificate(int sertificateNum) { using (db) { Sertificate sert = db.Sertificates .Where(o => o.Id == sertificateNum) .FirstOrDefault(); db.Sertificates.Remove(sert); db.SaveChanges(); } }
public void AddSertificate(int SertNum, Boolean shown) { BDContext db = new BDContext(); using (db) { Sertificate value = new Sertificate(); value.SertificateNumber = SertNum; value.Shown = shown; db.Sertificates.Add(value); db.SaveChanges(); } }
public void AddUsersValues(int Min, int Max) { BDContext db = new BDContext(); using (db) { UsersValue value = new UsersValue(); value.min = Min; value.max = Max; db.UsersValues.Add(value); db.SaveChanges(); } }
public void AddAgeCategories(int Min, int Max) { BDContext db = new BDContext(); using (db) { AgeCategory first = new AgeCategory(); first.min = Min; first.max = Max; db.AgeCategories.Add(first); db.SaveChanges(); } }
public void AddTimeCategories(string day, int start, int finish) { BDContext db = new BDContext(); using (db) { TimeCategory value = new TimeCategory(); value.Day = day; value.Start = start; value.Finish = finish; db.TimeCategories.Add(value); db.SaveChanges(); } }
public void AddStatus(int IDOrder, int IDTime, int IDKvestRoom) { BDContext db = new BDContext(); using (db) { Status value = new Status(); value.TimeCategoryId = IDTime; value.OrderId = IDOrder; value.KvestRoomId = IDKvestRoom; value.Id = find.FindLastIdStatus() + 1; db.Statuses.Add(value); db.SaveChanges(); } }
public void AddKvestRoom(string RoomName, int IDUsersValue, int IDAge, int OnePrice) { BDContext db = new BDContext(); using (db) { KvestRoom value = new KvestRoom(); value.Name = RoomName; value.UsersValueId = IDUsersValue; value.AgeCategory = IDAge; value.PriceForOneUser = OnePrice; db.KvestRooms.Add(value); db.SaveChanges(); } }