private void btnWarehouse_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("WAREHOUSE", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtWarehouse.Text = frm.BaseMasterTable.Code; txtWarehouseName.Text = frm.BaseMasterTable.Name; txtQuantity.Focus(); } } frm.Dispose(); }
private void btnCustomer_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("CUSTOMER", " CLAIM_FLAG=1"); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtCustomerCode.Text = frm.BaseMasterTable.Code; txtCustomerName.Text = frm.BaseMasterTable.Name; txtSalesDate.Focus(); } } frm.Dispose(); }
private void btnProductParts_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("PRODUCT", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtProductParts.Text = frm.BaseMasterTable.Code; txtProductPartsName.Text = frm.BaseMasterTable.Name; txtProduct.Focus(); } } frm.Dispose(); }
/// <summary> /// 需要家选择按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEndCustomer_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("CUSTOMER", "TYPE = 2"); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtEndCustomerCode.Text = frm.BaseMasterTable.Code; txtEndCustomerName.Text = frm.BaseMasterTable.Name; txtDeliveryPointCode.Focus(); } } frm.Dispose(); }
private void btnSlipType_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("SLIP_TYPE", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtSlipType.Text = frm.BaseMasterTable.Code; txtSlipTypeName.Text = frm.BaseMasterTable.Name; } } frm.Dispose(); }
/// <summary> /// 供应商To /// </summary> private void btnSupplierTo_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("Supplier", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtSupplierCodeTo.Text = frm.BaseMasterTable.Code; txtSupplierNameTo.Text = frm.BaseMasterTable.Name; txtPOSlipDateFrom.Focus(); } } frm.Dispose(); }
private void btnGroupCode_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("PRODUCT_GROUP", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtGroupCode.Text = frm.BaseMasterTable.Code; txtGroupName.Text = frm.BaseMasterTable.Name; txtBasic.Focus(); } } frm.Dispose(); }
private void btnParts_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("PRODUCT", " PRODUCT_FLAG = " + CConstant.PRODUCT_FLAG_PARTS); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtPartsCode.Text = frm.BaseMasterTable.Code; txtPartsName.Text = frm.BaseMasterTable.Name; txtQuantity.Focus(); } } frm.Dispose(); }
private void btnTechnology3_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("TECHNOLOGY", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtTechnology3.Text = frm.BaseMasterTable.Name; txtTechnologyCode3.Text = frm.BaseMasterTable.Code; btnSave.Focus(); } } frm.Dispose(); }
private void btnDrawingType6_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("DRAWING", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtDrawingType6.Text = frm.BaseMasterTable.Name; txtDrawingTypeCode6.Text = frm.BaseMasterTable.Code; btnSave.Focus(); } } frm.Dispose(); }
private void btnDepartment_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("DEPARTMENT", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtDepartment.Text = frm.BaseMasterTable.Name; txtDepartmentCode.Text = frm.BaseMasterTable.Code; btnSave.Focus(); } } frm.Dispose(); }
private void btnSupplier_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("SUPPLIER", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtSupplierCode.Text = frm.BaseMasterTable.Code; txtSupplierName.Text = frm.BaseMasterTable.Name; txtWarehouseCode.Focus(); } } frm.Dispose(); }
private void btnSales_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("USER", " DEPARTMENT_CODE='D01'"); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtSales.Text = frm.BaseMasterTable.Name; txtSalesCode.Text = frm.BaseMasterTable.Code.Substring(2); //txtWarehouseCode.Focus(); } } frm.Dispose(); }
private void btnCustomer_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("CUSTOMER", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtCustomerCode.Text = frm.BaseMasterTable.Code; txtCustomerName.Text = frm.BaseMasterTable.Name; } } frm.Dispose(); txtBalance.Text = CConvert.ToString(GetCustomerDepositBlanace(txtCustomerCode.Text.Trim())); }
private void btnDepartual_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("WAREHOUSE", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtDepartualCode.Text = frm.BaseMasterTable.Code; txtDepartualName.Text = frm.BaseMasterTable.Name; txtArrivalCode.Focus(); } } frm.Dispose(); }
private void btnCurrency_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("CURRENCY", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtCurrencyCode.Text = frm.BaseMasterTable.Code; txtCurrencyName.Text = frm.BaseMasterTable.Name; txtCurrencyCode.Focus(); txtExchangeRate.Focus(); } } frm.Dispose(); }
private void btnUnit_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("Unit", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtUnitCode.Text = frm.BaseMasterTable.Code; txtUnitName.Text = frm.BaseMasterTable.Name; txtUnitCode.Focus(); txtPrice.Focus(); } } frm.Dispose(); }
private void btnProductGroup_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("COMPOSITION_PRODUCTS", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtCompositionProductsCode.Text = frm.BaseMasterTable.Code; txtCompositionProductsName.Text = frm.BaseMasterTable.Name; txtCompositionProductsCode.Focus(); btnSave.Focus(); } } frm.Dispose(); }
private void btnCompany_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("COMPANY", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtCompanyCode.Text = frm.BaseMasterTable.Code; txtCompanyName.Text = frm.BaseMasterTable.Name; txtCompanyCode.Focus(); txtRolesCode.Focus(); } } frm.Dispose(); }
private void btnReported_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("Customer", "TYPE = 2"); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtReported.Text = frm.BaseMasterTable.Code; txtReportedName.Text = frm.BaseMasterTable.Name; txtReported.Focus(); ReportedDate.Focus(); } } frm.Dispose(); }
private void btnProduct_Group_Click(object sender, EventArgs e) { FrmMasterSearch frm = new FrmMasterSearch("PRODUCT_GROUP", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { txtProduct_Group_Code.Text = frm.BaseMasterTable.Code; txtProduct_Group_Name.Text = frm.BaseMasterTable.Name; btnProduct_Group.Focus(); } } frm.Dispose(); //initLocation(); }
private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == dgvData.Columns["BtnProduct"].Index) { FrmMasterSearch frm = new FrmMasterSearch("PRODUCT", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { DataGridViewRow dr = dgvData.Rows[e.RowIndex]; string code = frm.BaseMasterTable.Code; BaseProductTable productTable = bProduct.GetModel(code); BaseStockTable stock = bStock.GetModel(txtDepartualCode.Text.Trim(), productTable.CODE); BAlloation bAlloation = new BAlloation(); if (productTable != null) { dr.Cells["PRODUCT_CODE"].Value = productTable.CODE; dr.Cells["PRODUCT_NAME"].Value = productTable.NAME; decimal alloationQuantity = bAlloation.GetAlloationQuantity(txtDepartualCode.Text.Trim(), productTable.CODE); dr.Cells["QUANTITY"].Value = stock.QUANTITY - alloationQuantity; dr.Cells["UNIT_NAME"].Value = bCommon.GetBaseMaster("UNIT", productTable.BASIC_UNIT_CODE).Name; dr.Cells["UNIT_CODE"].Value = productTable.BASIC_UNIT_CODE; dr.Cells["TRANSFER_QUANTITY"].Value = "1"; } else { MessageBox.Show("商品不存在.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); dr.Cells["QUANTITY"].Value = "0"; dr.Cells["CODE"].Selected = true; } } } frm.Dispose(); } } catch (Exception ex) { } }
private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == dgvData.Columns["BtnProduct"].Index) { StringBuilder sb = new StringBuilder(); sb.Append(" (PRODUCT_FLAG = 2 OR PRODUCT_FLAG = 4)"); sb.AppendFormat(" AND SUPPLIER_CODE LIKE '%{0}%'", txtSupplierCode.Text.Trim()); FrmMasterSearch frm = new FrmMasterSearch("PRODUCT", sb.ToString()); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { DataGridViewRow dr = dgvData.Rows[e.RowIndex]; string code = frm.BaseMasterTable.Code; BaseProductTable productTable = bProduct.GetModel(code); string taxation = cboTax.Text.Replace("%", ""); if (productTable != null) { if (!productTable.CODE.Equals(dr.Cells["OLD_CODE"].Value)) //商品编号未变换 { dr.Cells["PRODUCT_CODE"].Value = productTable.CODE; dr.Cells["OLD_CODE"].Value = productTable.CODE; dr.Cells["NAME"].Value = productTable.NAME; dr.Cells["SPEC"].Value = productTable.SPEC + " " + productTable.MODEL_NUMBER; dr.Cells["QUANTITY"].Value = 1; if (bCommon.GetBaseMaster("UNIT", productTable.BASIC_UNIT_CODE) != null) { dr.Cells["UNIT_NAME"].Value = bCommon.GetBaseMaster("UNIT", productTable.BASIC_UNIT_CODE).Name; } dr.Cells["UNIT_CODE"].Value = productTable.BASIC_UNIT_CODE; dr.Cells["PRICE"].Value = productTable.PURCHASE_PRICE; dr.Cells["AMOUNT"].Value = productTable.PURCHASE_PRICE; dr.Cells["AMOUNT_INCLUDED_TAX"].Value = productTable.PURCHASE_PRICE * (1 + CConvert.ToDecimal(cboTax.Text.Replace("%", "")) / 100); CalculateAmount(); } } else { MessageBox.Show("外购件不存在.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); dr.Cells["PRODUCT_CODE"].Value = ""; dr.Cells["NAME"].Value = ""; dr.Cells["SPEC"].Value = ""; dr.Cells["QUANTITY"].Value = "0"; dr.Cells["UNIT_NAME"].Value = ""; dr.Cells["UNIT_CODE"].Value = ""; dr.Cells["PRICE"].Value = "0"; dr.Cells["AMOUNT"].Value = "0"; dr.Cells["AMOUNT_INCLUDED_TAX"].Value = "0"; //dr.Cells["CODE"].Selected = true; CalculateAmount(); } } } frm.Dispose(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void dgvData_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == dgvData.Columns["BTN_DELETE"].Index) { if (MessageBox.Show("确定要删除当前行吗?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK) { if (dgvData.Rows.Count != 1) { dgvData.Rows.Remove(dgvData.Rows[e.RowIndex]); } else { dgvData.Rows.Remove(dgvData.Rows[e.RowIndex]); dgvData.Rows.Add(1); } CalculateAmount(); } } else if (e.ColumnIndex == dgvData.Columns["BTN_CODE"].Index) { FrmMasterSearch frm = new FrmMasterSearch("SLIP_TYPE", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { dgvData.Rows[e.RowIndex].Cells["CODE"].Value = frm.BaseMasterTable.Code; dgvData.Rows[e.RowIndex].Cells["NAME"].Value = frm.BaseMasterTable.Name; dgvData.Rows[e.RowIndex].Cells["METERIAL"].Value = "铸钢(ZG270-500)"; dgvData.Rows[e.RowIndex].Cells["SPEC"].Selected = true; NewRow(); } } frm.Dispose(); } else if (e.ColumnIndex == dgvData.Columns["BTN_METERIAL"].Index) { FrmMasterSearch frm = new FrmMasterSearch("MATERIAL", ""); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { //dgvData.Rows[e.RowIndex].Cells["CODE"].Value = frm.BaseMasterTable.Code; dgvData.Rows[e.RowIndex].Cells["METERIAL"].Value = frm.BaseMasterTable.Name; NewRow(); } } frm.Dispose(); } else if (e.ColumnIndex == dgvData.Columns["BTN_PARTS_CODE"].Index) { bool b = CConvert.ToBoolean(this.dgvData.Rows[e.RowIndex].Cells["checkboxflag"].Value); if (b) { string str = dgvData.Rows[e.RowIndex].Cells["CODE"].Value.ToString(); StringBuilder sb = new StringBuilder(); sb.AppendFormat("SLIP_TYPE_CODE = '{0}'", str); FrmMasterSearch frm = new FrmMasterSearch("SLIP_TYPE_COMPOSITION_PRODUCTS_VIEW", sb.ToString()); if (frm.ShowDialog(this) == DialogResult.OK) { if (frm.BaseMasterTable != null) { dgvData.Rows[e.RowIndex].Cells["COMPOSITION_PRODUCTS_CODE"].Value = frm.BaseMasterTable.Code; dgvData.Rows[e.RowIndex].Cells["COMPOSITION_PRODUCTS_NAME"].Value = frm.BaseMasterTable.Name; if (dgvData.Rows.Count > 1) { if (dgvData.Rows[e.RowIndex].Cells["COMPOSITION_PRODUCTS_NAME"].Value.ToString() != "") { dgvData.Rows[e.RowIndex].Cells["SPEC"].Value = dgvData.Rows[e.RowIndex - 1].Cells["SPEC"].Value; dgvData.Rows[e.RowIndex].Cells["DESCRIPTION"].Value = dgvData.Rows[e.RowIndex - 1].Cells["DESCRIPTION"].Value; } } NewRow(); } } frm.Dispose(); } } } catch { } }