private void MasterTemplate_CellDoubleClick(object sender, GridViewCellEventArgs e)
 {
     if (dgvData.CurrentCell != null)
     {
         if (ts == 0)
         {
             string a = dgvData.CurrentCell.RowInfo.Cells["DocNo"].Value.ToSt();
             var    p = new ProductionOrder_Close(a);
             p.ShowDialog();
             DataLoad();
         }
         else
         {
             retDoc = dgvData.CurrentCell.RowInfo.Cells["DocNo"].Value.ToSt();
             this.Close();
         }
     }
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvData.CurrentCell != null)
         {
             if (ts == 0)
             {
                 string a = dgvData.CurrentCell.RowInfo.Cells["DocNo"].Value.ToSt();
                 var    p = new ProductionOrder_Close(a);
                 p.ShowDialog();
                 DataLoad();
             }
             else
             {
                 retDoc = dgvData.CurrentCell.RowInfo.Cells["DocNo"].Value.ToSt();
                 this.Close();
             }
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }