private void txtcSup_code_ChooserClick(object sender, EventArgs e) { frmSupplier frmSup = new frmSupplier(); if (frmSup.ShowDialog() == DialogResult.OK) { txtcSup_code.Text = frmSup.supperCode; txtSup_name.Caption = frmSup.supperName; } }
/// <summary> 选择配件编码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtsup_code_ChooserClick(object sender, EventArgs e) { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); string supperID = chooseSupplier.supperID; if (!string.IsNullOrEmpty(supperID)) { txtsup_code.Text = chooseSupplier.supperCode; txtsup_name.Caption = chooseSupplier.supperName; } }
//往来单位1选择器 private void txtcCustName1_ChooserClick(object sender, EventArgs e) { if (cboOrderType.SelectedValue == null) { return; } DataSources.EnumAccountVerification enumAccount = (DataSources.EnumAccountVerification)Convert.ToInt32(cboOrderType.SelectedValue); switch (enumAccount) { case DataSources.EnumAccountVerification.YuShouToYingShou://预收冲应收 case DataSources.EnumAccountVerification.YingShouToYingShou://应收转应收 case DataSources.EnumAccountVerification.YingShouToYingFu://应收冲应付 case DataSources.EnumAccountVerification.YuShouToYuShou://预收转预收 frmCustomerInfo frmCustomer = new frmCustomerInfo(); if (frmCustomer.ShowDialog() == DialogResult.OK) { txtcCustName1.Tag = frmCustomer.strCustomerId; cust_code1 = frmCustomer.strCustomerNo; txtcCustName1.Text = frmCustomer.strCustomerName; if (txtcCustName2.Tag == null && enumAccount != DataSources.EnumAccountVerification.YingShouToYingFu)//没有选择应收客户,默认选择与预收客户相同 { txtcCustName2.Tag = frmCustomer.strCustomerId; cust_code2 = frmCustomer.strCustomerNo; txtcCustName2.Text = frmCustomer.strCustomerName; } if (txtAdvanceBalance.Visible) { txtAdvanceBalance.Caption = DBOperation.WaiLaiYuE(frmCustomer.strCustomerId, DataSources.EnumOrderType.RECEIVABLE).ToString(); } } break; case DataSources.EnumAccountVerification.YuFuToYingFu://预付冲应付 case DataSources.EnumAccountVerification.YingFuToYingFu://应付转应付 case DataSources.EnumAccountVerification.YingFuToYingShou://应付冲应收 case DataSources.EnumAccountVerification.YuFuToYuFu://预付转预付 frmSupplier frmSupp = new frmSupplier(); if (frmSupp.ShowDialog() == DialogResult.OK) { txtcCustName1.Tag = frmSupp.supperID; cust_code1 = frmSupp.supperCode; txtcCustName1.Text = frmSupp.supperName; if (txtcCustName2.Tag == null && enumAccount != DataSources.EnumAccountVerification.YingFuToYingShou) { txtcCustName2.Tag = frmSupp.supperID; cust_code2 = frmSupp.supperCode; txtcCustName2.Text = frmSupp.supperName; } if (txtAdvanceBalance.Visible) { txtAdvanceBalance.Caption = DBOperation.WaiLaiYuE(frmSupp.supperID, DataSources.EnumOrderType.PAYMENT).ToString(); } } break; } }
//往来单位2选择器 private void txtcCustName2_ChooserClick(object sender, EventArgs e) { if (cboOrderType.SelectedValue == null) { return; } DataSources.EnumAccountVerification enumAccount = (DataSources.EnumAccountVerification)Convert.ToInt32(cboOrderType.SelectedValue); switch (enumAccount) { case DataSources.EnumAccountVerification.YuShouToYingShou://预收冲应收 case DataSources.EnumAccountVerification.YingShouToYingShou://应收转应收 case DataSources.EnumAccountVerification.YingFuToYingShou://应付冲应收 case DataSources.EnumAccountVerification.YuShouToYuShou://预收转预收 frmCustomerInfo frmCustomer = new frmCustomerInfo(); if (frmCustomer.ShowDialog() == DialogResult.OK) { txtcCustName2.Tag = frmCustomer.strCustomerId; cust_code2 = frmCustomer.strCustomerNo; txtcCustName2.Text = frmCustomer.strCustomerName; } break; case DataSources.EnumAccountVerification.YuFuToYingFu://预付冲应付 case DataSources.EnumAccountVerification.YingFuToYingFu://应付转应付 case DataSources.EnumAccountVerification.YingShouToYingFu://应收冲应付 case DataSources.EnumAccountVerification.YuFuToYuFu://预付转预付 frmSupplier frmSupp = new frmSupplier(); if (frmSupp.ShowDialog() == DialogResult.OK) { txtcCustName2.Tag = frmSupp.supperID; cust_code2 = frmSupp.supperCode; txtcCustName2.Text = frmSupp.supperName; } break; } }
/// <summary> 选择供应商 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtsup_name_ChooserClick(object sender, EventArgs e) { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); string supperid = chooseSupplier.supperID; if (!string.IsNullOrEmpty(supperid)) { sup_code = chooseSupplier.supperCode; txtsup_name.Text = chooseSupplier.supperName; txtbalance_unit.Text = chooseSupplier.supperName; DataTable dt = DBHelper.GetTable("查询供应商档案信息", "tb_supplier", "*", " enable_flag != 0 and sup_id='" + supperid + "'", "", ""); if (dt.Rows.Count > 0) { txtfax.Caption = dt.Rows[0]["sup_fax"].ToString(); txtcontacts_tel.Caption = dt.Rows[0]["sup_tel"].ToString(); } string TableName = string.Format(@"( select cont_name from tb_contacts where cont_id= (select cont_id from tr_base_contacts where relation_object_id='{0}' and is_default='1') ) tb_conts", supperid); DataTable dt_conts = DBHelper.GetTable("查询供应商默认的联系人信息", TableName, "*", "", "", ""); if (dt_conts != null && dt_conts.Rows.Count > 0) { txtcontacts.Caption = dt_conts.Rows[0]["cont_name"].ToString(); } else { txtcontacts.Caption = string.Empty; } //当供应商id不为空,同时变更供应商id时,需清空配件信息列表 if (sup_id != string.Empty && sup_id != chooseSupplier.supperID) { if (gvPurchaseList.Rows.Count > 0) { int PurchaseListRows = gvPurchaseList.Rows.Count; for (int i = 0; i < PurchaseListRows; i++) { if (PurchaseListRows > 1) { DeleteListInfoEidtImportStatus(i); i = -1; PurchaseListRows = gvPurchaseList.Rows.Count; } } } } sup_id = chooseSupplier.supperID; } }
/// <summary> 选择结算单位 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtbalance_unit_ChooserClick(object sender, EventArgs e) { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); string supperID = chooseSupplier.supperID; if (!string.IsNullOrEmpty(supperID)) { txtbalance_unit.Text = chooseSupplier.supperName; } }
//选择器 private void txtCustCode_ChooserClick(object sender, EventArgs e) { //应收选择客户 if (orderType == DataSources.EnumOrderType.RECEIVABLE) { frmCustomerInfo frm = new frmCustomerInfo(); if (frm.ShowDialog() == DialogResult.OK) { txtCustCode.Text = frm.strCustomerNo; txtCustName.Caption = frm.strCustomerName; } } else if (orderType == DataSources.EnumOrderType.PAYMENT)//应付选择供应商 { frmSupplier frmSupp = new frmSupplier(); if (frmSupp.ShowDialog() == DialogResult.OK) { txtCustCode.Text = frmSupp.supperCode; txtCustName.Caption = frmSupp.supperName; } } }
//往来单位1选择器 private void txtcCustName1_ChooserClick(object sender, EventArgs e) { if (CommonCtrl.IsNullToString(cboOrderType.SelectedValue) == "") { return; } DataSources.EnumAccountVerification enumAccount = (DataSources.EnumAccountVerification)Convert.ToInt32(cboOrderType.SelectedValue); switch (enumAccount) { case DataSources.EnumAccountVerification.YuShouToYingShou://预收冲应收 case DataSources.EnumAccountVerification.YingShouToYingShou://应收转应收 case DataSources.EnumAccountVerification.YingShouToYingFu://应收冲应付 case DataSources.EnumAccountVerification.YuShouToYuShou://预收转预收 frmCustomerInfo frmCustomer = new frmCustomerInfo(); if (frmCustomer.ShowDialog() == DialogResult.OK) { txtcCustName1.Tag = frmCustomer.strCustomerId; txtcCustName1.Text = frmCustomer.strCustomerName; if (txtcCustName2.Tag == null && enumAccount != DataSources.EnumAccountVerification.YingShouToYingFu)//没有选择应收客户,默认选择与预收客户相同 { txtcCustName2.Tag = frmCustomer.strCustomerId; txtcCustName2.Text = frmCustomer.strCustomerName; } } break; case DataSources.EnumAccountVerification.YuFuToYingFu://预付冲应付 case DataSources.EnumAccountVerification.YingFuToYingFu://应付转应付 case DataSources.EnumAccountVerification.YingFuToYingShou://应付冲应收 case DataSources.EnumAccountVerification.YuFuToYuFu://预付转预付 frmSupplier frmSupp = new frmSupplier(); if (frmSupp.ShowDialog() == DialogResult.OK) { txtcCustName1.Tag = frmSupp.supperID; txtcCustName1.Text = frmSupp.supperName; if (txtcCustName2.Tag == null && enumAccount != DataSources.EnumAccountVerification.YingFuToYingShou) { txtcCustName2.Tag = frmSupp.supperID; txtcCustName2.Text = frmSupp.supperName; } } break; } }
/// <summary> 选择供应商编码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtcust_code2_ChooserClick(object sender, EventArgs e) { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); if (!string.IsNullOrEmpty(chooseSupplier.supperID)) { txtcust_code2.Text = chooseSupplier.supperCode; txt_consignee2.Caption = chooseSupplier.supperName; } }
/// <summary> 选择结算单位 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtclosing_unit1_ChooserClick(object sender, EventArgs e) { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); if (!string.IsNullOrEmpty(chooseSupplier.supperID)) { txtclosing_unit1.Text = chooseSupplier.supperName; } }
/// <summary> 选择供应商编码 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtsup_code1_ChooserClick(object sender, EventArgs e) { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); sup_id = chooseSupplier.supperID; if (!string.IsNullOrEmpty(sup_id)) { sup_code = chooseSupplier.supperCode; txtsup_code1.Text = chooseSupplier.supperCode; txtsup_name.Caption = chooseSupplier.supperName; txtclosing_unit1.Text = chooseSupplier.supperName; DataTable dt = DBHelper.GetTable("查询供应商档案信息", "tb_supplier", "*", " enable_flag != 0 and sup_id='" + sup_id + "'", "", ""); if (dt.Rows.Count > 0) { txtfax.Caption = dt.Rows[0]["sup_tel"].ToString(); txtcontacts_tel.Caption = dt.Rows[0]["sup_fax"].ToString(); } string TableName = string.Format(@"( select cont_name from tb_contacts where cont_id= (select cont_id from tr_base_contacts where relation_object_id='{0}' and is_default='1') ) tb_conts",sup_id); DataTable dt_conts = DBHelper.GetTable("查询供应商默认的联系人信息", TableName, "*", "", "", ""); if (dt_conts != null && dt_conts.Rows.Count > 0) { txtcontacts.Caption = dt_conts.Rows[0]["cont_name"].ToString(); } else { txtcontacts.Caption = string.Empty; } } }
//往来单位选择 private void txtcCustName_ChooserClick(object sender, EventArgs e) { //应收选择客户 if (orderType == DataSources.EnumOrderType.RECEIVABLE) { frmCustomerInfo frm = new frmCustomerInfo(); if (frm.ShowDialog() == DialogResult.OK) { txtcCustName.Text = frm.strCustomerName; txtcCustName.Tag = frm.strCustomerId; cust_code = frm.strCustomerNo; //字动带出账户信息 DataTable dt = DBHelper.GetTable("", "tb_customer", "*", string.Format("cust_id='{0}'", frm.strCustomerId), "", ""); if (dt == null || dt.Rows.Count == 0) { return; } txtBankAccount.Caption = CommonCtrl.IsNullToString(dt.Rows[0]["bank_account"]); txtBankOfDeposit.Caption = CommonCtrl.IsNullToString(dt.Rows[0]["open_bank"]); epError.Clear(); txtAdvance.Caption = DBOperation.GetAdvance(frm.strCustomerId, orderType).ToString(); txtBalance.Caption = DBOperation.GetReceivable(frm.strCustomerId).ToString(); } } else if (orderType == DataSources.EnumOrderType.PAYMENT)//应付选择供应商 { frmSupplier frmSupp = new frmSupplier(); if (frmSupp.ShowDialog() == DialogResult.OK) { txtcCustName.Text = frmSupp.supperName; txtcCustName.Tag = frmSupp.supperID; cust_code = frmSupp.supperCode; epError.Clear(); txtAdvance.Caption = DBOperation.GetAdvance(frmSupp.supperID, orderType).ToString(); txtBalance.Caption = DBOperation.GetPayable(frmSupp.supperID).ToString(); } } }
/// <summary> 选择结算单位 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtclosing_unit1_ChooserClick(object sender, EventArgs e) { try { frmSupplier chooseSupplier = new frmSupplier(); chooseSupplier.ShowDialog(); if (!string.IsNullOrEmpty(chooseSupplier.supperID)) { txtclosing_unit1.Text = chooseSupplier.supperName; } } catch (Exception ex) { MessageBoxEx.Show("操作失败!"); HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }