Ejemplo n.º 1
0
 public bool AddOrderStatusByStoreId(List<string> list,int storeId )
 {
     var context = new orderstatusEntities();
     try
     {
         foreach (var statusId in list)
         {
             order_status_by_store orderStatusByStore = new order_status_by_store();
             orderStatusByStore.order_status_value = int.Parse(statusId.ToString());
             orderStatusByStore.storeid = storeId;
             orderStatusByStore.date_created = DateTime.Now;
             orderStatusByStore.date_modified = DateTime.Now;
             orderStatusByStore.is_valid = 1;
             context.order_status_by_store.AddObject(orderStatusByStore);
             context.SaveChanges();
         }
         return true;
     }
     catch (InvalidOperationException exc)
     {
         AccessConnectionHandler.log.Error(exc);
         return false;
     }
     catch (ArgumentNullException exc)
     {
         AccessConnectionHandler.log.Error(exc);
         return false;
     }
     catch (NullReferenceException exc)
     {
         AccessConnectionHandler.log.Error(exc);
         return false;
     }
     catch (OptimisticConcurrencyException exc)
     {
         AccessConnectionHandler.log.Error(exc);
         return false;
     }
     catch (UpdateException exc)
     {
         AccessConnectionHandler.log.Error(exc);
         return false;
     }
     finally
     {
         context.Dispose();
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the order_status_by_store EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToorder_status_by_store(order_status_by_store order_status_by_store)
 {
     base.AddObject("order_status_by_store", order_status_by_store);
 }
 /// <summary>
 /// Create a new order_status_by_store object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="storeid">Initial value of the storeid property.</param>
 /// <param name="order_status_value">Initial value of the order_status_value property.</param>
 public static order_status_by_store Createorder_status_by_store(global::System.Int32 id, global::System.Int32 storeid, global::System.Int32 order_status_value)
 {
     order_status_by_store order_status_by_store = new order_status_by_store();
     order_status_by_store.id = id;
     order_status_by_store.storeid = storeid;
     order_status_by_store.order_status_value = order_status_value;
     return order_status_by_store;
 }