public void BindingChanged() { PrintSenderDTO psDTO = new PrintSenderDTO(); if (cmb_Company.SelectedValue != null) { Guid fillialeID = (Guid)cmb_Company.SelectedValue; if (cmb_Company.SelectedValue != null) { Guid salePlatformID = (Guid)cmb_SalePlatform.SelectedValue; psDTO = PrintDatas.printSenderDTOList.Find(p => p.CompanyID == fillialeID && p.SalePlatformID == salePlatformID); } if (psDTO == null) { psDTO = PrintDatas.printSenderDTOList.Find(p => p.CompanyID == fillialeID && p.SalePlatformID == new Guid()); } } if (psDTO == null) { txt_Sender.Text = string.Empty; txt_Signature.Text = string.Empty; txt_Phone.Text = string.Empty; txt_Mobile.Text = string.Empty; txt_Departure.Text = string.Empty; txt_WebSite.Text = string.Empty; txt_CompanyName.Text = string.Empty; txt_Address.Text = string.Empty; txt_Header.Text = string.Empty; txt_Footer.Text = string.Empty; txt_GlassFooter.Text = string.Empty; } else { txt_Sender.Text = psDTO.Sender; txt_Signature.Text = psDTO.Signature; txt_Phone.Text = psDTO.Phone; txt_Mobile.Text = psDTO.Mobile; txt_Departure.Text = psDTO.Departure; txt_WebSite.Text = psDTO.WebSite; txt_CompanyName.Text = psDTO.CompanyName; txt_Address.Text = psDTO.Address; txt_Header.Text = psDTO.Header; txt_Footer.Text = psDTO.Footer; txt_GlassFooter.Text = psDTO.GlassFooter; } }
private void BT_SenderOk_Click(object sender, EventArgs e) { PrintSenderDTO psFindDTO = PrintDatas.printSenderDTOList.Find(p => p.CompanyID == (Guid)cmb_Company.SelectedValue && p.SalePlatformID == (Guid)cmb_SalePlatform.SelectedValue); if (psFindDTO == null) { PrintDatas.printSenderDTOList.Add(new PrintSenderDTO() { ID = Guid.NewGuid(), CompanyID = (Guid)cmb_Company.SelectedValue, SalePlatformID = (Guid)cmb_SalePlatform.SelectedValue, Sender = txt_Sender.Text, Signature = txt_Signature.Text, Phone = txt_Phone.Text, Mobile = txt_Mobile.Text, Departure = txt_Departure.Text, WebSite = txt_WebSite.Text, CompanyName = txt_CompanyName.Text, Address = txt_Address.Text, Header = txt_Header.Text, Footer = txt_Footer.Text, GlassFooter = txt_GlassFooter.Text }); } else { psFindDTO.Sender = txt_Sender.Text; psFindDTO.Signature = txt_Signature.Text; psFindDTO.Phone = txt_Phone.Text; psFindDTO.Mobile = txt_Mobile.Text; psFindDTO.Departure = txt_Departure.Text; psFindDTO.WebSite = txt_WebSite.Text; psFindDTO.CompanyName = txt_CompanyName.Text; psFindDTO.Address = txt_Address.Text; psFindDTO.Header = txt_Header.Text; psFindDTO.Footer = txt_Footer.Text; psFindDTO.GlassFooter = txt_GlassFooter.Text; } }