Ejemplo n.º 1
0
        /// <summary>
        /// 批量导入银行美容活动用户规则
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="table"></param>
        /// <returns></returns>
        internal bool BatchImportBankMRActivityUsers(SqlConnection conn, IEnumerable <BankMRActivityUser> list)
        {
            var dt = new DataTable {
                TableName = "Tuhu_groupon.dbo.BankMRActivityUsers"
            };

            dt.Columns.Add(new DataColumn("ActivityRoundId", typeof(int)));
            dt.Columns.Add(new DataColumn("BankCardNum", typeof(string)));
            dt.Columns.Add(new DataColumn("Mobile", typeof(string)));
            dt.Columns.Add(new DataColumn("OtherNum", typeof(string)));
            dt.Columns.Add(new DataColumn("LimitCount", typeof(int)));
            dt.Columns.Add(new DataColumn("DayLimit", typeof(int)));
            dt.Columns.Add(new DataColumn("BatchCode", typeof(string)));
            list?.ToList().ForEach(item =>
            {
                var row = dt.NewRow();
                row["ActivityRoundId"] = item.ActivityRoundId;
                row["BankCardNum"]     = item.BankCardNum;
                row["Mobile"]          = item.Mobile;
                row["OtherNum"]        = item.OtherNum;
                row["LimitCount"]      = item.LimitCount;
                row["DayLimit"]        = item.DayLimit;
                row["BatchCode"]       = item.BatchCode;
                dt.Rows.Add(row);
            });
            return(BankMRActivityDal.BatchImportBankMRActivityUsers(conn, dt));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 批量导入银行活动白名单
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        internal bool BatchImportBankActivityWhiteUsers(SqlConnection conn, IEnumerable <BankActivityWhiteUsers> list)
        {
            var dt = new DataTable {
                TableName = "Tuhu_groupon.dbo.BankActivityWhiteUsers"
            };

            dt.Columns.Add(new DataColumn("GroupConfigId", typeof(int)));
            dt.Columns.Add(new DataColumn("CardNum", typeof(string)));
            dt.Columns.Add(new DataColumn("Mobile", typeof(string)));
            list?.ToList().ForEach(item =>
            {
                var row = dt.NewRow();
                row["GroupConfigId"] = item.GroupConfigId;
                row["CardNum"]       = item.CardNum;
                row["Mobile"]        = item.Mobile;
                dt.Rows.Add(row);
            });
            return(BankMRActivityDal.BatchImportBankMRActivityUsers(conn, dt));
        }