Пример #1
0
 private void dgvMeasureItem_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvMeasureItem.RowCount > 0)
     {
         int curRow = dgvMeasureItem.CurrentRow.Index;
         DrawingCd = dgvMeasureItem.CurrentRow.Cells[1].Value.ToString();
         if (dgvMeasureItem.Columns[e.ColumnIndex] == colNew && curRow >= 0)//đo mới
         {
             IPQC_Part.frmFMS frmFMS = new IPQC_Part.frmFMS(0, username, DrawingCd);
             this.Hide();
             frmFMS.ShowDialog();
             this.Show();
         }
         else if (dgvMeasureItem.Columns[e.ColumnIndex] == colCon && curRow >= 0)//đo tiep
         {
             DateTime dateNow = DateTime.Now;
             //TreeView(DrawingCd, dateNow.AddYears(-1).ToString(), dateNow.ToString(), 7);
             TreeView2(DrawingCd, dtpFromDate.Value.ToString(), dtpToDate.Value.ToString(), 7, true);
             boolTV = true;
         }
         else if (dgvMeasureItem.Columns[e.ColumnIndex] == colEdit && curRow >= 0)//edit ban ve
         {
             frmItemMaster frmitemM = new frmItemMaster(int.Parse(dgvMeasureItem.CurrentRow.Cells["dwr_id"].Value.ToString()), dgvMeasureItem.CurrentRow.Cells["dwr_cd"].Value.ToString(), dgvMeasureItem.CurrentRow.Cells["dwr_name"].Value.ToString(), dgvMeasureItem.CurrentRow.Cells["doc_name"].Value.ToString(), username);
             this.Hide();
             frmitemM.ShowDialog();
             this.Show();
             cmbSubModel_SelectedIndexChanged(sender, e);
         }
     }
 }
Пример #2
0
 private void btnEditMaster_Click(object sender, EventArgs e)
 {
     if (dgvMeasureItem.RowCount > 0 && username == "admin")
     {
         frmItemMaster frmitemM = new frmItemMaster(dgvMeasureItem.CurrentRow.Cells["dwr_cd"].Value.ToString(), username);
         frmitemM.ShowDialog();
     }
 }