示例#1
0
        /// <summary>
        /// 获取插入表CT_Comm_History的SQL列表
        /// </summary>
        /// <param name="UType"></param>
        /// <param name="AD_OM_Code"></param>
        /// <param name="Query"></param>
        /// <param name="CG_EV_Code"></param>
        /// <param name="_m"></param>
        /// <param name="time"></param>
        /// <param name="type"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        private string GetCommSql(int UType, int AD_OM_Code, string Query, int CG_EV_Code, string _m, DateTime time, int type, out int count)
        {
            string[] Users  = GetUserCode(Query, "AU_Code").Distinct().ToArray();
            string[] Method = GetMethod(_m);
            string   sql    = string.Empty;
            int      _count = 0;

            for (int u = 0; u < Users.Length; u++)
            {
                for (int m = 0; m < Method.Length; m++)
                {
                    if (CheckHistoryRecords(Method[m], Users[u], CG_EV_Code.ToString()) > 0)
                    {
                        continue;
                    }
                    string[] _c = GetUserCommunication(Users[u]);
                    for (int c = 0; c < _c.Length; c++)
                    {
                        if (_c[c].Trim() != "-1")
                        {
                            sql += "INSERT INTO CT_Comm_History VALUES(" + UType + "," + AD_OM_Code + "," + Method[m] + ","
                                   + _c[c] + "," + Users[u] + "," + type + "," + CG_EV_Code + "," + DataConfiguration.GetPTY(type) + ",0,'" + time + "');";
                            _count++;
                        }
                    }
                }
            }
            count = _count;
            return(sql);
        }