private void txtsupCom_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModelWare; txtsupCom.Text = _model.SupCom; } }
private void txtAnalysisUnit_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModelWare; txtAnalysisUnit.Text = _model.AnalysisUnit; } }
private void txtunit_DoubleClick(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { PurchaseApplicationEntity _model = new PurchaseApplicationEntity(); _model = form.getModel; txtunit.Text = _model.buyer; } }
private void txtsupplier_Click(object sender, System.EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; if (form.SelectCompany == null) return; txtsupplier.Text = form.SelectCompany.fullname; txtsupplier.Tag = form.SelectCompany.code; }
private void txtshipMent_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModelWare; txtshipMent.Text = _model.shipMent; txtshipMentUser.Text = _model.shipMentUser; } }
private void txtdeliveryLast_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); FishEntity.PurchaseApplicationEntity get1 = new FishEntity.PurchaseApplicationEntity(); if (form.ShowDialog() == DialogResult.OK) { get1 = form.getModel; txtdeliveryLast.Text = get1.buyer; txtdeliveryLastUse.Text = get1.buyerUser; } }
//采购方 private void txtpurchase_DoubleClick(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModel; txtpurchase.Text = _model.buyer; //txtpurchaseAbb.Text = _model.buyerAbb; txtpurchaseUser.Text = _model.buyerUser; } }
private void txtCompany_Click(object sender, EventArgs e) { FormCompanyList from = new FormCompanyList( ); from.StartPosition = FormStartPosition.CenterParent; if (from.ShowDialog( ) != DialogResult.OK) { return; } txtCompany.Text = from.SelectCompany.fullname; txtCompany.Tag = from.SelectCompany.code; }
//供方 private void txtsupplier_DoubleClick(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); if (form.ShowDialog() == DialogResult.OK) { _model = form.getModel; txtsupplier.Text = _model.buyer; //txtsupplierAbb.Text = _model.buyerAbb; txtsupplierUser.Text = _model.buyerUser; txtaccount.Text = form.getModel.account.ToString(); txtBank.Text = form.getModel.Bank.ToString(); } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) { return; } if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("yifang", StringComparison.OrdinalIgnoreCase) == true) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } dataGridView1.Rows[e.RowIndex].Cells["companyid"].Value = form.SelectCompany.id; //dataGridView1.Rows[e.RowIndex].Cells["companycode"].Value = form.SelectCompany.code; dataGridView1.Rows[e.RowIndex].Cells["yifang"].Value = form.SelectCompany.fullname; //dataGridView1.Rows[e.RowIndex].Cells["customerid"].Value = string.Empty; //dataGridView1.Rows[e.RowIndex].Cells["customercode"].Value = string.Empty; //dataGridView1.Rows[e.RowIndex].Cells["customer"].Value = string.Empty; } if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("linkman", StringComparison.OrdinalIgnoreCase) == true) { if (dataGridView1.Rows[e.RowIndex].Cells["yifang"].Value == null || string.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells["yifang"].Value.ToString()) == true) { MessageBox.Show("请先选择单位,再操作。"); return; } int companyId = 0; int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["companyid"].Value.ToString(), out companyId); UIForms.FormSelectCustomer form = new UIForms.FormSelectCustomer(companyId); form.StartPosition = FormStartPosition.CenterParent; DialogResult result = form.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { FishEntity.CustomerEntity customer = form.SelectedCustomer; if (customer != null) { dataGridView1.Rows[e.RowIndex].Cells["linkman"].Value = customer.name; //dataGridView1.Rows[e.RowIndex].Cells["customercode"].Value = customer.code; //dataGridView1.Rows[e.RowIndex].Cells["customerid"].Value = customer.id; } } } }
//需方 private void txtdemand_Click(object sender, EventArgs e) { FormCompanyList from = new FormCompanyList( ); DialogResult result = from.ShowDialog( ); if (result == DialogResult.OK) { if (from.SelectCompany == null) { return; } txtdemand.Text = from.SelectCompany.fullname; txtdemand.Tag = from.SelectCompany.code; } }
private void textunit_Click(object sender, EventArgs e) { FormCompanyList Form = new FormCompanyList(); Form.StartPosition = FormStartPosition.CenterParent; if (Form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (Form.SelectCompany == null) { return; } textunit.Text = Form.SelectCompany.fullname; textunit.Tag = Form.SelectCompany.code; }
private void txtCompanyName_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } SetCompanyData(form.SelectCompany); }
protected void SelectCompany(TextBox txt) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } txt.Tag = form.SelectCompany.code; txt.Text = form.SelectCompany.shortname; }
private void Sellers_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } Sellers.Text = form.SelectCompany.fullname; Sellers.Tag = form.SelectCompany; }
private void txtDemandSide_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } txtDemandSide.Text = form.SelectCompany.fullname; txtDemandSide.Tag = form.SelectCompany.code; txtDemandSideShort.Text = form.SelectCompany.shortname; }
private void txtsupplier_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } txtsupplier.Text = form.SelectCompany.fullname; txtsupplier.Tag = form.SelectCompany.code; txtSupplierAbbreviation.Text = form.SelectCompany.shortname; txtPurchasingcontacts.Text = form.SelectCompany.linkman; txtPurchasingcontacts.Tag = form.SelectCompany.linkmancode; }
private void txtquotesuppliercode_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } txtquotesuppliercode.Text = form.SelectCompany.fullname; txtquotesuppliercode.Tag = form.SelectCompany.code; txtquotelinkman.Text = string.Empty; txtquotelinkman.Tag = string.Empty; }
private void txtCustomer_Click(object sender, EventArgs e) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } txtCustomer.Text = form.SelectCompany.fullname; txtCustomer.Tag = form.SelectCompany.code; FishBll.Bll.CustomerBll bll = new FishBll.Bll.CustomerBll(); List <FishEntity.CustomerEntity> mans = bll.GetCustomerOfCompany(form.SelectCompany.id); if (mans == null) { mans = new List <FishEntity.CustomerEntity>(); } cmbTheperson.SelectedValue = form.SelectCompany.salesman; cmbTheperson.Tag = form.SelectCompany.salesmancode; panel2.Controls.Clear(); foreach (FishEntity.CustomerEntity item in mans) { CheckBox chk = new CheckBox(); chk.Text = item.name.Trim(); chk.Tag = item; chk.AutoSize = true; chk.Checked = false; chk.Dock = DockStyle.Left; panel2.Controls.Add(chk); } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) { return; } if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("company", StringComparison.OrdinalIgnoreCase) == true) { FormCompanyList form = new FormCompanyList(); form.StartPosition = FormStartPosition.CenterParent; if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK) { return; } if (form.SelectCompany == null) { return; } dataGridView1.Rows[e.RowIndex].Cells["companyid"].Value = form.SelectCompany.id; dataGridView1.Rows[e.RowIndex].Cells["companycode"].Value = form.SelectCompany.code; dataGridView1.Rows[e.RowIndex].Cells["company"].Value = form.SelectCompany.fullname; dataGridView1.Rows[e.RowIndex].Cells["customerid"].Value = string.Empty; dataGridView1.Rows[e.RowIndex].Cells["customercode"].Value = string.Empty; dataGridView1.Rows[e.RowIndex].Cells["customer"].Value = string.Empty; } if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("customer", StringComparison.OrdinalIgnoreCase) == true) { if (dataGridView1.Rows[e.RowIndex].Cells["company"].Value == null || string.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells["company"].Value.ToString()) == true) { MessageBox.Show("请先选择单位,再操作。"); return; } int companyId = 0; int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["companyid"].Value.ToString(), out companyId); UIForms.FormSelectCustomer form = new UIForms.FormSelectCustomer(companyId); form.StartPosition = FormStartPosition.CenterParent; DialogResult result = form.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { FishEntity.CustomerEntity customer = form.SelectedCustomer; if (customer != null) { dataGridView1.Rows[e.RowIndex].Cells["customer"].Value = customer.name; dataGridView1.Rows[e.RowIndex].Cells["customercode"].Value = customer.code; dataGridView1.Rows[e.RowIndex].Cells["customerid"].Value = customer.id; } } } if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("btnasync", StringComparison.OrdinalIgnoreCase) == true) { // if (Check() == false) { return; } decimal latestprice = 0; decimal latedollars = 0; decimal latermb = 0; decimal lateweight = 0; string latedate; decimal laterate; string companycode; string companyname; string customercode; string customername; int latequantity = 0; DateTime latestTime = DateTime.MinValue; DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; int id = 0; object obj = row.Cells["id"].EditedFormattedValue; if (obj == null) { id = 0; } else { int.TryParse(obj.ToString(), out id); } decimal temp2; decimal.TryParse(row.Cells["dollars"].EditedFormattedValue.ToString(), out temp2); latedollars = temp2; decimal.TryParse(row.Cells["rmb"].EditedFormattedValue.ToString(), out temp2); latermb = temp2; companycode = row.Cells["companycode"].Value == null ? "" : row.Cells["companycode"].Value.ToString(); companyname = row.Cells["company"].Value == null ? "" : row.Cells["company"].Value.ToString(); customercode = row.Cells["customercode"].Value == null ? "" : row.Cells["customercode"].Value.ToString();; customername = row.Cells["customer"].Value == null ? "" : row.Cells["customer"].Value.ToString(); decimal.TryParse(row.Cells["weight"].EditedFormattedValue == null ? "0" : row.Cells["weight"].EditedFormattedValue.ToString(), out temp2); lateweight = temp2; int quantity = 0; int.TryParse(row.Cells["quantity"].EditedFormattedValue == null ? "0" : row.Cells["quantity"].EditedFormattedValue.ToString(), out quantity); latequantity = quantity; DateTime quotedate; DateTime.TryParse(row.Cells["date"].EditedFormattedValue.ToString(), out quotedate); DateTime quotetime; DateTime.TryParse(row.Cells["time"].EditedFormattedValue.ToString(), out quotetime); latedate = quotedate.ToString("yyyy/MM/dd") + " " + quotetime.ToString("HH:mm:ss"); decimal.TryParse(row.Cells["rate"].EditedFormattedValue == null ? "0" : row.Cells["rate"].EditedFormattedValue.ToString(), out temp2); laterate = temp2; bool isok = _bll.UpdateLatestQuote(_productId, latedollars, latermb, companycode, companyname, customercode, customername, latedate, lateweight, latequantity); if (isok) { OnRefreshData(_productId, latestprice, latedollars, latermb, laterate, latestTime.ToString("yyyy/MM/dd HH:mm:ss"), companyname, customername, lateweight, latequantity); MessageBox.Show("同步成功"); } else { MessageBox.Show("同步失败"); } } }