private void MasterTemplate_CellDoubleClick(object sender, GridViewCellEventArgs e)
 {
     try
     {
         if (screen.Equals(1))
         {
             if (e.RowIndex > -1)
             {
                 if (!Convert.ToString(e.Row.Cells["ShippingNo"].Value).Equals(""))
                 {
                     SHNo_tt.Text = Convert.ToString(e.Row.Cells["ShippingNo"].Value);
                     this.Close();
                 }
                 else
                 {
                     SHNo_tt.Text   = Convert.ToString(e.Row.Cells["ShippingNo"].Value);
                     CodeNo_tt.Text = Convert.ToString(e.Row.Cells["CodeNo"].Value);
                     this.Close();
                 }
             }
         }
         else
         {
             if (e.RowIndex > -1)
             {
                 Acciden_t_Slip_CutStock a = new Acciden_t_Slip_CutStock(Convert.ToString(e.Row.Cells["ShippingNo"].Value),
                                                                         Convert.ToString(e.Row.Cells["CodeNo"].Value));
                 a.ShowDialog();
                 //this.Close();
             }
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (screen.Equals(1))
                {
                    if (dgvData.Rows.Count <= 0)
                    {
                        return;
                    }

                    if (!Convert.ToString(dgvData.CurrentRow.Cells["ShippingNo"].Value).Equals(""))
                    {
                        SHNo_tt.Text = Convert.ToString(dgvData.CurrentRow.Cells["ShippingNo"].Value);
                        this.Close();
                    }
                    else
                    {
                        SHNo_tt.Text   = Convert.ToString(dgvData.CurrentRow.Cells["ShippingNo"].Value);
                        CodeNo_tt.Text = Convert.ToString(dgvData.CurrentRow.Cells["CodeNo"].Value);
                        this.Close();
                    }
                }
                else
                {
                    if (dgvData.Rows.Count > 0)
                    {
                        Acciden_t_Slip_CutStock a = new Acciden_t_Slip_CutStock(Convert.ToString(dgvData.CurrentRow.Cells["ShippingNo"].Value),
                                                                                Convert.ToString(dgvData.CurrentRow.Cells["CodeNo"].Value));
                        a.ShowDialog();
                    }
                    else
                    {
                        Acciden_t_Slip_CutStock b = new Acciden_t_Slip_CutStock();
                        b.ShowDialog();
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }