C#改变查询出来的值

List<YXToolSystem.SQLStruct> col = new List<YXToolSystem.SQLStruct>();
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_NO", "编号"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_TypeNO", "问题类型编号"));
            col.Add(new YXToolSystem.SQLStruct(colsl("ServicesList_NO"), "排班编号"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_CNO", "客户编号"));
            col.Add(new YXToolSystem.SQLStruct(colsl("ServicesList_EPTNO"), "排班类型编号"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_ServicesNO", "服务费编号"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_CName", "客户名称"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_TypeName", "问题类型"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_Question", "问题"));
            col.Add(new YXToolSystem.SQLStruct("ServicesQuestion_Time", "售后次数"));

            col.Add(new YXToolSystem.SQLStruct(colsl("ServicesList_EName"), "技术员名称"));
            ClassServicesSpeed cs = new ClassServicesSpeed();
            col.Add(new YXToolSystem.SQLStruct(cs.GetSeeSQL("isnull(" + colsl("ServicesList_Speed") + ",-1)"), "状态"));
            col.Add(new YXToolSystem.SQLStruct("SUBSTRING(CONVERT(varchar(16)," + colsl("ServicesList_ExpectStart") + ", 25),6,11)", "预计开始时间"));
            col.Add(new YXToolSystem.SQLStruct("SUBSTRING(CONVERT(varchar(16)," + colsl("ServicesList_ExpectEnd") + ", 25),6,11)", "预计完成时间"));
            col.Add(new YXToolSystem.SQLStruct(colsl("ServicesList_ExpectEnd"), "endTime"));

            col.Add(new YXToolSystem.SQLStruct("(case isnull(" + colsl("ServicesList_IsFinish") + ",0) when 1 then '是' else '否' end )", "此单结束"));

            col.Add(new YXToolSystem.SQLStruct(cs.GetSeeSQL_ifserver("isnull(" + colsl("ServicesList_IsReturn") + ",0)"), "是否解决(技术员)"));
          

            col.Add(new YXToolSystem.SQLStruct("isnull(" + colsl("ServicesList_Speed") + ",-1)", "售后步骤"));

            string sql = YXToolSystem.SQLGet.Select(col, "ServicesQuestion") + " where ServicesQuestion_IsOK='0'";
            switch (butIndex)
            {
                case 0:
                    sql += " order by 编号 asc";
                    break;
                case 1:
                    sql += " and isnull(" + colsl("ServicesList_Speed") + ",-1)=-1  order by 编号 asc";
                    break;
                case 2:
                    sql += " and isnull(" + colsl("ServicesList_Speed") + ",-1)<>-1 and isnull(" + colsl("ServicesList_IsFinish") + ",0)= 0  order by 编号 asc";
                    break;
                case 3:
                    sql += " and isnull(" + colsl("ServicesList_IsFinish") + ",0)=1 and isnull(" + colsl("ServicesList_IsSolve") + ",0)=0  order by 编号 asc";
                    break;
                case 4:
                    sql += " and isnull(" + colsl("ServicesList_IsSolve") + ",0)=1  order by 编号 asc";
                    break;
            }


namespace YXServicesSystem
{
    class ClassServices
    {
        public static int Expect_Minute = 2;
        public static int Expect_Hours = 3;
    }

    class ClassServicesSpeed
    {
        public string GetSeeSQL(string col)
        {
            string sql = " case " + col + "";
            sql += "  when 0 then '开始'  ";
            sql += "  when 8 then '接收进入'  ";
            sql += "  when 10 then '接收'  ";
            sql += "  when 18 then '出发进入'  ";
            sql += "  when 20 then '出发'  ";
            sql += "  when 28 then '到达进入'  ";
            sql += "  when 30 then '到达'  ";
            sql += "  when 31 then '延时'  ";
            sql += "  when 48 then '售后单填写进入'  ";
            sql += "  when 50 then '售后单填写完成'  ";
            sql += "  when 58 then '技术员签字'  ";
            sql += "  when 62 then '查看售后单'  ";
            sql += "  when 64 then '客户评分'  ";
            sql += "  when 68 then '客户签字进入'  ";
            sql += "  when 70 then '客户签字'  ";
            sql += "  when 78 then '完成进入'  ";
            sql += "  when 80 then '完成'  ";
            sql += "  when 100 then '返回公司'  ";
            sql += "  when 110 then '下班回家'  ";
            sql += "  when 120 then '继续其他售后'  ";
            sql += "  when 158 then '返回公司到达进入'  ";
            sql += "  when 160 then '返回公司到达'  ";
            sql += "  when 200 then '回访'  ";
            sql += "  else '无记录' end ";

            return sql;
        }
        public string GetSeeSQL_ifserver(string col)
        {
            string sql = " case " + col + "";
            sql += "  when 0 then '无记录'  ";
            sql += "  when 1 then '已解决'  ";
            sql += "  when 2 then '未解决'  ";
            sql += "  else '无记录' end ";

            return sql;
        }
        /// <summary>
        /// 刻度尺背景图片
        /// </summary>
        //public static void back_image(PictureBox p)
        //{
        //    p.Size = new Size(118, 10);
        //    p.BackgroundImage = YXServicesSystem.Properties.Resources.刻度;
        //}
    }

    /// <summary>
    /// 售后步骤值
    /// </summary>
    enum ServicesSpeed
    {
        开始 = 0,
        接收进入 = 8,
        接收 = 10,
        出发进入 = 18,
        出发 = 20,
        到达进入 = 28,
        到达 = 30,
        延时 = 31,//不修改Speed值
        售后单填写进入 = 48,
        售后单填写完成 = 50,
        技术员签字 = 58,
        查看售后单 = 62,
        客户评分 = 64,
        客户签字进入 = 68,
        客户签字 = 70,
        完成进入 = 78,
        完成 = 80,
        返回公司 = 100,
        下班回家 = 110,
        继续其他售后 = 120,
        返回公司到达进入 = 158,
        返回公司到达 = 160,
        回访 = 200,
    }
}

原文地址:https://www.cnblogs.com/qq1206583608/p/5165601.html