Beispiel #1
0
        private void btn_Read_Click(object sender, EventArgs e)
        {
            string L1, L2, L3;

            dataset.Clear();
            dataset         = DALFunc.QueryTable("EquipTypeSlet");
            txtbox_Num.Text = dataset.Tables[0].Rows[3].ToString();

            L1 = dataset.Tables[0].Rows[4].ToString();
            string[] L1D = L1.Split(';');
            lbox_L1.Items.Clear();
            for (int i = 0; i < L1D.Count(); i++)
            {
                lbox_L1.Items.Add(L1D[i]);
            }

            L2 = dataset.Tables[0].Rows[5].ToString();
            string[] L2D = L2.Split(';');
            lbox_L2.Items.Clear();
            for (int i = 0; i < L2D.Count(); i++)
            {
                lbox_L2.Items.Add(L2D[i]);
            }

            L3 = dataset.Tables[0].Rows[6].ToString();
            string[] L3D = L3.Split(';');
            lbox_L3.Items.Clear();
            for (int i = 0; i < L3D.Count(); i++)
            {
                lbox_L3.Items.Add(L3D[i]);
            }
        }
Beispiel #2
0
        private void cbox_Eq_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbox_Eq.Text.Trim() != "")
            {
                lbox_UsedAlg.Items.Clear();
                //FreshLbox("EquipName", "EquipAlgSlet", "lbox_UsedAlg");
                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("AlgName", "EquipAlgSlet", "EquipName", cbox_Eq.Text);

                int j = 0;
                foreach (DataRow dr in dataset.Tables[0].Rows)
                {
                    lbox_UsedAlg.Items.Add(dataset.Tables[0].Rows[j][0]);
                    j++;
                }



                lbox_Factor.Items.Clear();
                lbox_UsedFact.Items.Clear();

                string L1, L2, L3;

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
                L1      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L1D = L1.Split(';');
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    lbox_Factor.Items.Add(L1D[i]);
                }

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
                L2      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L2D = L2.Split(';');
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    lbox_Factor.Items.Add(L2D[i]);
                }

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
                L3      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L3D = L3.Split(';');
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    lbox_Factor.Items.Add(L3D[i]);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 创建treeview
        /// </summary>
        /// <param name="datasetALL">整表信息</param>
        private void FreshTree(DataSet datasetALL)
        {
            Tree_Factor.Nodes.Clear();
            int j = 0;

            foreach (DataRow dr in datasetALL.Tables[0].Rows)
            {
                //string ii= datasetALL.Tables[0].Rows[j]["Selected"].ToString();
                //if (datasetALL.Tables[0].Rows[j]["Selected"].ToString() == "True")
                //{}
                TreeNode tn = Tree_Factor.Nodes.Add(datasetALL.Tables[0].Rows[j]["EquipName"].ToString());

                string L1, L2, L3;

                TreeNode tn1 = new TreeNode("直采数据");
                tn.Nodes.Add(tn1);
                L1 = datasetALL.Tables[0].Rows[j]["L1"].ToString();
                string[] L1D = L1.Split(';');
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    TreeNode tn12 = new TreeNode(L1D[i]);
                    tn1.Nodes.Add(tn12);
                }

                TreeNode tn2 = new TreeNode("操作数据");
                tn.Nodes.Add(tn2);
                L2 = datasetALL.Tables[0].Rows[j]["L2"].ToString();
                string[] L2D = L2.Split(';');
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    TreeNode tn22 = new TreeNode(L2D[i]);
                    tn2.Nodes.Add(tn22);
                }

                TreeNode tn3 = new TreeNode("调度数据");
                tn.Nodes.Add(tn3);
                L3 = datasetALL.Tables[0].Rows[j]["L3"].ToString();
                string[] L3D = L3.Split(';');
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    TreeNode tn32 = new TreeNode(L3D[i]);
                    tn3.Nodes.Add(tn32);
                }


                j++;
            }
        }
