Esempio n. 1
0
        public ForSetckk(New_Main_Form mainFrm)
        {
            InitializeComponent();
            this.mainFrm = mainFrm;
            MySqlConnection dbConn1;

            dbConn1 = new MySqlConnection(mainFrm.dbConnectionString);
            dbConn1.Open();
            string  sqlStr = " select ckkid,ckkname,ckkstatus  from idx_ckk order by ckkid";
            DataSet ds     = MySqlHelper.ExecuteDataset(dbConn1, sqlStr);

            if (ds.Tables[0].Rows.Count > 0)
            {
                int i = 0;
                for (; i < ds.Tables[0].Rows.Count; i++)
                {
                    if ((ds.Tables[0].Rows[i])["ckkid"].ToString() == "1")
                    {
                        if ((ds.Tables[0].Rows[i])["ckkstatus"].ToString() == "1")
                        {
                            ckk1Status.Text = "可用";
                        }
                        else
                        {
                            ckk1Status.Text = "不可用";
                        }
                    }

                    if ((ds.Tables[0].Rows[i])["ckkid"].ToString() == "2")
                    {
                        if ((ds.Tables[0].Rows[i])["ckkstatus"].ToString() == "1")
                        {
                            ckk2Status.Text = "可用";
                        }
                        else
                        {
                            ckk2Status.Text = "不可用";
                        }
                    }


                    if ((ds.Tables[0].Rows[i])["ckkid"].ToString() == "3")
                    {
                        if ((ds.Tables[0].Rows[i])["ckkstatus"].ToString() == "1")
                        {
                            ckk3Status.Text = "可用";
                        }
                        else
                        {
                            ckk3Status.Text = "不可用";
                        }
                    }


                    if ((ds.Tables[0].Rows[i])["ckkid"].ToString() == "4")
                    {
                        if ((ds.Tables[0].Rows[i])["ckkstatus"].ToString() == "1")
                        {
                            ckk4Status.Text = "可用";
                        }
                        else
                        {
                            ckk4Status.Text = "不可用";
                        }
                    }
                }
            }
            dbConn1.Close();
        }
Esempio n. 2
0
        //private DataSet taskDs = new DataSet();

        public TaskAutoRun(New_Main_Form mainform)
        {
            this.mainform = mainform;
        }