コード例 #1
0
        public static void DeleteTypeShoes(int typeshoes_id)
        {
            TypeShoe typeShoe = Global.ListTypeShoe.Where(t => t.Type_ID == typeshoes_id).SingleOrDefault();

            Global.TypeShoesBLL.Delete(typeShoe);
            Global.ListTypeShoe.Remove(typeShoe);
        }
コード例 #2
0
 public void Delete(TypeShoe typeShoe)
 {
     try
     {
         using (MyShoeStoreEntities myShoeStoreEntities = new MyShoeStoreEntities())
         {
             Console.WriteLine("Delete(int id)");
             typeShoe.Status = 0;
             myShoeStoreEntities.TypeShoe.AddOrUpdate(typeShoe);
             if (myShoeStoreEntities.SaveChanges() != 1)
             {
                 throw new Exception();
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         throw;
     }
 }
コード例 #3
0
 public TypeShoe Create(string typeName)
 {
     try
     {
         using (MyShoeStoreEntities myShoeStoreEntities = new MyShoeStoreEntities())
         {
             Console.WriteLine("Create(string typeName)");
             TypeShoe typeShoe = new TypeShoe();
             typeShoe.TypeName = typeName;
             typeShoe.Status   = 1;
             typeShoe          = myShoeStoreEntities.TypeShoe.Add(typeShoe);
             myShoeStoreEntities.SaveChanges();
             return(typeShoe);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         throw;
     }
 }
コード例 #4
0
 public void AddComboboxTypeShoes(TypeShoe typeShoe)
 {
     _cbType.Items.Add(typeShoe);
 }