Пример #1
0
        private void grd_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            int    id   = int.Parse(grd.Rows[e.RowIndex].Cells["Id"].Value.ToString());
            string type = grd.Rows[e.RowIndex].Cells["TypeName"].Value.ToString();

            if (type.Equals("Nhập kho", StringComparison.OrdinalIgnoreCase))
            {
                frmImportDetail frmImportDetail = new frmImportDetail(id);
                frmImportDetail.StartPosition = FormStartPosition.CenterParent;
                frmImportDetail.ShowDialog();
            }
            else
            {
                frmExportDetail frmExportDetail = new frmExportDetail(id);
                frmExportDetail.StartPosition = FormStartPosition.CenterParent;
                frmExportDetail.ShowDialog();
                if (frmExportDetail.Status)
                {
                    LoadData();
                }
            }
        }
Пример #2
0
 private void grd_CellContentClick(object sender, System.Windows.Forms.DataGridViewCellEventArgs e)
 {
     if (e.RowIndex == -1) return;
     int id = int.Parse(grd.Rows[e.RowIndex].Cells["Id"].Value.ToString());
     string type = grd.Rows[e.RowIndex].Cells["TypeName"].Value.ToString();
     if (type.Equals("Nhập kho", StringComparison.OrdinalIgnoreCase))
     {
         frmImportDetail frmImportDetail = new frmImportDetail(id);
         frmImportDetail.StartPosition = FormStartPosition.CenterParent;
         frmImportDetail.ShowDialog();
     }
     else
     {
         frmExportDetail frmExportDetail = new frmExportDetail(id);
         frmExportDetail.StartPosition = FormStartPosition.CenterParent;
         frmExportDetail.ShowDialog();
         if (frmExportDetail.Status)
         {
             LoadData();
         }
     }
 }