Ejemplo n.º 1
0
        private void MasterTemplate_CellDoubleClick(object sender, GridViewCellEventArgs e)
        {
            //btnSave_Click(null, null);
            try
            {
                if (e.RowIndex > -1)
                {
                    if (screen.Equals(1))
                    {
                        JobCard_tt.Text     = Convert.ToString(e.Row.Cells["JobCard"].Value);
                        TempJobCard_tt.Text = Convert.ToString(e.Row.Cells["TempJobCard"].Value);
                        Unit_tt.Text        = Convert.ToString(e.Row.Cells["Unit"].Value);
                        Qty_tt.Text         = Convert.ToString(e.Row.Cells["Qty"].Value);


                        //JobCard_tt.Text = Convert.ToString(e.Row.Cells["JobCard"].Value);
                        //TempJobCard_tt.Text = Convert.ToString(e.Row.Cells["TempJobCard"].Value);
                        this.Close();
                    }
                    else
                    {
                        CreateJob a = new CreateJob(Convert.ToString(e.Row.Cells["JobCard"].Value),
                                                    Convert.ToString(e.Row.Cells["TempJobCard"].Value));
                        a.ShowDialog();
                        //this.Close();
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Ejemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (screen.Equals(1))
                {
                    if (dgvData.Rows.Count > 0)
                    {
                        JobCard_tt.Text     = Convert.ToString(dgvData.CurrentRow.Cells["JobCard"].Value);
                        TempJobCard_tt.Text = Convert.ToString(dgvData.CurrentRow.Cells["TempJobCard"].Value);
                        Unit_tt.Text        = Convert.ToString(dgvData.CurrentRow.Cells["Unit"].Value);
                        Qty_tt.Text         = Convert.ToString(dgvData.CurrentRow.Cells["Qty"].Value);

                        this.Close();
                    }
                }
                else
                {
                    CreateJob a = new CreateJob();
                    a.ShowDialog();
                    //CreateJob a = new CreateJob(Convert.ToString(dgvData.CurrentRow.Cells["JobCard"].Value),
                    //    Convert.ToString(dgvData.CurrentRow.Cells["TempJobCard"].Value));
                    //a.ShowDialog();
                    //this.Close();
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }