Esempio n. 1
0
        public override ModelBase ColumnMapper(DataTable dt)
        {
            HeckGuild item = new HeckGuild();

            item.ID          = Convert.ToInt32(dt.Rows[0][0]);
            item.Snowflake   = Convert.ToString(dt.Rows[0][1]);
            item.CreatedDate = Convert.ToDateTime(dt.Rows[0][2]);
            return(item);
        }
Esempio n. 2
0
        public DataResponse GetGuildBySnowflake(string Snowflake)
        {
            DataResponse resp = null;
            DataTable    dt   = null;
            //create query
            string query = string.Format("select * from `heckguild` where DiscordSnowflake = '{0}'", Snowflake);

            if (RunQuery(query, out dt))
            {
                HeckGuild item = ColumnMapper(dt) as HeckGuild;
                resp      = new DataResponse("Heck guild Found", true);
                resp.Item = item;
            }
            else
            {
                resp = new DataResponse("Heck guild not found by snowflake (" + Snowflake + ").", false);
            }
            return(resp);
        }