예제 #1
0
        /// <summary>
        /// 上传用户数据到机器
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (dataGridView2.SelectedRows.Count > 0)
            {
                CmnLoadDataHandler handler = new CmnLoadDataHandler(this.CmnUpLoadData);
                using (CmnLoadDataForm form = new CmnLoadDataForm())
                    for (int i = 0; i < dataGridView2.SelectedRows.Count; i++)
                    {
                    }
            }
            //for (int i = 0; i < LGridView.RowCount; i++)
            //{
            //    if (LGridView.GetDataRow(i)["xuanding"].ToString() == "1")
            //    {
            //        this.gridView.CloseSaveEditor();
            //        CmnLoadDataHandler handler = new CmnLoadDataHandler(this.CmnUpLoadData);
            //        using (CmnLoadDataForm form = new CmnLoadDataForm())
            //        {
            //            string b = "";
            //            DataRow dr = LGridView.GetDataRow(i);
            //            IAsyncResult result = handler.BeginInvoke(dr, out b, null, null);
            //            form.AsyncResult = result;
            //            form.ShowDialog(this);
            //            handler.EndInvoke(out b, result);
            //            DXTravel.DXGUI.Util.MessageUtil.ShowInfo(b);
            //            RTable.GetMainTableByWhere(" AllowLogin=1");
            //            gridControl.DataSource = RTable;

            //        }

            //    }
            //}
        }
예제 #2
0
 /// <summary>
 /// 下载用户数据到数据库
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button3_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
         {
             //if (userdata.Rows[i]["xuanding"].ToString() == "1")
             //{
             CmnLoadDataHandler handler = new CmnLoadDataHandler(this.CmnDownLoadData);
             using (CmnLoadDataForm form = new CmnLoadDataForm())
             {
                 string  b  = "";
                 DataRow dr = (dataGridView1.SelectedRows[i].DataBoundItem as DataRowView).Row;
                 listBox1.Items.Add("开始连接指纹机" + dr["MachineNumber"].ToString());
                 IAsyncResult result = handler.BeginInvoke(dr, out b, null, null);
                 form.AsyncResult = result;
                 form.ShowDialog(this);
                 handler.EndInvoke(out b, result);
                 listBox1.Items.Add(b);
                 //DXTravel.DXGUI.Util.MessageUtil.ShowInfo(b);
                 //RTable.GetMainTableByWhere(" AllowLogin=1");
                 //dataGridView3.DataSource = userdata;
             }
         }
     }
 }
예제 #3
0
 /// <summary>
 /// 循环下载所有数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button2_Click(object sender, EventArgs e)
 {
     zhengfan = true;
     if (!timer1.Enabled)
     {
         timer1.Start();
         CmnXhLoadHandler handler = new CmnXhLoadHandler(XHCmnDownLoadData);
         using (CmnLoadDataForm form = new CmnLoadDataForm("正循环下载数据正在运行中..."))
         {
             double       b;
             IAsyncResult result = handler.BeginInvoke(out b, null, null);
             form.AsyncResult = result;
             form.ShowDialog(this);
             handler.EndInvoke(out b, result);
         }
     }
 }
예제 #4
0
        private void frmOutline_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“attDataSet.d_machines”中。您可以根据需要移动或删除它。

            zhengfan = true;
            if (!timer1.Enabled)
            {
                timer1.Start();
                CmnXhLoadHandler handler = new CmnXhLoadHandler(XHCmnDownLoadData);
                using (CmnLoadDataForm form = new CmnLoadDataForm("正循环下载数据正在运行中..."))
                {
                    double       b;
                    IAsyncResult result = handler.BeginInvoke(out b, null, null);
                    form.AsyncResult = result;
                    form.ShowDialog(this);
                    handler.EndInvoke(out b, result);
                }
            }
        }
예제 #5
0
        /// <summary>
        /// 下载指定主机数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows != null)
            {
                CmnZDLoadDataHandler handler = new CmnZDLoadDataHandler(ZDCmnDownLoadData);

                using (CmnLoadDataForm form = new CmnLoadDataForm("下载数据中..."))
                {
                    for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
                    {
                        DataRow   dv  = (dataGridView1.SelectedRows[i].DataBoundItem as DataRowView).Row;
                        DataTable dt  = (DataTable)attdt.Clone();
                        string    str = "";
                        listBox1.Items.Add("开始连接指纹机" + dv["MachineNumber"].ToString());
                        IAsyncResult result = handler.BeginInvoke(dv, out dt, out str, null, null);
                        form.AsyncResult = result;
                        form.ShowDialog(this);
                        handler.EndInvoke(out dt, out str, result);
                        listBox1.Items.Add(str);
                    }
                }
            }
        }
예제 #6
0
 /// <summary>
 /// 查看机器人员列表
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button4_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         CmnloadMdataHandler handler = new CmnloadMdataHandler(this.CmnLookData);
         using (CmnLoadDataForm form = new CmnLoadDataForm())
         {
             for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)
             {
                 DataRow dr = (dataGridView1.SelectedRows[i].DataBoundItem as DataRowView).Row;
                 listBox1.Items.Add("开始连接指纹机" + dr["MachineNumber"].ToString());
                 DataTable    d = (DataTable)userdata.Clone();
                 string       st;
                 IAsyncResult result = handler.BeginInvoke(dr, out d, out st, null, null);
                 form.AsyncResult = result;
                 form.ShowDialog(this);
                 handler.EndInvoke(out d, out st, result);
                 listBox1.Items.Add(st);
                 dataGridView3.DataSource = d;
             }
         }
     }
 }