Esempio n. 1
0
    public static int Member_Register(clsMember m)
    {
        MySqlInsert ins = new MySqlInsert(TABLE_MEMBER);

        foreach (var prop in m.GetType().GetProperties())
        {
            ins.Add(prop.Name, prop.GetValue(m, null));
        }

        string cmdSql = ins.ToString();

        return(MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false));
    }
Esempio n. 2
0
    public static int Painter_SaveStep(clsPainter p)
    {
        MySqlInsert ins = new MySqlInsert(TABLE_PAINTER);

        foreach (var prop in p.GetType().GetProperties())
        {
            ins.Add(prop.Name, prop.GetValue(p, null));
        }

        string cmdSql = ins.ToString();

        return(MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false));
    }
Esempio n. 3
0
        private static InsertOperation GetOperation(MapperDb db)
        {
            InsertOperation operation;

            switch (db.DatabaseType)
            {
            case DatabaseType.SqlServer:
                operation = new SqlServerInsert();
                break;

            case DatabaseType.MySql:
                operation = new MySqlInsert();
                break;

            default:
                operation = new PostgreSQLInsert();
                break;
            }

            return(operation);
        }
Esempio n. 4
0
        public ErrorCode_ _createAccount(string nAccountName, string nNickname, string nPassward)
        {
            AccountB accountB_ = new AccountB();

            accountB_._setAccountName(nAccountName);
            accountB_._setNickName(nNickname);
            accountB_._setPassward(nPassward);
            accountB_._setMgrId(mId);
            accountB_._setTicks(DateTime.Now.Ticks);

            MySqlInsert mySqlInsert_ = new MySqlInsert();

            mySqlInsert_._selectStream(accountB_._streamName());
            accountB_._serialize(mySqlInsert_);

            MySqlSingleton mySqlSingleton_ = __singleton <MySqlSingleton> ._instance();

            SqlStatus_ sqlStatus_ = mySqlSingleton_._runSql(mySqlInsert_);

            return(_getErrorCode(sqlStatus_));
        }
Esempio n. 5
0
    public static int Painter_UploadImage(JObject jobj)
    {
        MySqlInsert ins = new MySqlInsert(TABLE_PAINTER_UPLOAD);

        Dictionary<string, object> values = JsonConvert.DeserializeObject<Dictionary<string, object>>(jobj.ToString());

        foreach (var val in values)
        {
            ins.Add(val.Key, val.Value);
        }

        ins.Remove("user_id");
        ins.Remove("user_name");
        ins.Remove("data");
        ins.Remove("filename");

        string cmdSql = ins.ToString();

        return MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false);
    }
Esempio n. 6
0
    public static int Painter_SaveStep(clsPainter p)
    {
        MySqlInsert ins = new MySqlInsert(TABLE_PAINTER);

        foreach (var prop in p.GetType().GetProperties())
        {
            ins.Add(prop.Name, prop.GetValue(p, null));
        }

        string cmdSql = ins.ToString();

        return MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false);
    }
Esempio n. 7
0
    public static int Painter_Save(clsPainter obj)
    {
        MySqlInsert ins = new MySqlInsert(TABLE_PAINTER);

        foreach (var prop in obj.GetType().GetProperties())
        {
            if (prop.Name == "left" || prop.Name == "type")
                ins.Add("`" + prop.Name + "`", prop.GetValue(obj, null));
            else
                ins.Add(prop.Name, prop.GetValue(obj, null));
        }

        string cmdSql = ins.ToString();

        return MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false);
    }
Esempio n. 8
0
    public static int Order_Create(JObject jobj)
    {
        MySqlInsert ins = new MySqlInsert("`" + TABLE_ORDER + "`");

        Dictionary<string, object> values = JsonConvert.DeserializeObject<Dictionary<string, object>>(jobj.ToString());

        foreach (var val in values)
        {
            ins.Add(val.Key, val.Value);
        }

        string cmdSql = ins.ToString();

        return MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false);
    }
Esempio n. 9
0
    public static int Member_Register(clsMember m)
    {
        if (m.zipcode.Length == 0) m.zipcode = "000";

        MySqlInsert ins = new MySqlInsert(TABLE_MEMBER);

        foreach (var prop in m.GetType().GetProperties())
        {
            ins.Add(prop.Name, prop.GetValue(m, null));
        }

        ins.Remove("verify");

        string cmdSql = ins.ToString();

        return MySqlDbAccess.ExecuteNonQueryInt(cmdSql, false);
    }