Exemplo n.º 1
0
        private void ToolStripMenuItemCellCode_Click(object sender, EventArgs e)
        {
            //重新分配貨位
            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll     = new BLL.BLLBase();
                DataRow     dataRow = (this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].DataBoundItem as DataRowView).Row;

                string TaskNo = dataRow["TaskNo"].ToString();

                string TaskType = dataRow["TaskType"].ToString();
                string ErrCode  = dataRow["AlarmCode"].ToString();

                if (TaskType == "11" || TaskType == "13")
                {
                    DataRow dr = dataRow;
                    App.View.frmReassignEmptyCell f = new App.View.frmReassignEmptyCell(dr);
                    if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        this.BindData();
                    }
                }
                //if (TaskType == "13")
                //{
                //    DataRow dr = dataRow;
                //    App.View.frmReassignOption fo = new App.View.frmReassignOption();
                //    if (fo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                //    {
                //        if (fo.option == 0)
                //        {
                //            App.View.frmReassignCell f = new App.View.frmReassignCell(dr, fo.option);
                //            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                //                this.BindData();
                //        }
                //        if (fo.option == 1)
                //        {
                //            App.View.frmReassignCell fe = new App.View.frmReassignCell(dr, fo.option);
                //            if (fe.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                //                this.BindData();
                //        }
                //    }
                //}
            }
        }
Exemplo n.º 2
0
Arquivo: Main.cs Projeto: wpmyj/XN
        private void ToolStripMenuItemCellCode_Click(object sender, EventArgs e)
        {
            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll      = new BLL.BLLBase();
                string      TaskNo   = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();
                string      TaskType = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells["colTaskType"].Value.ToString();
                string      ErrCode  = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells["colErrCode"].ToString();

                if (TaskType == "11" || TaskType == "16")
                {
                    DataGridViewSelectedRowCollection rowColl = dgvMain.SelectedRows;
                    if (rowColl == null)
                    {
                        return;
                    }
                    DataRow dr = (rowColl[0].DataBoundItem as DataRowView).Row;
                    App.View.frmReassignEmptyCell f = new App.View.frmReassignEmptyCell(dr);
                    if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        this.BindData();
                    }
                }
                else if (TaskType == "12" || TaskType == "14" || TaskType == "15")
                {
                    DataGridViewSelectedRowCollection rowColl = dgvMain.SelectedRows;
                    if (rowColl == null)
                    {
                        return;
                    }
                    DataRow dr             = (rowColl[0].DataBoundItem as DataRowView).Row;
                    App.View.frmReassign f = new App.View.frmReassign(dr);
                    if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        this.BindData();
                    }
                }
                else if (TaskType == "13")
                {
                    DataGridViewSelectedRowCollection rowColl = dgvMain.SelectedRows;
                    if (rowColl == null)
                    {
                        return;
                    }
                    DataRow dr = (rowColl[0].DataBoundItem as DataRowView).Row;

                    App.View.frmReassignOption fo = new App.View.frmReassignOption();
                    if (fo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (fo.option == 0)
                        {
                            App.View.frmReassign f = new App.View.frmReassign(dr);
                            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                            {
                                this.BindData();
                            }
                        }
                        else
                        {
                            App.View.frmReassignEmptyCell fe = new App.View.frmReassignEmptyCell(dr);
                            if (fe.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                            {
                                this.BindData();
                            }
                        }
                    }
                }
            }
        }