public static void DeleteModelShoes(long modelshoes_id) { ModelShoes modelShoes = Global.ListModelShoes.Where(model => model.ModelShoes_ID == modelshoes_id).SingleOrDefault(); Global.ModelShoesBLL.Delete(modelShoes); Global.ListModelShoes.Remove(modelShoes); }
public void Create(ref ModelShoes modelShoes) { using (MyShoeStoreEntities myShoeStoreEntities = new MyShoeStoreEntities()) { modelShoes.Status = 1; modelShoes = myShoeStoreEntities.ModelShoes.Add(modelShoes); myShoeStoreEntities.SaveChanges(); } }
public static void CreateModel(string nameShoese, int company_id, int type_id) { ModelShoes model = new ModelShoes(); model.NameShoese = nameShoese; model.CompanyID = company_id; model.TypeID = type_id; Global.ModelShoesBLL.Create(ref model); Global.ListModelShoes.Add(model); }
public void Delete(ModelShoes modelShoes) { try { using (MyShoeStoreEntities myShoeStoreEntities = new MyShoeStoreEntities()) { Console.WriteLine("Delete(ModelShoes modelShoes)"); modelShoes.Status = 0; myShoeStoreEntities.ModelShoes.AddOrUpdate(modelShoes); if (myShoeStoreEntities.SaveChanges() != 1) { throw new Exception(); } } } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } }