/// <summary> /// Fill controls on double click in datagridview /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvBatch_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strBatchName = dgvBatch.CurrentRow.Cells["dgvtxtBatchName"].Value.ToString(); if (strBatchName != "NA") { decId = Convert.ToDecimal(dgvBatch.CurrentRow.Cells["dgvtxtBatchId"].Value.ToString()); FillControls(); btnSave.Text = "Update"; txtBatchName.Focus(); btnDelete.Enabled = true; } else { Messages.WarningMessage("NA btach cannot update or delete"); Clear(); } } } catch (Exception ex) { MessageBox.Show("B15:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Fill controls on datagridview cell double click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvBrand_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { BrandInfo infoBrand = new BrandInfo(); BrandSP spBrand = new BrandSP(); strBrandName = dgvBrand.CurrentRow.Cells["Column1"].Value.ToString(); if (strBrandName != "NA") { decBrandId = Convert.ToDecimal(dgvBrand.Rows[e.RowIndex].Cells["dgvtxtBrandid"].Value.ToString()); infoBrand = spBrand.BrandView(decBrandId); txtBrandName.Text = infoBrand.BrandName; txtManufacturer.Text = infoBrand.Manufacturer; txtNarration.Text = infoBrand.Narration; btnSave.Text = "Update"; txtBrandName.Focus(); btnDelete.Enabled = true; strBrandName = infoBrand.BrandName; } else { Messages.WarningMessage("NA Brand cannot update or delete"); Clear(); } } } catch (Exception ex) { MessageBox.Show("BR19:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// area grid cell double click for update /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strArea = dgvArea.CurrentRow.Cells["dgvtxtarea"].Value.ToString(); if (strArea != "NA") { AreaInfo infoArea = new AreaInfo(); AreaSP spArea = new AreaSP(); infoArea = spArea.AreaFill(Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString())); txtAreaName.Text = infoArea.AreaName; txtNarration.Text = infoArea.Narration; btnSave.Text = "Update"; btnDelete.Enabled = true; txtAreaName.Focus(); decAreaId = Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString()); } else { Messages.WarningMessage("NA Area cannot update or delete"); Clear(); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "AR16:" + ex.Message; } }
/// <summary> /// area grid cell double click for update /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strArea = dgvArea.CurrentRow.Cells["dgvtxtarea"].Value.ToString(); if (strArea != "NA") { AreaInfo infoArea = new AreaInfo(); AreaBll BllArea = new AreaBll(); infoArea = BllArea.AreaFill(Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString())); txtAreaName.Text = infoArea.AreaName; txtNarration.Text = infoArea.Narration; btnSave.Text = "Update"; btnDelete.Enabled = true; txtAreaName.Focus(); decAreaId = Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString()); } else { Messages.WarningMessage("NA Area cannot update or delete"); Clear(); } } } catch (Exception ex) { MessageBox.Show("AR16" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On datagridview cell double click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvModalNo_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strModelNo = dgvModalNo.CurrentRow.Cells["dgvtxtModelNo"].Value.ToString(); if (strModelNo != "NA") { FillControls(); txtModalNo.Focus(); } else { Messages.WarningMessage("NA ModelNo cannot update or delete"); Clear(); } } } catch (Exception ex) { MessageBox.Show("MN17" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On datagridview cell double click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvModalNo_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strModelNo = dgvModalNo.CurrentRow.Cells["dgvtxtModelNo"].Value.ToString(); if (strModelNo != "NA") { FillControls(); txtModalNo.Focus(); } else { Messages.WarningMessage("NA ModelNo cannot update or delete"); Clear(); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "MN17" + ex.Message; } }
/// <summary> /// On datagridview cell doubleclick /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvGodown_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strBatchName = dgvSites.CurrentRow.Cells["dgvtxtSiteName"].Value.ToString(); if (strBatchName != "NA") { FillControls(); txtSiteName.Focus(); } else { Messages.WarningMessage("NA Site cannot update or delete"); Clear(); } } } catch (Exception ex) { formMDI.infoError.ErrorString = "G18:" + ex.Message; } }