Пример #1
0
        /// <summary>
        /// 得到数据
        /// </summary>
        public string ConSql(AF_User Model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("User_LoginName = '" + ValueHandler.GetStringValue(Model.User_LoginName) + "', ");

            strSql.Append("User_Password = '******', ");

            strSql.Append("User_Name = '" + ValueHandler.GetStringValue(Model.User_Name) + "', ");

            strSql.Append("User_Sex = '" + ValueHandler.GetStringValue(Model.User_Sex) + "', ");

            strSql.Append("User_Age = " + ValueHandler.GetIntNumberValue(Model.User_Age) + ", ");

            strSql.Append("User_Phone = '" + ValueHandler.GetStringValue(Model.User_Phone) + "', ");

            strSql.Append("User_Post = '" + ValueHandler.GetStringValue(Model.User_Post) + "', ");

            strSql.Append("User_EntryDate = " + ValueHandler.GetMarkStringDateValue(Model.User_EntryDate) + ", ");

            strSql.Append("User_Place = '" + ValueHandler.GetStringValue(Model.User_Place) + "', ");

            strSql.Append("JoinMan = '" + ValueHandler.GetStringValue(Model.JoinMan) + "' ");
            return(strSql.ToString());
        }
Пример #2
0
        /// <summary>
        /// 得到数据
        /// </summary>
        public string GetCXT_Customer(CXT_Customer Model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("Cust_Name = '" + ValueHandler.GetStringValue(Model.Cust_Name) + "', ");

            strSql.Append("Cust_OldName = '" + ValueHandler.GetStringValue(Model.Cust_OldName) + "', ");

            strSql.Append("Cust_NameKey = '" + ValueHandler.GetStringValue(Model.Cust_NameKey) + "', ");

            strSql.Append("Cust_Phone = '" + ValueHandler.GetStringValue(Model.Cust_Phone) + "', ");

            strSql.Append("Cust_Linkman = '" + ValueHandler.GetStringValue(Model.Cust_Linkman) + "', ");

            strSql.Append("Cust_LinkPhone = '" + ValueHandler.GetStringValue(Model.Cust_LinkPhone) + "', ");

            strSql.Append("Cust_ProvinceCode = '" + ValueHandler.GetStringValue(Model.Cust_ProvinceCode) + "', ");

            strSql.Append("Cust_ProvinceName = '" + ValueHandler.GetStringValue(Model.Cust_ProvinceName) + "', ");

            strSql.Append("Cust_CityCode = '" + ValueHandler.GetStringValue(Model.Cust_CityCode) + "', ");

            strSql.Append("Cust_CityName = '" + ValueHandler.GetStringValue(Model.Cust_CityName) + "', ");

            strSql.Append("Cust_CountyCode = '" + ValueHandler.GetStringValue(Model.Cust_CountyCode) + "', ");

            strSql.Append("Cust_CountyName = '" + ValueHandler.GetStringValue(Model.Cust_CountyName) + "', ");

            strSql.Append("Cust_Address = '" + ValueHandler.GetStringValue(Model.Cust_Address) + "', ");

            strSql.Append("Cust_IsBill = '" + ValueHandler.GetStringValue(Model.Cust_IsBill) + "', ");

            strSql.Append("Cust_BillMoney = " + ValueHandler.GetIntNumberValue(Model.Cust_BillMoney) + ", ");

            strSql.Append("Cust_BillNumber = '" + ValueHandler.GetStringValue(Model.Cust_BillNumber) + "', ");

            strSql.Append("Cust_Nature = '" + ValueHandler.GetStringValue(Model.Cust_Nature) + "', ");

            strSql.Append("Cust_KFVoice = '" + ValueHandler.GetStringValue(Model.Cust_KFVoice) + "', ");

            strSql.Append("Cust_Source = '" + ValueHandler.GetStringValue(Model.Cust_Source) + "', ");

            strSql.Append("Cust_OpenDate = " + ValueHandler.GetMarkStringDateValue(Model.Cust_OpenDate) + ", ");

            strSql.Append("Cust_WH_Remark = '" + ValueHandler.GetStringValue(Model.Cust_WH_Remark) + "', ");

            strSql.Append("Cust_WH_UserName = '******', ");

            strSql.Append("Cust_State = '" + ValueHandler.GetStringValue(Model.Cust_State) + "', ");

            string NowTime = DateTime.Now.ToString();

            strSql.Append("Cust_OperateTime = '" + NowTime + "', ");

            strSql.Append("Cust_IsView = " + ValueHandler.GetIntNumberValue(Model.Cust_IsView) + "");

            return(strSql.ToString());
        }
