Example #1
0
        public string send(string _json)
        {
            string   _return = String.Empty;
            SqlTrans _trans  = new SqlTrans(api);

            try
            {
                string[] _kv = MConvert.toKV(_json), _owners = MConvert.getValue(_json, "owners").Split(',');
                _trans.execNonQuery(MString.getInsertStr(T_EMAIL_USER, _kv[0] + ", type", _kv[1] + ", " + TYPE_SEND));
                string _link = MConvert.getValue(_json, "link");
                if (_link.Length > 1)
                {
                    _link = "1";
                }
                else
                {
                    _link = "0";
                }
                for (int i = 0, _len = _owners.Length; i < _len; i++)
                {
                    string _uid = _owners[i];
                    if (Native.isEmpty(_uid))
                    {
                        continue;
                    }
                    _trans.execNonQuery(MString.getInsertStr(T_PREFIX + _uid, _kv[0] + ", type, ifAttach", _kv[1] + ", " + TYPE_EMAIL + ", " + _link));
                }
                _trans.commit();
            }
            catch (Exception e)
            {
                _return = Native.getErrorMsg(e.Message);
                _trans.rollback();
            }
            finally {
                _trans.close();
            }
            return(_return);
        }
Example #2
0
 public string updateByID(string _json, int _id)
 {
     return(api.execQuery(MString.getUpdateStr(T_EMAIL_USER, MConvert.toUpdateSql(_json), "id=" + _id)));
 }
Example #3
0
 public string saveAsCopy(string _json)
 {
     string [] _kv = MConvert.toKV(_json);
     return(api.execQuery(MString.getInsertStr(T_EMAIL_USER, _kv[0] + ", type", _kv[1] + ", " + TYPE_COPY)));
 }