Exemplo n.º 1
0
 public static void PopulateActionTypeItemList(IDataReader dr, ActionTypeItem _actionTypeItem)
 {
     _actionTypeItem.ActionID          = (int)dr["actionid"];
     _actionTypeItem.ActionCode        = dr["actioncode"] as string;
     _actionTypeItem.ActionDescription = dr["actiondescription"] as string;
     _actionTypeItem.IsDisplayed       = (bool)dr["isdisplayed"];
 }
        public override List <ActionTypeItem> GetActionTypeItemList()
        {
            List <ActionTypeItem> list = new List <ActionTypeItem>();

            using (SqlConnection connection = this.GetSqlConnection())
            {
                string     cmdText = "select * from SuCommerce_ActionTypes where IsDisplayed = 1";
                SqlCommand command = new SqlCommand(cmdText, connection)
                {
                    CommandType = CommandType.Text
                };
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    ActionTypeItem item = null;
                    while (reader.Read())
                    {
                        item = new ActionTypeItem();
                        CommerceDataProvider.PopulateActionTypeItemList(reader, item);
                        list.Add(item);
                    }
                    reader.Close();
                    connection.Close();
                }
            }
            return(list);
        }