private void txtProductId_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; MTN_PRODUCT_LIST frm = new MTN_PRODUCT_LIST(); frm.SelectVisible = true; if (frm.ShowDialog() == DialogResult.OK) { dalProductList dal = new DAL.dalProductList(); modProductList mod = dal.GetItem(Util.retValue1, out Util.emsg); if (mod != null) { txtProductId.Text = mod.ProductId; txtProductName.Text = mod.ProductName; } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void btnProduct_Click(object sender, EventArgs e) { MTN_PRODUCT_LIST frm = new MTN_PRODUCT_LIST(); frm.SelectVisible = true; if (frm.ShowDialog() == DialogResult.OK) { dalProductList dalpdt = new dalProductList(); modProductList modpdt = dalpdt.GetItem(Util.retValue1, out Util.emsg); txtProductName.Tag = modpdt.ProductId; txtProductName.Text = modpdt.ProductName; txtUnitNo.Text = modpdt.UnitNo; if (modpdt.SizeFlag == 1) { txtSize.Enabled = true; txtSize.Text = "0"; } else { txtSize.Enabled = false; txtSize.Text = "1"; } txtQty.Focus(); } }
private void DBGrid2_DoubleClick(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; if (DBGrid2.CurrentRow == null) { return; } modAccProductSummary mod = (modAccProductSummary)DBGrid2.CurrentRow.DataBoundItem; if (DBGrid.RowCount > 0) { for (int i = 0; i < DBGrid.RowCount; i++) { if (DBGrid.Rows[i].Cells[1].Value.ToString().Trim() == mod.ProductId) { MessageBox.Show("该产品已经添加,您不能重复添加!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (DBGrid2.CurrentRow.Cells[10].Value == null || string.IsNullOrEmpty(DBGrid2.CurrentRow.Cells[10].Value.ToString()) || decimal.Parse(DBGrid2.CurrentRow.Cells[10].Value.ToString()) == 0) { MessageBox.Show("该产品数量为0,您不能调整它的价格!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } MTN_PRODUCT_LIST frm = new MTN_PRODUCT_LIST(); DataGridViewRow row = new DataGridViewRow(); row.CreateCells(DBGrid); row.Cells[0].Value = mod.ProductId; row.Cells[1].Value = mod.ProductName; row.Cells[2].Value = mod.EndQty; row.Cells[3].Value = mod.EndPrice; row.Cells[4].Value = mod.EndPrice; row.Cells[5].Value = mod.EndMny; row.Cells[6].Value = mod.EndMny; row.Cells[7].Value = 0; row.Cells[8].Value = ""; row.Height = 40; DBGrid.Rows.Add(row); row.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void MTN_PRODUCT_LIST_Click(object sender, EventArgs e) { frmMain frmmain = (frmMain)this.ParentForm; if (frmmain.CheckChildFrmExist("MTN_PRODUCT_LIST") == true) { return; } MTN_PRODUCT_LIST newFrm = new MTN_PRODUCT_LIST(); if (newFrm != null && !frmmain.ShowMDIChild(newFrm, newFrm)) { newFrm.Dispose(); newFrm = null; } }
private void mnuAdd_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; MTN_PRODUCT_LIST frm = new MTN_PRODUCT_LIST(); frm.SelectVisible = true; if (frm.ShowDialog() == DialogResult.OK) { dalProductList dal = new dalProductList(); modProductList mod = dal.GetItem(Util.retValue1, out Util.emsg); if (mod != null) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(DBGrid); row.Cells[0].Value = mod.ProductId; row.Cells[1].Value = mod.ProductName; row.Cells[2].Value = mod.Specify; row.Cells[3].Value = mod.UnitNo; row.Cells[4].Value = mod.Brand; row.Cells[5].Value = 1; row.Cells[6].Value = 0; row.Cells[7].Value = ""; row.Height = 40; DBGrid.Rows.Add(row); row.Dispose(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }
private void btnProductList_Click(object sender, EventArgs e) { MTN_PRODUCT_LIST frm = new MTN_PRODUCT_LIST(); frm.ShowDialog(); }