public static int Save(Entity.Inventory.StockLocation stockLocation) { int rowsAffacted = 0; using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString())) { using (SqlCommand cmd = new SqlCommand()) { cmd.Connection = con; cmd.CommandText = "usp_Inventory_StockLocation_Save"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@StockLocationId", stockLocation.StockLocationId); cmd.Parameters.AddWithValue("@InventoryId", stockLocation.InventoryId); cmd.Parameters.AddWithValue("@StoreId", stockLocation.StoreId); if (con.State == ConnectionState.Closed) { con.Open(); } rowsAffacted = cmd.ExecuteNonQuery(); con.Close(); } } return(rowsAffacted); }
public int Save(Entity.Inventory.StockLocation stockLocation) { return(DataAccess.Inventory.StockLocation.Save(stockLocation)); }