private void button3_Click(object sender, EventArgs e) { dlgSearchCustomer searhCustomer = new dlgSearchCustomer(); searhCustomer.Owner = this; searhCustomer.ShowDialog(); }
private void btnRick_Click(object sender, EventArgs e) { dlgSearchCustomer searhCustomer = new dlgSearchCustomer(); searhCustomer.Owner = this.ParentForm; searhCustomer.ShowDialog(); if (searhCustomer.Custno != "") { txtRiskCusId.Text = searhCustomer.CustId; txtPatnerNr.Text = searhCustomer.Custno; txtParnerName.Text = searhCustomer.CustName; txtRishLevel.Value = ContractFrm.objContract.RiskLevel; ContractCustomer RiskCustId = new ContractCustomer(); RiskCustId.Name = searhCustomer.CustName; int id; bool tmp = int.TryParse(searhCustomer.CustId, out id); if (tmp) { RiskCustId.CustId = id; } tmp = int.TryParse(searhCustomer.Custno, out id); if (tmp) { RiskCustId.CustNr = id; } ContractFrm.objContract.RiskCustId = RiskCustId; } }
private void btnSearchCustomer2_Click(object sender, EventArgs e) { //Contract customer dlgSearchCustomer searhCustomer = new dlgSearchCustomer(); searhCustomer.Owner = this.ParentForm; searhCustomer.ShowDialog(); ContractCustomer cc = new ContractCustomer(); int id = -1; bool tmp = int.TryParse(searhCustomer.CustId, out id); if (tmp) { cc.CustId = id; } int custno = -1; bool tmp2 = int.TryParse(searhCustomer.Custno, out custno); if (tmp2) { cc.CustNr = custno; } cc.Name = searhCustomer.CustName; cc.Address = searhCustomer.CustAddress; cc.Email = searhCustomer.CustEmail; cc.Phone = searhCustomer.CustPhone; if (!string.IsNullOrEmpty(searhCustomer.Custno)) { this.txtContractCusNr.Text = searhCustomer.Custno; this.txtContractCusName.Text = searhCustomer.CustName; this.txtContractCusAdd.Text = searhCustomer.CustAddress; this.txtContractCusEmail.Text = searhCustomer.CustEmail; this.txtContractCusPhone.Text = searhCustomer.CustPhone; ContractFrm.objContract.ContractCustId = cc; //check contract Variant bool chk = Contract.checkContractVariant(cc.CustId); this.chkContractVariant.Checked = chk; } }
private void btnNew_Click(object sender, EventArgs e) { dlgSearchCustomer searhCustomer = new dlgSearchCustomer(); searhCustomer.Owner = this.ParentForm; searhCustomer.ShowDialog(); if (searhCustomer.Custno != "") { DataRow drToAdd = dataTable.NewRow(); drToAdd["RiskPartnerCustId"] = Int32.Parse(searhCustomer.CustId); drToAdd["Name"] = searhCustomer.CustName; List <SubContractorContract> SubContracts = ContractFrm.objContract.SubContracts; foreach (SubContractorContract subContract in SubContracts) { drToAdd["sub" + subContract.OID] = 0; } dataTable.Rows.Add(drToAdd); dataTable.AcceptChanges(); } }