/// <summary> /// Grid cell double click for update or delete /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvSize_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { if (dgvSize.CurrentRow.Cells["dgvtxtsizeId"].Value != null && dgvSize.CurrentRow.Cells["dgvtxtsizeId"].Value.ToString() != string.Empty) { decSizeId = Convert.ToDecimal(dgvSize.CurrentRow.Cells["dgvtxtsizeId"].Value.ToString()); if (decSizeId != 1) { SizeSP spSize = new SizeSP(); SizeInfo infoSize = new SizeInfo(); infoSize = spSize.SizeViewing(decSizeId); txtSize.Text = infoSize.Size; txtNarration.Text = infoSize.Narration; btnSave.Text = "Update"; btnDelete.Enabled = true; txtSize.Focus(); } else { Messages.InformationMessage(" NA Size canot update or delete"); Clear(); } } } } catch (Exception ex) { MessageBox.Show("SZ12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to get values from Size Table based on the parameter /// </summary> /// <param name="decSizeId"></param> /// <returns></returns> public SizeInfo SizeViewing(decimal decSizeId) { SizeInfo infoSize = new SizeInfo(); try { infoSize = spSize.SizeViewing(decSizeId); } catch (Exception ex) { MessageBox.Show("SZ6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(infoSize); }