public static void delete(int id) { using (publishEntities context = new publishEntities()) { publish obj = context.publishes.First(x => x.Id == id); context.publishes.Remove(obj); context.SaveChanges(); } }
public static void EditUpdate(int id, String place, String date1, String publisher) { using (publishEntities context = new publishEntities()) { publish obj = context.publishes.First(x => x.Id == id); obj.publication_place = place; obj.publication_date = date1; obj.publisher = publisher; context.SaveChanges(); } }
public static void registernew(String uname, String upass) { using (publishEntities context = new publishEntities()) { register obj = new register(); obj.username = uname; obj.password = upass; context.registers.Add(obj); context.SaveChanges(); } }