Пример #3
0
        /// <summary>
        /// 获取资讯信息数量
        /// </summary>
        /// <param name="Pub_LS_Code1">移动端Code</param>
        /// <param name="Pub_LS_Code2">平台名称Code</param>
        /// <param name="Pub_LS_Code3">信息大类Code</param>
        /// <param name="Pub_Title">标题</param>
        /// <param name="Pub_Code">Code</param>
        /// <param name="Pub_LS_Code4">4级节点(信息小类)</param>
        /// <param name="Pub_SA_Code1">省</param>
        /// <param name="Pub_SA_Code2">市</param>
        /// <param name="Pub_SA_Code3">区</param>
        /// <param name="BeginTime">开始时间</param>
        /// <param name="EndTime">结束时间</param>
        /// <param name="PageIndex">当前页码</param>
        /// <param name="PageNum">每页显示数据量</param>
        /// <returns>数据量</returns>
        public string GetDataCount(string Pub_LS_Code1, string Pub_LS_Code2, string Pub_LS_Code3, string Pub_Title, string Pub_Code, string Pub_LS_Code4, string Pub_SA_Code1, string Pub_SA_Code2, string Pub_SA_Code3, string BeginTime, string EndTime, string PageIndex, string PageNum)
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("SELECT COUNT(Pub_Code) AS 'DataCount' FROM XXSD_PublicInfo P LEFT JOIN XXSD_LevelSet L1 ON P.Pub_LS_Code3=L1.LS_Code LEFT JOIN XXSD_LevelSet L2 ON P.Pub_LS_Code4=L2.LS_Code WHERE 1=1");
            if (ValueHandler.GetStringValue(Pub_LS_Code1) != "")
            {
                sql.AppendFormat(" AND P.Pub_LS_Code1 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code1));
            }
            if (ValueHandler.GetStringValue(Pub_LS_Code2) != "")
            {
                sql.AppendFormat(" AND P.Pub_LS_Code2 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code2));
            }
            if (ValueHandler.GetStringValue(Pub_LS_Code3) != "")
            {
                sql.AppendFormat(" AND P.Pub_LS_Code3 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code3));
            }
            if (ValueHandler.GetStringValue(Pub_LS_Code4) != "")
            {
                sql.AppendFormat(" AND P.Pub_LS_Code4 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code4));
            }
            if (ValueHandler.GetStringValue(Pub_SA_Code1) != "")
            {
                sql.AppendFormat(" AND P.Pub_SA_Code1 = '{0}'", ValueHandler.GetStringValue(Pub_SA_Code1));
            }
            if (ValueHandler.GetStringValue(Pub_SA_Code2) != "")
            {
                sql.AppendFormat(" AND P.Pub_SA_Code2 = '{0}'", ValueHandler.GetStringValue(Pub_SA_Code2));
            }
            if (ValueHandler.GetStringValue(Pub_SA_Code3) != "")
            {
                sql.AppendFormat(" AND P.Pub_SA_Code3 = '{0}'", ValueHandler.GetStringValue(Pub_SA_Code3));
            }
            if (ValueHandler.GetStringValue(Pub_Title) != "")
            {
                sql.AppendFormat(" AND P.Pub_Title LIKE '%{0}%'", ValueHandler.GetStringValue(Pub_Title));
            }
            if (ValueHandler.GetMarkStringDateValue(BeginTime) != "" && ValueHandler.GetMarkStringDateValue(BeginTime) != "null" && ValueHandler.GetMarkStringDateValue(BeginTime) != null)
            {
                sql.AppendFormat(" AND P.JoinDate >= '{0}'", ValueHandler.GetStringValue(BeginTime));
            }
            if (ValueHandler.GetMarkStringDateValue(EndTime) != "" && ValueHandler.GetMarkStringDateValue(EndTime) != "null" && ValueHandler.GetMarkStringDateValue(EndTime) != null)
            {
                sql.AppendFormat(" AND P.JoinDate <= '{0}'", ValueHandler.GetStringValue(EndTime));
            }
            DataTable dt = SearchData(sql.ToString());

            if (dt.Rows.Count > 0)
            {
                return(dt.Rows[0]["DataCount"].ToString());
            }
            else
            {
                return("0");
            }
        }
Пример #4
0
        /// <summary>
        /// 获取资讯信息
        /// </summary>
        /// <param name="Pub_LS_Code1">移动端Code</param>
        /// <param name="Pub_LS_Code2">平台名称Code</param>
        /// <param name="Pub_LS_Code3">信息大类Code</param>
        /// <param name="Pub_Title">标题</param>
        /// <param name="Pub_Code">Code</param>
        /// <param name="Pub_LS_Code4">4级节点(信息小类)</param>
        /// <param name="Pub_SA_Code1">省</param>
        /// <param name="Pub_SA_Code2">市</param>
        /// <param name="Pub_SA_Code3">区</param>
        /// <param name="BeginTime">开始时间</param>
        /// <param name="EndTime">结束时间</param>
        /// <param name="PageIndex">当前页码</param>
        /// <param name="PageNum">每页显示数据量</param>
        /// <returns>资讯信息DataTable</returns>
        public DataTable GetPublicInfo(string Pub_LS_Code1, string Pub_LS_Code2, string Pub_LS_Code3, string Pub_Title, string Pub_Code, string Pub_LS_Code4, string Pub_SA_Code1, string Pub_SA_Code2, string Pub_SA_Code3, string BeginTime, string EndTime, string PageIndex, string PageNum)
        {
            StringBuilder sql = new StringBuilder();

            if (ValueHandler.GetStringValue(Pub_Code) != "")
            {
                sql.AppendFormat("SELECT Pub_Code,Pub_LS_Code1,Pub_LS_Code2,Pub_LS_Code3,Pub_LS_Code4,Pub_Title,Pub_ArticleSource,Pub_Pic,Pub_DisplayMode,Pub_Content  FROM dbo.XXSD_PublicInfo WHERE Pub_Code='{0}'", Pub_Code);
            }
            else
            {
                sql.AppendFormat("SELECT TOP {0} Pub_Code,Pub_Title,LS_Name1,LS_Name2,Pub_KeyWords,JoinDate,JoinMan FROM(", ValueHandler.GetIntNumberValue(PageNum));
                sql.Append("SELECT P.Pub_Code,P.Pub_Title,L1.LS_Name AS 'LS_Name1',L2.LS_Name AS 'LS_Name2',P.Pub_KeyWords,P.JoinDate,P.JoinMan,ROW_NUMBER() OVER (ORDER BY P.JoinDate DESC) AS 'Num' FROM XXSD_PublicInfo P LEFT JOIN XXSD_LevelSet L1 ON P.Pub_LS_Code3=L1.LS_Code LEFT JOIN XXSD_LevelSet L2 ON P.Pub_LS_Code4=L2.LS_Code WHERE 1=1");
                if (ValueHandler.GetStringValue(Pub_LS_Code1) != "")
                {
                    sql.AppendFormat(" AND P.Pub_LS_Code1 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code1));
                }
                if (ValueHandler.GetStringValue(Pub_LS_Code2) != "")
                {
                    sql.AppendFormat(" AND P.Pub_LS_Code2 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code2));
                }
                if (ValueHandler.GetStringValue(Pub_LS_Code3) != "")
                {
                    sql.AppendFormat(" AND P.Pub_LS_Code3 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code3));
                }
                if (ValueHandler.GetStringValue(Pub_LS_Code4) != "")
                {
                    sql.AppendFormat(" AND P.Pub_LS_Code4 = '{0}'", ValueHandler.GetStringValue(Pub_LS_Code4));
                }
                if (ValueHandler.GetStringValue(Pub_SA_Code1) != "")
                {
                    sql.AppendFormat(" AND P.Pub_SA_Code1 = '{0}'", ValueHandler.GetStringValue(Pub_SA_Code1));
                }
                if (ValueHandler.GetStringValue(Pub_SA_Code2) != "")
                {
                    sql.AppendFormat(" AND P.Pub_SA_Code2 = '{0}'", ValueHandler.GetStringValue(Pub_SA_Code2));
                }
                if (ValueHandler.GetStringValue(Pub_SA_Code3) != "")
                {
                    sql.AppendFormat(" AND P.Pub_SA_Code3 = '{0}'", ValueHandler.GetStringValue(Pub_SA_Code3));
                }
                if (ValueHandler.GetStringValue(Pub_Title) != "")
                {
                    sql.AppendFormat(" AND P.Pub_Title LIKE '%{0}%'", ValueHandler.GetStringValue(Pub_Title));
                }
                if (ValueHandler.GetMarkStringDateValue(BeginTime) != "" && ValueHandler.GetMarkStringDateValue(BeginTime) != "null" && ValueHandler.GetMarkStringDateValue(BeginTime) != null)
                {
                    sql.AppendFormat(" AND P.JoinDate >= '{0}'", ValueHandler.GetStringValue(BeginTime));
                }
                if (ValueHandler.GetMarkStringDateValue(EndTime) != "" && ValueHandler.GetMarkStringDateValue(EndTime) != "null" && ValueHandler.GetMarkStringDateValue(EndTime) != null)
                {
                    sql.AppendFormat(" AND P.JoinDate <= '{0}'", ValueHandler.GetStringValue(EndTime));
                }
                sql.AppendFormat(") T WHERE T.Num >(0+({0}-1)*{1})", ValueHandler.GetIntNumberValue(PageIndex), ValueHandler.GetIntNumberValue(PageNum));
            }
            return(SearchData(sql.ToString()));
        }
Пример #5
0
        public string GetCustomerCount(string cust_Name, string cust_Linkman, string cust_LinkPhone, string Province, string city, string cust_State, string cust_BillNumber, string cust_IsBill, string cust_WH_UserName,
                                       string staJoinDate, string endJoinDate, string cust_UnOrder, string endcust_UnOrder, string cust_OutDate, string endcust_OutDate)
        {
            StringBuilder sb = new StringBuilder();

            if (ValueHandler.GetStringValue(cust_Name) != "")
            {
                sb.Append(" AND Cust_Name LIKE '%" + ValueHandler.GetStringValue(cust_Name) + "%'");
            }
            if (ValueHandler.GetStringValue(cust_Linkman) != "")
            {
                sb.Append(" AND Cust_Linkman LIKE '%" + ValueHandler.GetStringValue(cust_Linkman) + "%'");
            }
            if (ValueHandler.GetStringValue(cust_LinkPhone) != "")
            {
                sb.Append(" AND Cust_LinkPhone LIKE '%" + ValueHandler.GetStringValue(cust_LinkPhone) + "%'");
            }
            if (ValueHandler.GetStringValue(Province) != "")
            {
                sb.Append(" AND Cust_ProvinceCode = '" + ValueHandler.GetStringValue(Province) + "'");
            }
            if (ValueHandler.GetStringValue(city) != "")
            {
                sb.Append(" AND Cust_CityCode = '" + ValueHandler.GetStringValue(city) + "'");
            }

            if (ValueHandler.GetStringValue(cust_State) != "")
            {
                string[]      Cust_States   = ValueHandler.GetStringValue(cust_State).Split(';');
                StringBuilder Cust_StateStr = new StringBuilder();
                for (int i = 0; i < Cust_States.Length; i++)
                {
                    if (i == 0)
                    {
                        Cust_StateStr.AppendFormat(" Cust_State = '{0}'", Cust_States[i]);
                    }
                    else
                    {
                        Cust_StateStr.AppendFormat(" OR Cust_State = '{0}'", Cust_States[i]);
                    }
                }
                sb.AppendFormat(" AND ({0})", Cust_StateStr.ToString());
            }
            else
            {
                sb.Append("AND Cust_State IN('已审','退订','退费','无效')");
            }
            if (ValueHandler.GetStringValue(cust_BillNumber) != "")
            {
                sb.Append(" AND Cust_BillNumber LIKE '%" + ValueHandler.GetStringValue(cust_BillNumber) + "%'");
            }
            if (ValueHandler.GetStringValue(cust_IsBill) != "")
            {
                sb.Append(" AND Cust_IsBill='" + ValueHandler.GetStringValue(cust_IsBill) + "'");
            }
            if (ValueHandler.GetStringValue(cust_WH_UserName) != "")
            {
                sb.Append(" AND Cust_WH_UserName LIKE '%" + ValueHandler.GetStringValue(cust_WH_UserName) + "%'");
            }
            if (ValueHandler.GetStringValue(staJoinDate) != "")
            {
                sb.Append(" AND Cust_OpenDate  >= " + ValueHandler.GetMarkStringDateValue(staJoinDate));
            }
            if (ValueHandler.GetStringValue(endJoinDate) != "")
            {
                sb.Append(" AND Cust_OpenDate  <= '" + endJoinDate + " 23:59:59'");
            }
            if (ValueHandler.GetStringValue(cust_UnOrder) != "")
            {
                sb.Append(" AND Cust_UnOrder  >= " + ValueHandler.GetMarkStringDateValue(cust_UnOrder));
            }
            if (ValueHandler.GetStringValue(endcust_UnOrder) != "")
            {
                sb.Append(" AND Cust_UnOrder  <= '" + endcust_UnOrder + " 23:59:59'");
            }
            if (ValueHandler.GetStringValue(cust_OutDate) != "")
            {
                sb.Append(" AND Cust_OutDate  >= " + ValueHandler.GetMarkStringDateValue(cust_OutDate));
            }
            if (ValueHandler.GetStringValue(endcust_OutDate) != "")
            {
                sb.Append(" AND Cust_OutDate  <= '" + endcust_OutDate + " 23:59:59'");
            }

            StringBuilder str = new StringBuilder();

            str.AppendFormat(@"SELECT count (*) AS DataCount
                                          FROM (SELECT Cust_Code
                                                    , '维权通' AS Name
                                                    , 1 AS Type
                                                FROM WQT_Customer
                                                WHERE 1 = 1 {0} UNION
                                              SELECT Cust_Code
                                                  , '名企云' AS Name
                                                  , 2 AS Type
                                              FROM MQY_Customer
                                              WHERE 1 = 1 {0} UNION 
                                                SELECT Cust_Code
                                                  , '实时保' AS Name
                                                  , 5 AS Type
                                              FROM SSB_Customer
                                              WHERE 1 = 1 {0} UNION
                                              SELECT Cust_Code
                                                  , '诚信通' AS Name
                                                  , 3 AS Type
                                              FROM CXT_Customer
                                              WHERE 1 = 1 {0} ) t", sb.ToString());

            /*XFB
             * UNION
             *                                  SELECT Cust_Code
             *                                    , '新消费宝典' AS Name
             *                                    , 4 AS Type
             *                                FROM XFB_Customer
             *                                WHERE 1 = 1 {0}
             */
            DataTable dt = SearchData(str.ToString());

            if (dt.Rows.Count > 0)
            {
                return(dt.Rows[0]["DataCount"].ToString());
            }
            else
            {
                return("0");
            }
        }
Пример #6
0
        public DataTable GetCustomer(string cust_Name, string cust_Linkman, string cust_LinkPhone, string Province, string city, string cust_State, string cust_BillNumber, string cust_IsBill, string cust_WH_UserName,
                                     string staJoinDate, string endJoinDate, string cust_UnOrder, string endcust_UnOrder, string cust_OutDate, string endcust_OutDate, string PageIndex, string PageNum)
        {
            StringBuilder sb = new StringBuilder();

            if (ValueHandler.GetStringValue(cust_Name) != "")
            {
                sb.Append(" AND Cust_Name LIKE '%" + ValueHandler.GetStringValue(cust_Name) + "%'");
            }
            if (ValueHandler.GetStringValue(cust_Linkman) != "")
            {
                sb.Append(" AND Cust_Linkman LIKE '%" + ValueHandler.GetStringValue(cust_Linkman) + "%'");
            }
            if (ValueHandler.GetStringValue(cust_LinkPhone) != "")
            {
                sb.Append(" AND Cust_LinkPhone LIKE '%" + ValueHandler.GetStringValue(cust_LinkPhone) + "%'");
            }
            if (ValueHandler.GetStringValue(Province) != "")
            {
                sb.Append(" AND Cust_ProvinceCode = '" + ValueHandler.GetStringValue(Province) + "'");
            }
            if (ValueHandler.GetStringValue(city) != "")
            {
                sb.Append(" AND Cust_CityCode = '" + ValueHandler.GetStringValue(city) + "'");
            }

            if (ValueHandler.GetStringValue(cust_State) != "")
            {
                string[]      Cust_States   = ValueHandler.GetStringValue(cust_State).Split(';');
                StringBuilder Cust_StateStr = new StringBuilder();
                for (int i = 0; i < Cust_States.Length; i++)
                {
                    if (i == 0)
                    {
                        Cust_StateStr.AppendFormat(" Cust_State = '{0}'", Cust_States[i]);
                    }
                    else
                    {
                        Cust_StateStr.AppendFormat(" OR Cust_State = '{0}'", Cust_States[i]);
                    }
                }
                sb.AppendFormat(" AND ({0})", Cust_StateStr.ToString());
            }
            else
            {
                sb.Append("AND Cust_State IN('已审','退订','退费','无效')");
            }
            if (ValueHandler.GetStringValue(cust_BillNumber) != "")
            {
                sb.Append(" AND Cust_BillNumber LIKE '%" + ValueHandler.GetStringValue(cust_BillNumber) + "%'");
            }
            if (ValueHandler.GetStringValue(cust_IsBill) != "")
            {
                sb.Append(" AND Cust_IsBill='" + ValueHandler.GetStringValue(cust_IsBill) + "'");
            }
            if (ValueHandler.GetStringValue(cust_WH_UserName) != "")
            {
                sb.Append(" AND Cust_WH_UserName LIKE '%" + ValueHandler.GetStringValue(cust_WH_UserName) + "%'");
            }
            if (ValueHandler.GetStringValue(staJoinDate) != "")
            {
                sb.Append(" AND Cust_OpenDate  >= " + ValueHandler.GetMarkStringDateValue(staJoinDate));
            }
            if (ValueHandler.GetStringValue(endJoinDate) != "")
            {
                sb.Append(" AND Cust_OpenDate  <= '" + endJoinDate + " 23:59:59'");
            }
            if (ValueHandler.GetStringValue(cust_UnOrder) != "")
            {
                sb.Append(" AND Cust_UnOrder  >= " + ValueHandler.GetMarkStringDateValue(cust_UnOrder));
            }
            if (ValueHandler.GetStringValue(endcust_UnOrder) != "")
            {
                sb.Append(" AND Cust_UnOrder  <= '" + endcust_UnOrder + " 23:59:59'");
            }
            if (ValueHandler.GetStringValue(cust_OutDate) != "")
            {
                sb.Append(" AND Cust_OutDate  >= " + ValueHandler.GetMarkStringDateValue(cust_OutDate));
            }
            if (ValueHandler.GetStringValue(endcust_OutDate) != "")
            {
                sb.Append(" AND Cust_OutDate  <= '" + endcust_OutDate + " 23:59:59'");
            }

            StringBuilder str = new StringBuilder();

            str.AppendFormat(@"SELECT TOP {0} *
                                        , (isnull (Cust_ProvinceName, '') + isnull (Cust_CityName, '') + isnull (Cust_CountyName, '')) AS 'Cust_Area'
                                    FROM (SELECT *
                                              , ROW_NUMBER () OVER (ORDER BY JoinDate DESC) AS 'Num'
                                          FROM (SELECT Cust_Name,JoinDate,Cust_Phone,Cust_BillNumber,Cust_Linkman,Cust_LinkPhone,Cust_WH_UserName,Cust_State,Cust_OpenDate,Cust_UnOrder,Cust_DealPerson,Cust_OutDate,Cust_Address,Cust_ProvinceName,Cust_CityName,Cust_CountyName,Cust_Code
                                                    , '维权通' AS Name
                                                    , 1 AS Type
                                                FROM WQT_Customer
                                                WHERE 1 = 1 {1} UNION
                                              SELECT Cust_Name,JoinDate,Cust_Phone,Cust_BillNumber,Cust_Linkman,Cust_LinkPhone,Cust_WH_UserName,Cust_State,Cust_OpenDate,Cust_UnOrder,Cust_DealPerson,Cust_OutDate,Cust_Address,Cust_ProvinceName,Cust_CityName,Cust_CountyName,Cust_Code
                                                  , '民企云' AS Name
                                                  , 2 AS Type
                                              FROM MQY_Customer
                                              WHERE 1 = 1 {1} UNION
                                              SELECT Cust_Name,JoinDate,Cust_Phone,Cust_BillNumber,Cust_Linkman,Cust_LinkPhone,Cust_WH_UserName,Cust_State,Cust_OpenDate,Cust_UnOrder,Cust_DealPerson,Cust_OutDate,Cust_Address,Cust_ProvinceName,Cust_CityName,Cust_CountyName,Cust_Code
                                                  , '实时保' AS Name
                                                  , 5 AS Type
                                              FROM SSB_Customer
                                              WHERE 1 = 1 {1} UNION
                                              SELECT Cust_Name,JoinDate,Cust_Phone,Cust_BillNumber,Cust_Linkman,Cust_LinkPhone,Cust_WH_UserName,Cust_State,Cust_OpenDate,Cust_UnOrder,Cust_DealPerson,Cust_OutDate,Cust_Address,Cust_ProvinceName,Cust_CityName,Cust_CountyName,Cust_Code
                                                  , '诚信通' AS Name
                                                  , 3 AS Type
                                              FROM CXT_Customer
                                              WHERE 1 = 1 {1} ) t) t
                                    WHERE T.Num > (0+({2}-1)*{0})
                                    ORDER BY 'Num'", PageNum, sb.ToString(), PageIndex);

            /*XFB
             * UNION
             *                                  SELECT Cust_Name,JoinDate,Cust_Phone,Cust_BillNumber,Cust_Linkman,Cust_LinkPhone,Cust_WH_UserName,Cust_State,Cust_OpenDate,Cust_UnOrder,Cust_DealPerson,Cust_OutDate,Cust_Address,Cust_ProvinceName,Cust_CityName,Cust_CountyName,Cust_Code
             *                                    , '新消费宝典' AS Name
             *                                    , 4 AS Type
             *                                FROM XFB_Customer
             *                                WHERE 1 = 1 {1} */
            return(SearchData(str.ToString()));
        }
Пример #7
0
        /// <summary>
        /// 新增、修改营销管理中心数据
        /// </summary>
        public string Update(CXT_Customer Model)
        {
            #region old
            //string msg = CheckExistLinkPhone(Model);
            //if (msg=="")
            //{
            //    StringBuilder strSql = new StringBuilder();

            //    strSql.Append("\r IF NOT EXISTS(SELECT * FROM CXT_Customer WHERE Cust_Code ='" + ValueHandler.GetStringValue(Model.Cust_Code) + "')");
            //    strSql.Append("\r BEGIN ");
            //    strSql.Append("\r INSERT INTO CXT_Customer(");
            //    strSql.Append("Cust_Code,Cust_Name,Cust_OldName,Cust_NameKey,Cust_Phone,Cust_Linkman,Cust_LinkPhone,Cust_ProvinceCode,Cust_ProvinceName,Cust_CityCode,Cust_CityName,Cust_CountyCode,Cust_CountyName,Cust_Address,Cust_IsBill,Cust_BillMoney,Cust_BillNumber,Cust_Nature,Cust_KFVoice,Cust_Source,Cust_OpenDate,Cust_WH_Remark,Cust_WH_UserName,Cust_State,Cust_OperateTime,Cust_IsView ");
            //    strSql.Append(") SELECT ");
            //    strSql.Append(" Cust_Code = '" + GetCode() + "', ");
            //    strSql.Append(GetCXT_Customer(Model));
            //    strSql.Append("\r END");
            //    strSql.Append("\r ELSE");
            //    strSql.Append("\r BEGIN ");
            //    strSql.Append("UPDATE CXT_Customer SET ");
            //    strSql.Append(GetCXT_Customer(Model));
            //    strSql.Append(" WHERE Cust_Code ='" + ValueHandler.GetStringValue(Model.Cust_Code) + "'");
            //    strSql.Append("\r END");

            //    if (strSql.Length > 0)
            //    {
            //        return UpdateData(strSql.ToString()).ToString().ToLower();
            //    }
            //    else
            //    {
            //        throw new Exception("无数据操作!");
            //    }
            //}
            //else
            //{
            //    return msg;
            //}
            #endregion

            string        msg    = "";
            StringBuilder strSql = new StringBuilder();
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Code) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Name) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_OldName) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_NameKey) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Phone) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Linkman) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_LinkPhone) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_ProvinceCode) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_ProvinceName) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_CityCode) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_CityName) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_CountyCode) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_CountyName) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Address) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_IsBill) + "', ");
            strSql.Append("'" + ValueHandler.GetIntNumberValue(Model.Cust_BillMoney) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_BillNumber) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Nature) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_KFVoice) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_Source) + "', ");
            strSql.Append("'" + ValueHandler.GetMarkStringDateValue(Model.Cust_OpenDate) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_WH_Remark) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_WH_UserName) + "', ");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_State) + "', ");
            strSql.Append("'" + ValueHandler.GetIntNumberValue(Model.Cust_IsView) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.JoinMan) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.fromPage) + "',");
            strSql.Append("'" + ValueHandler.GetIntNumberValue(Model.platForm) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.isCheck) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_BelongProvinceCode) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_BelongProvinceName) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_BelongCityCode) + "',");
            strSql.Append("'" + ValueHandler.GetStringValue(Model.Cust_BelongCityName) + "'");

            string sql = string.Format(@"exec [dbo].[SP_CustomerMaitain] {0}", strSql);
            try {
                DataTable dt = SearchData(sql);
                msg = dt.Rows[0][0].ToString();
            }
            catch (Exception ex) {
                msg = ex.Message;
            }
            return(msg);
        }