Example #1
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
       if (e.ColumnIndex < 0|| e.RowIndex< 0 ) return;
       if (dataGridView1.Columns[e.ColumnIndex].Name.ToLower().Trim().Equals("lbldelete"))
       {
           Bean.FloorBean bean = dataGridView1.Rows[e.RowIndex].DataBoundItem as Bean.FloorBean;
           if( bean==null) return;
           DialogResult result = MessageBox.Show("您确定要删除名称为【" + bean.name + "】的标签吗?", "询问", MessageBoxButtons.OKCancel);
           if (result != System.Windows.Forms.DialogResult.OK) return;
           DeleteFloorLabel(bean);
       }
       else if (dataGridView1.Columns[e.ColumnIndex].Name.ToLower().Trim().Equals("lblseeboxs"))
       {
           Bean.FloorBean bean = dataGridView1.Rows[e.RowIndex].DataBoundItem as Bean.FloorBean;
           if( bean==null) return;
           FormBoxList form = new FormBoxList();
           form.WindowState = FormWindowState.Normal;
           form.StartPosition = FormStartPosition.CenterScreen;
           form.setFloorRfid(bean.rfid);
           form.ShowDialog();
       }
       else if (dataGridView1.Columns[e.ColumnIndex].Name.ToLower().Trim().Equals("lbledit"))
       {
           Bean.FloorBean bean = dataGridView1.Rows[e.RowIndex].DataBoundItem as Bean.FloorBean;
           if (bean == null) return;
           EditBean(bean);
       }
 }
Example #2
0
        private void btnConfig_Click(object sender, EventArgs e)
        {
            List<int> records = GetCheckedRecord();
            if (records == null || records.Count < 1)
            {
                MessageBox.Show("请勾选需要归盒的档案记录", "提示信息");
                return;
            }


            FormBoxList form = new FormBoxList("档案归盒");
            form.Text = "请选择档案盒标签,进行归盒操作";
            form.MinimizeBox = false;
            form.MaximizeBox = false;
            form.WindowState = FormWindowState.Normal;
            form.StartPosition = FormStartPosition.CenterParent;
            DialogResult result = form.ShowDialog();
            if (result != System.Windows.Forms.DialogResult.OK) return;

            BoxBean boxLabel = form.SelectedBoxLabel;
            if (boxLabel == null) return;

            if (backgroundWorker2.IsBusy) return;

            panelLoading.Visible = true;
            panelLoading.BringToFront();
            panelLoading.Location = new Point((this.Width / 2 - this.panelLoading.Width / 2), this.Height / 2 - this.panelLoading.Height - 20);
            lblLoadingText.Text = "正在请求档案归盒操作,请稍等......";

            BoxLabelConfig para = new BoxLabelConfig();
            para.ArchiveIds = records;
            para.BoxId = boxLabel.id;

            backgroundWorker2.RunWorkerAsync( para );

        }