C # Changes the value of the query

Source: Internet
Author: User

list<yxtoolsystem.sqlstruct> col = new List<yxtoolsystem.sqlstruct> ();
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_no", "number"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_typeno", "Problem type Number"));
Col. ADD (New Yxtoolsystem.sqlstruct (COLSL ("Serviceslist_no"), "scheduling number"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_cno", "Customer number"));
Col. ADD (New Yxtoolsystem.sqlstruct (COLSL ("Serviceslist_eptno"), "scheduling type Number"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_servicesno", "Service charge number"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_cname", "Customer Name"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_typename", "Problem type"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_question", "question"));
Col. ADD (New Yxtoolsystem.sqlstruct ("Servicesquestion_time", "post-sale number"));

Col. ADD (New Yxtoolsystem.sqlstruct (COLSL ("Serviceslist_ename"), "technician name"));
Classservicesspeed cs = new Classservicesspeed ();
Col. ADD (New Yxtoolsystem.sqlstruct (cs. Getseesql ("IsNull (" + COLSL ("serviceslist_speed") + ", -1)"),"status"));
Col. ADD (New Yxtoolsystem.sqlstruct ("SUBSTRING" (varchar (+), "+ COLSL (" Serviceslist_expectstart ") +", 25), 6,11) ", "Expected start Time"));
Col. ADD (New Yxtoolsystem.sqlstruct ("SUBSTRING" (varchar (+), "+ COLSL (" serviceslist_expectend ") +", 25), 6,11) "," Estimated completion time "));
Col. ADD (New Yxtoolsystem.sqlstruct (COLSL ("Serviceslist_expectend"), "EndTime"));

Col. ADD (New Yxtoolsystem.sqlstruct ("IsNull (" + COLSL ("serviceslist_isfinish") + ", 0) when 1 Then ' is ' else ' no ' end)", "this (Single End "));

Col. ADD (New Yxtoolsystem.sqlstruct (CS. Getseesql_ifserver ("IsNull (" + COLSL ("Serviceslist_isreturn") + ", 0)"), "whether to resolve (technician)");

Col. ADD (New Yxtoolsystem.sqlstruct ("IsNull (" + COLSL ("serviceslist_speed") + ",-1)", "after-sales steps");

String sql = YXToolSystem.SQLGet.Select (col, "servicesquestion") + "where servicesquestion_isok= ' 0 '";
Switch (BUTINDEX)
{
Case 0:
SQL + = "ORDER by number ASC";
Break
Case 1:
SQL + = "and IsNull (" + COLSL ("serviceslist_speed") + ", -1) =-1 ORDER by number ASC";
Break
Case 2:
SQL + = "and IsNull (" + COLSL ("serviceslist_speed") + ", -1) <>-1 and IsNull (" + COLSL ("serviceslist_isfinish") + ", 0) = 0 ORDER by number ASC ";
Break
Case 3:
SQL + = "and IsNull (" + COLSL ("serviceslist_isfinish") + ", 0) =1 and IsNull (" + COLSL ("serviceslist_issolve") + ", 0) =0 Ord ER by number ASC ";
Break
Case 4:
SQL + = "and IsNull (" + COLSL ("serviceslist_issolve") + ", 0) =1 ORDER by number 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 ' start '";
SQL + = "When 8 then ' receive into '";
SQL + = "When ten Then ' receive '";
SQL + = "When and then ' go into '";
SQL + = "When and then ' departure '";
SQL + = "When and then ' arrives into '";
SQL + = "When and then ' arrives '";
SQL + = "When and then ' delay '";
SQL + = "When and then ' after the purchase of a single fill into the '";
SQL + = "When and then ' after-Sales order completed '";
SQL + = "when the" and "technician sign";
SQL + = "When and then ' view after-sales orders '";
SQL + = "When and then ' customer ratings '";
SQL + = "When the" customer signed into the "";
SQL + = "When and then ' customer signature '";
SQL + = "When and then ' complete into '";
SQL + = "when" and "Finish";
SQL + = "When and then ' back to the company '";
SQL + = "When you go home from work";
SQL + = "When and then ' continue with other aftermarket '";
SQL + = "When 158 and then ' returns to the company to enter '";
SQL + = "when" and "return to company arrival";
SQL + = "When and then ' return visit '";
SQL + = "Else ' no record ' end";

            return SQL;
       }
        public string getseesql_ifserver (string col)
         {
            String sql = "Case "+ col +" ";
            SQL + = "  When 0 Then ' no records '  ";
            SQL + =   When 1 Then ' resolved '   ';
            SQL + =   When 2 Then ' not resolved '   ';
            SQL + = "  Else ' no record ' end";

return SQL;
}
<summary>
Scale background image
</summary>
public static void Back_image (PictureBox p)
//{
P.size = new Size (118, 10);
P.backgroundimage = YXServicesSystem.Properties.Resources. scale;
//}
}

<summary>
After-Sales step value
</summary>
Enum Servicesspeed
{
Start = 0,
Receive Enter = 8,
Receive = 10,
Departure entry = 18,
Departure = 20,
Arrival Enter = 28,
Arrival = 30,
Delay = 31,//does not modify the speed value
After-Sales order entry = 48,
After-Sales order complete = 50,
Technician Signature = 58,
View after sales order = 62,
Customer rating = 64,
Client signed into = 68,
Customer signature = 70,
Complete entry = 78,
finish = 80,
Back to company = 100,
Home from work = 110,
Continue other after sales = 120,
Return company Arrival Enter = 158,
Return to company arrival = 160,
Return visit = 200,
}
}

C # Changes the value of the query

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.