Esempio n. 1
0
        //获取当前账号的测试站位
        private string getTestCode(string tt_username)
        {
            string tt_testcode = "";
            string tt_sql1     = "select count(1),min(Fcode),0 " +
                                 " from odc_fhpassword where Fname = '" + tt_username + "' ";

            string[] tt_array1 = new string[3];
            tt_array1 = Dataset1.GetDatasetArrayTwo(tt_sql1, tt_conn);

            if (tt_array1[0] == "1")
            {
                tt_testcode = tt_array1[1];
            }
            else
            {
                MessageBox.Show("当前用户号:" + tt_username + "没有找到设定的待测站位,请确认");
            }
            return(tt_testcode);
        }
Esempio n. 2
0
        //获取密码
        private string GetUserPassword(string tt_username)
        {
            string tt_password = "******";

            string tt_sql = "select count(1),min(fpassword),min(Fcode) " +
                            " from odc_fhpassword where Fname = '" + tt_username + "' ";

            string[] tt_array = new string[3];
            tt_array = Dataset1.GetDatasetArrayTwo(tt_sql, tt_conn);

            if (tt_array[0] == "1")
            {
                tt_password = tt_array[1];
            }
            else
            {
                MessageBox.Show("网络连接失败,或没有" + tt_username + "此账号,请确认");
            }

            return(tt_password);
        }
Esempio n. 3
0
        //获取小版本
        private string GetProgramVersion2(string tt_programname)
        {
            string tt_newversion = "";

            string tt_sql = "select count(1),min(fremark),0 " +
                            " from odc_fhpassword where Fname = '" + tt_programname + "' ";

            string[] tt_array = new string[3];
            tt_array = Dataset1.GetDatasetArrayTwo(tt_sql, tt_conn);

            if (tt_array[0] == "1")
            {
                tt_newversion = tt_array[1];
            }
            else
            {
                MessageBox.Show("网络连接失败,或没有" + tt_programname + "此程序账号,请确认");
            }


            return(tt_newversion);
        }
Esempio n. 4
0
        //流程检查,获取下一流程
        private bool GetNextCode(string tt_task, string tt_username)
        {
            Boolean tt_flag = false;

            //第一步获取当前站位
            Boolean tt_flag1    = false;
            string  tt_testcode = "";
            string  tt_sql1     = "select count(1),min(Fcode),0 " +
                                  " from odc_fhpassword where Fname = '" + tt_username + "' ";

            string[] tt_array1 = new string[3];
            tt_array1 = Dataset1.GetDatasetArrayTwo(tt_sql1, tt_conn);

            if (tt_array1[0] == "1")
            {
                tt_testcode = tt_array1[1];
                tt_flag1    = true;
            }
            else
            {
                MessageBox.Show("当前用户号:" + tt_username + "没有找到设定的待测站位,请确认");
            }


            //第二步获取当前站位
            Boolean tt_flag2     = false;
            string  tt_firstcode = "";
            string  tt_ccode     = "";
            string  tt_process   = "";

            if (tt_flag1)
            {
                string tt_sql2 = "select count(1),min(b.PXID) ,min(a.GYID) " +
                                 "from odc_tasks a,odc_routing b " +
                                 "WHERE a.GYID=b.PID AND b.LCBZ=1 AND a.TASKSCODE='" + tt_task + "' ";
                string[] tt_array2 = new string[3];
                tt_array2 = Dataset1.GetDatasetArray(tt_sql2, tt_conn);
                if (tt_array2[0] == "1")
                {
                    tt_firstcode = tt_array2[1];
                    tt_ccode     = tt_testcode;

                    tt_process = tt_array2[2];
                    tt_flag2   = true;
                }
                else
                {
                    MessageBox.Show("该工单没有配置流程,请检查流程位置工单表以及流程表!");
                }
            }


            //第三步检查第一站位与设定的站位是否一致
            Boolean tt_flag3 = false;

            if (tt_flag1 && tt_flag2)
            {
                if (tt_ccode == tt_testcode)
                {
                    tt_flag3 = true;
                }
                else
                {
                    MessageBox.Show("程序设定待测站位与流程的第一站位不匹配,请检查!");
                }
            }


            //第四步 获取下一站位
            Boolean tt_flag4 = false;
            string  tt_ncode = "";

            if (tt_flag1 && tt_flag2 && tt_flag3)
            {
                string tt_sql4 = "select count(1),min(z.pxid),min(z.lcbz) " +
                                 " from odc_tasks t,odc_routing z  " +
                                 " where t.gyid=z.pid  and t.taskscode='" + tt_task + "' " +
                                 " and z.lcbz in( select (lcbz+1) lcbz " +
                                 "from odc_tasks a,odc_routing b " +
                                 "where b.pid=a.gyid and b.pxid='" + tt_ccode + "' " +
                                 " and a.taskscode='" + tt_task + "') ";



                string[] tt_array4 = new string[3];
                tt_array4 = Dataset1.GetDatasetArray(tt_sql4, tt_conn);
                if (tt_array4[0] == "1")
                {
                    tt_flag4 = true;
                    tt_ncode = tt_array4[1];
                }
                else
                {
                    MessageBox.Show("该工单流程配置异常,有前站位没有后站位,请检查流程位置工单表以及流程表!");
                }
            }


            if (tt_flag1 && tt_flag2 && tt_flag3 && tt_flag4)
            {
                tt_flag            = true;
                this.textBox2.Text = tt_ccode;
                this.textBox4.Text = tt_ncode;
            }



            return(tt_flag);
        }