private void OKButton_Click(object sender, RoutedEventArgs e) { if (this.txtTempaltename.Text != "") { if (cmbSalesRegion.SelectedValue.ToString() != "0") { RetailSystemClient mrsClient = new RetailSystemClient(); mrsClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(Internal.Utilities.GetMetriconRetailSystemWcfClientEndpointUrl()); if (_templateId == 0) { mrsClient.AddNewNotesTemplateCompleted += new EventHandler <AddNewNotesTemplateCompletedEventArgs>(mrsClient_AddNewNotesTemplateCompleted); mrsClient.AddNewNotesTemplateAsync(txtTempaltename.Text, cmbSalesRegion.SelectedValue.ToString(), (App.Current as App).CurrentUserId); } else { mrsClient.CopyNotesTemplateCompleted += new EventHandler <CopyNotesTemplateCompletedEventArgs>(mrsClient_CopyNotesTemplateCompleted); mrsClient.CopyNotesTemplateAsync(txtTempaltename.Text, cmbSalesRegion.SelectedValue.ToString(), (App.Current as App).CurrentUserId, _templateId.ToString()); } this.DialogResult = true; } else { RadWindow.Alert("Please select a region."); } } else { RadWindow.Alert("Please enter a template name."); } }
public void AddNewNoteTemplate() { if (NewTemplateName != "") { mrsClient = new RetailSystemClient(); mrsClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(Internal.Utilities.GetMetriconRetailSystemWcfClientEndpointUrl()); mrsClient.AddNewNotesTemplateCompleted += new EventHandler <AddNewNotesTemplateCompletedEventArgs>(mrsClient_AddNewNotesTemplateCompleted); mrsClient.AddNewNotesTemplateAsync(NewTemplateName, SelectedRegionId.ToString(), userid); mrsClient = null; } }