/// <summary>
        /// charu
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public async Task <bool> Insert2(IList <T_MySql_Order> t_MySql_Orders)
        {
            //先获取动态表名
            var tableName = MysqlTableName.GetMySqlOrderTableName();

            return(await base.InsertAsync(_scope, new { tableName, t_MySql_Orders = t_MySql_Orders }, "Insert2") > 0);
        }
        /// <summary>
        /// charu
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        public async Task <bool> Insert(T_MySql_Order t_MySql_Order)
        {
            //先获取动态表名
            var tableName = MysqlTableName.GetMySqlOrderTableName();

            return(await base.InsertAsync(_scope, new { tableName, t_MySql_Order.OUTSYS_ORDER_NO, t_MySql_Order.OUTSYS_BILL_CODE, t_MySql_Order.ORDER_SOURCE, t_MySql_Order.MSG_CONTENT, t_MySql_Order.MSG_TYPE, t_MySql_Order.REMARK, t_MySql_Order.IS_SYNC_SUCCESS, t_MySql_Order.CREATE_BY, t_MySql_Order.CREATE_TIME, C1 = "", C2 = "", C3 = "" }) > 0);
        }
        public async Task <bool> Delete(IDictionary <string, object> parameters)
        {
            //先获取动态表名
            var tableName = MysqlTableName.GetMySqlOrderTableName();

            parameters.Add("tableName", tableName);
            return(await base.DeleteAsync(_scope, parameters) > 0);
        }
        public async Task <IEnumerable <T_MySql_Order> > Query(IDictionary <string, object> parameters)
        {
            //先获取动态表名
            var tableName = MysqlTableName.GetMySqlOrderTableName();

            parameters.Add("tableName", tableName);

            return(await base.GetListAsync <T_MySql_Order>(_scope, parameters, "Query"));
        }
Пример #5
0
        protected virtual object CreateMysqlOrderParams(T_MySql_Order mysqlOrder)
        {
            #region 拼接动态类型的对象作为参数传递
            ////获取动态表名
            //var tableName = MysqlTableName.GetMySqlOrderTableName();
            ////声明动态对象
            //dynamic dyObj = new System.Dynamic.ExpandoObject();
            //var jObj = JObject.FromObject(mySqlOrder);
            //var jTokenPair = jObj.Children().ToArray();
            //foreach (var jToken in jTokenPair)
            //{
            //    var pair = (JProperty)jToken;
            //    ((IDictionary<string, object>)dyObj).Add(pair.Name, pair.Value);
            //}
            //((IDictionary<string, object>)dyObj).Add("tableName", tableName);
            //var json = JsonConvert.SerializeObject((object)dyObj);
            //var parameters = JsonConvert.DeserializeObject(json);
            #endregion

            var tableName  = MysqlTableName.GetMySqlOrderTableName();
            var parameters = new
            {
                tableName,
                mysqlOrder.OUTSYS_ORDER_NO,
                mysqlOrder.OUTSYS_BILL_CODE,
                mysqlOrder.ORDER_SOURCE,
                mysqlOrder.MSG_CONTENT,
                mysqlOrder.MSG_TYPE,
                mysqlOrder.REMARK,
                mysqlOrder.IS_SYNC_SUCCESS,
                mysqlOrder.CREATE_BY,
                mysqlOrder.CREATE_TIME,
                C1 = "",
                C2 = "",
                C3 = ""
            };
            return(parameters);
        }