Beispiel #4
0
        private void lbox_UsedAlg_SelectedIndexChanged(object sender, EventArgs e)
        {
            //lbox_UsedAlg.Items.Clear();
            lbox_Factor.Items.Clear();
            lbox_UsedFact.Items.Clear();

            string L1, L2, L3;

            dataset.Clear();
            dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
            L1      = dataset.Tables[0].Rows[0][0].ToString();
            string[] L1D = L1.Split(';');
            for (int i = 0; i < L1D.Count() - 1; i++)
            {
                lbox_Factor.Items.Add(L1D[i]);
            }

            dataset.Clear();
            dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
            L2      = dataset.Tables[0].Rows[0][0].ToString();
            string[] L2D = L2.Split(';');
            for (int i = 0; i < L2D.Count() - 1; i++)
            {
                lbox_Factor.Items.Add(L2D[i]);
            }

            dataset.Clear();
            dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", cbox_Eq.Text);
            L3      = dataset.Tables[0].Rows[0][0].ToString();
            string[] L3D = L3.Split(';');
            for (int i = 0; i < L3D.Count() - 1; i++)
            {
                lbox_Factor.Items.Add(L3D[i]);
            }

            /*
             * string Factor;
             * dataset.Clear();
             * dataset = ServiceContainer.GetService<IGasDAL>().QueryData("Factor", "EquipAlgSlet", "EquipName", cbox_Eq.Text, "AlgName", lbox_UsedAlg.SelectedItem.ToString());
             * Factor = dataset.Tables[0].Rows[0][0].ToString();
             * string[] FactorD = Factor.Split(';');
             * for (int i = 0; i < FactorD.Count() - 1; i++)
             * {
             *  lbox_UsedFact.Items.Add(FactorD[i]);
             * }
             */
        }
Beispiel #5
0
        public int CreatEquipTab()
        {
            DataSet dataset = new DataSet();


            dataset = dataControl.QueryData("EquipTypeSlet", "Selected", "1");
            int j = 0;

            foreach (DataRow dr in dataset.Tables[0].Rows)
            {
                for (int i = 0; i < int.Parse(dataset.Tables[0].Rows[j]["EquipNum"].ToString()); i++)
                {
                    tabControl.CreatEquipTabPart1(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString());
                    string L1, L2, L3;

                    L1 = dataset.Tables[0].Rows[j]["L1"].ToString();
                    string[] L1D = L1.Split(';');

                    for (int k = 0; k < L1D.Count() - 1; k++)
                    {
                        tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L1", L1D[k]);
                    }

                    L2 = dataset.Tables[0].Rows[j]["L2"].ToString();
                    string[] L2D = L2.Split(';');

                    for (int k = 0; k < L2D.Count() - 1; k++)
                    {
                        tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L2", L2D[k]);
                    }

                    L3 = dataset.Tables[0].Rows[j]["L3"].ToString();
                    string[] L3D = L3.Split(';');

                    for (int k = 0; k < L3D.Count() - 1; k++)
                    {
                        tabControl.AddTableColum(dataset.Tables[0].Rows[j]["ETabName"].ToString(), (i + 1).ToString() + "_L3", L3D[k]);
                    }
                }
                j++;
            }



            return(0);
        }
Beispiel #6
0
        private void btn_Read_Click(object sender, EventArgs e)
        {
            if (lbox_Equip.SelectedItems.Count != 0)
            {
                string L1, L2, L3;

                dataset.Clear();
                dataset         = ServiceContainer.GetService <IGasDAL>().QueryData("EquipNum", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                txtbox_Num.Text = dataset.Tables[0].Rows[0][0].ToString();

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                L1      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L1D = L1.Split(';');
                dgv_L1.Rows.Clear();
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    dgv_L1.Rows.Add(L1D[i]);
                }

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                L2      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L2D = L2.Split(';');
                dgv_L2.Rows.Clear();
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    dgv_L2.Rows.Add(L2D[i]);
                }

                dataset.Clear();
                dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                L3      = dataset.Tables[0].Rows[0][0].ToString();
                string[] L3D = L3.Split(';');
                dgv_L3.Rows.Clear();
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    dgv_L3.Rows.Add(L3D[i]);
                }
            }
            else
            {
                MessageBox.Show("选择设备");
            }
        }
Beispiel #7
0
        private void lbox_Equip_SelectedValueChanged(object sender, EventArgs e)
        {
            if (lbox_Equip.SelectedItems.Count != 0)
            {
                string L1, L2, L3;

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L1", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L1 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L1D = L1.Split(';');
                dgv_L1.Rows.Clear();
                for (int i = 0; i < L1D.Count() - 1; i++)
                {
                    dgv_L1.Rows.Add(L1D[i]);
                }

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L2", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L2 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L2D = L2.Split(';');
                dgv_L2.Rows.Clear();
                for (int i = 0; i < L2D.Count() - 1; i++)
                {
                    dgv_L2.Rows.Add(L2D[i]);
                }

                dataset.Clear();
                try
                {
                    dataset = ServiceContainer.GetService <IGasDAL>().QueryData("L3", "EquipTypeSlet", "EquipName", lbox_Equip.SelectedItem.ToString());
                }
                catch (Exception ex)
                {
                    Console.WriteLine("查询异常" + ex.Message);
                    return;
                }
                L3 = dataset.Tables[0].Rows[0][0].ToString();
                string[] L3D = L3.Split(';');
                dgv_L3.Rows.Clear();
                for (int i = 0; i < L3D.Count() - 1; i++)
                {
                    dgv_L3.Rows.Add(L3D[i]);
                }
            }
            //else
            //    MessageBox.Show("选择设备");
        }