public frm3rdpartyAddress(AccountsReceivable.Transactions.SalesOrders.SalesOrder so) { InitializeComponent(); ppAddress.Properties.DataSource = new DataView(HertexData.Customers.Get3rdPartyAddressList()); txtcontactnumber.KeyUp += Txtcontactnumber_KeyUp; document = so; txtName.Text = so.AddressFor3rdParty.PartyName; txtAddr1.Text = so.AddressFor3rdParty.Addr1; txtAddr2.Text = so.AddressFor3rdParty.Addr2; txtAddr3.Text = so.AddressFor3rdParty.Addr3; txtAddr4.Text = so.AddressFor3rdParty.Addr4; txtAddr5.Text = so.AddressFor3rdParty.Addr5; txtAddrPC.Text = so.AddressFor3rdParty.AddrPC; txtContactPerson.Text = so.AddressFor3rdParty.ContactPerson; txtcontactnumber.Text = so.AddressFor3rdParty.ContactNumber; ppAddress.ParseEditValue += HandleParseEditValue; ppAddress.CustomDisplayText += HandleDisplayText; ppAddress.EditValueChanged += PpAddress_EditValueChanged; List <Control> cntrls = CTechCore.Tools.Forms.GetControls(this).ToList(); foreach (Control ctrl in cntrls) { ctrl.GotFocus += (o, args) => { var c = o as Control; Console.WriteLine(c.GetType().ToString()); c.BackColor = Color.Silver; System.Reflection.MethodInfo theMethod = c.GetType().GetMethod("SelectAll"); if (theMethod != null && !(c is DevExpress.XtraEditors.TextBoxMaskBox)) { theMethod.Invoke(c, null); } }; ctrl.LostFocus += (o, args) => { var c = o as Control; ctrl.BackColor = Color.Empty; }; } }
private void btnSave_Click(object sender, EventArgs e) { AccountsReceivable.Transactions.SalesOrders.SalesOrder so = ((AccountsReceivable.Transactions.SalesOrders.SalesOrder)document); so.DeliveryAddress.Addr1 = textEdit1.Text; so.DeliveryAddress.Addr2 = textEdit2.Text; so.DeliveryAddress.Addr3 = textEdit3.Text; so.DeliveryAddress.Addr4 = textEdit4.Text; so.DeliveryAddress.Addr5 = textEdit5.Text; so.DeliveryAddress.AddrPC = textEdit6.Text; so.InvoiceAddress.Addr1 = textEdit7.Text; so.InvoiceAddress.Addr2 = textEdit8.Text; so.InvoiceAddress.Addr3 = textEdit9.Text; so.InvoiceAddress.Addr4 = textEdit10.Text; so.InvoiceAddress.Addr5 = textEdit11.Text; so.InvoiceAddress.AddrPC = textEdit12.Text; this.DialogResult = DialogResult.OK; }
private void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtName.Text)) { AccountsReceivable.Transactions.SalesOrders.SalesOrder so = ((AccountsReceivable.Transactions.SalesOrders.SalesOrder)document); so.AddressFor3rdParty = new AddressFor3rdParty() { ClientID = so.CustomerID, PartyName = txtName.Text, Addr1 = txtAddr1.Text, Addr2 = txtAddr2.Text, Addr3 = txtAddr3.Text, Addr4 = txtAddr4.Text, Addr5 = txtAddr5.Text, AddrPC = txtAddrPC.Text, ContactPerson = txtContactPerson.Text, ContactNumber = txtcontactnumber.Text }; so.AddressFor3rdParty.Save(); this.DialogResult = DialogResult.OK; this.Close(); } }