//Members //Interface protected void Page_Load(object sender, EventArgs e) { //Event handler for page load event if (!Page.IsPostBack) { //Get query params long issueID = Convert.ToInt64(Request.QueryString["issueID"]); IssueMgtServiceClient client = new IssueMgtServiceClient(); Issue issue = client.GetIssue(issueID); Response.Write("Issue Type: " + issue.Type + "<br />"); Response.Write("Subject: " + issue.Subject + "<br />"); Response.Write("Contact: " + issue.ContactName + "<br /><br />"); Response.Write("Company: " + issue.CompanyName + "<br />"); Response.Write("Store: " + issue.StoreNumber.ToString() + "<br />"); Response.Write("Agent: " + issue.AgentNumber + "<br />"); Response.Write("Zone: " + issue.Zone); CustomerProxy cp = new CustomerProxy(); Argix.Customers.Action[] actions = cp.GetIssueActions(issueID); for (int i = 0; i < actions.Length; i++) { string cell = "<br /><br /><hr />"; cell += actions[i].Created.ToString("g") + ", " + actions[i].UserID; cell += "<br />"; cell += actions[i].TypeName; cell += "<br /><br />"; cell += actions[i].Comment; Response.Write(cell); } } }
//Members //Interface protected void Page_Load(object sender, EventArgs e) { //Event handler for page load event if (!Page.IsPostBack) { //Get query params IssueDS issues = new CustomerProxy().GetIssues(); for (int i = 0; i < issues.IssueTable.Rows.Count; i++) { IssueDS.IssueTableRow issue = issues.IssueTable[i]; TableCell zone = new TableCell(); zone.BorderStyle = BorderStyle.Solid; zone.BorderWidth = 1; zone.BorderColor = System.Drawing.Color.LightGray; zone.Text = !issue.IsZoneNull()?issue.Zone:""; TableCell store = new TableCell(); store.BorderStyle = BorderStyle.Solid; store.BorderWidth = 1; store.BorderColor = System.Drawing.Color.LightGray; store.Text = !issue.IsStoreNumberNull()?issue.StoreNumber.ToString():""; TableCell agent = new TableCell(); agent.BorderStyle = BorderStyle.Solid; agent.BorderWidth = 1; agent.BorderColor = System.Drawing.Color.LightGray; agent.Text = !issue.IsAgentNumberNull()?issue.AgentNumber:""; TableCell company = new TableCell(); company.BorderStyle = BorderStyle.Solid; company.BorderWidth = 1; company.BorderColor = System.Drawing.Color.LightGray; company.Text = !issue.IsCompanyNameNull()?issue.CompanyName:""; TableCell type = new TableCell(); type.BorderStyle = BorderStyle.Solid; type.BorderWidth = 1; type.BorderColor = System.Drawing.Color.LightGray; type.Text = issue.Type; TableCell action = new TableCell(); action.BorderStyle = BorderStyle.Solid; action.BorderWidth = 1; action.BorderColor = System.Drawing.Color.LightGray; action.Text = issue.LastActionDescription; TableCell received = new TableCell(); received.BorderStyle = BorderStyle.Solid; received.BorderWidth = 1; received.BorderColor = System.Drawing.Color.LightGray; received.Text = issue.LastActionCreated.ToString("MM/dd/yyyy"); TableCell subject = new TableCell(); subject.BorderStyle = BorderStyle.Solid; subject.BorderWidth = 1; subject.BorderColor = System.Drawing.Color.LightGray; subject.Text = !issue.IsSubjectNull()?issue.Subject:""; TableCell contact = new TableCell(); contact.BorderStyle = BorderStyle.Solid; contact.BorderWidth = 1; contact.BorderColor = System.Drawing.Color.LightGray; contact.Text = !issue.IsContactNameNull()?issue.ContactName:""; TableCell lastuser = new TableCell(); lastuser.BorderStyle = BorderStyle.Solid; lastuser.BorderWidth = 1; lastuser.BorderColor = System.Drawing.Color.LightGray; lastuser.Text = issue.LastActionUserID; TableCell coordinator = new TableCell(); coordinator.BorderStyle = BorderStyle.Solid; coordinator.BorderWidth = 1; coordinator.BorderColor = System.Drawing.Color.LightGray; coordinator.Text = issue.Coordinator; TableRow tr = new TableRow(); tr.Cells.AddRange(new TableCell[] { zone, store, agent, company, type, action, received, subject, contact, lastuser, coordinator }); this.tblPage.Rows.Add(tr); } } }
static void Main(string[] args) { _log = LogManager.GetLogger("Queaso.ConsoleClient.Main"); try { _log.Info(l => l("Start client application...")); _log.Info(l => l("Exercise 1 - Work with ChannelFactory & Channel")); Exercise1(); _log.Info(l => l("Exercise 2 - Work with Client Proxies")); Exercise2(); _log.Info(l => l("Behaviours")); var customerProxy = new CustomerProxy(); customerProxy.IsThisAnException(); Thread.Sleep(50); } catch (Exception ex) { _log.Error(ex); throw ex; } }
/// <summary> /// Constructor initializes Commands /// </summary> public CustomerFormViewModel() { TitleText = "Stwórz Klienta"; SaveCustomerCommand = new RelayCommand(SaveCustomer, SaveCanExcecute); OnPageLoadCommand = new RelayCommand(OnPageLoad); _cts = new CancellationTokenSource(); _customerProxy = new CustomerProxy(); }
/// <summary> /// Constructor initializes commands /// </summary> public CustomerHomeViewModel() { OnPageLoadCommand = new RelayCommand(OnPageLoad); RemoveCustomerCommand = new RelayCommand(RemoveCustomer); EditCustomerCommand = new RelayCommand(EditCustomer); _cts = new CancellationTokenSource(); _customerProxy = new CustomerProxy(); }
public Customer FindBy(Guid id) { Customer customer = new CustomerProxy(); // Code to connect to the database and retrieve a customer…Patterns in Data access ((CustomerProxy)customer).OrderRepository = _orderRepository; return(customer); }
public void GetCustomer() { ICustomer customer = new CustomerProxy(1); Assert.AreEqual(1, customer.Id); Assert.AreEqual("Customer 1", customer.Name); Assert.AreEqual("Address 1", customer.Address); Assert.AreEqual("Notes 1", customer.Notes); }
public EnrolmentSingleServiceViewModel() { _customerProxy = new CustomerProxy(); _serviceProxy = new ServicesProxy(); _serviceTypeProxy = new ServiceTypeProxy(); _employeeProxy = new EmployeeProxy(); OnPageLoadCommand = new RelayCommand(OnPageLoad); EnrolCommand = new RelayCommand(Enrol, EnrolCanExcecute); Initialize(); }
public EnrolmentCourseViewModel() { _serviceTypeProxy = new ServiceTypeProxy(); _servicesProxy = new ServicesProxy(); _customerProxy = new CustomerProxy(); OnPageLoadCommand = new RelayCommand(OnPageLoad); EnrolCommand = new RelayCommand(Enrol, EnrolCanExcecute); NextCommand = new RelayCommand(Next, NextCanExcecute); PrevCommand = new RelayCommand(Prev, PrevCanExcecute); Initialize(); }
public CustomerProxy(string id, string name, string sex,string phone,string address) : this() { ID = id; Name = name; Sex = sex; Phone = phone; Address = address; _original = new CustomerProxy() { ID = id, Name = name, Sex = sex, Phone = phone, Address = address }; }
/// <summary> /// Works with Proxies /// </summary> static void Exercise2() { var customerProxy = new CustomerProxy(); var list = customerProxy.GetList(); foreach (var item in list) { _log.Debug(l => l(item.CustomerID + " " + item.CompanyName)); } var output = customerProxy.WhoIAm("sd"); }
static void Main(string[] args) { Guid customerId = Guid.NewGuid(); IOrderRepository orderRepository = new OrderRepository(); Customer customer = new CustomerProxy() { OrderRepository = orderRepository, Id = customerId }; IEnumerable <Order> orders = customer.Orders; }
public void CustomerProxy_Should_Delegate_The_Retrieval_Of_Orders_To_The_OrderRepository() { Guid customerId = Guid.NewGuid(); var mockery = new Mock <IOrderRepository>(); mockery.Setup(or => or.FindAllBy(customerId)); Customer customer = new CustomerProxy() { OrderRepository = mockery.Object, Id = customerId }; IEnumerable <Order> orders = customer.Orders; mockery.VerifyAll(); }
public override void Execute(INotification notification) { CustomerProxy customerProxy = (CustomerProxy)Facade.RetrieveProxy(CustomerProxy.NAME); switch (notification.Name) { case NotiConst.GET_CUSTOMER_SPAWN_VALUE: customerProxy.RefreshCustomerSpawnValue(); break; case NotiConst.SET_CURRENT_CUSTOMER: customerProxy.SetCurrentCustomer((int)notification.Body); break; default: break; } }
public void ShouldMapProxy() { var customerProxy = new CustomerProxy { FirstName = "c1", ProxyName = "proxy1", RegDate = DateTime.Now }; Mapper.AddMap <Customer, CustomerInput>(src => { var res = new CustomerInput(); res.InjectFrom(src); res.RegDate = src.RegDate.ToShortDateString(); return(res); }); var input = Mapper.Map <Customer, CustomerInput>(customerProxy); Assert.AreEqual(customerProxy.RegDate.ToShortDateString(), input.RegDate); Assert.AreEqual(customerProxy.FirstName, input.FirstName); }
public static void Flight(string[] args) { ProxyFactory c1 = new ProxyFactory(); IClientProxy u1 = c1.Login("admin", "admin"); AdminProxy uu1 = (AdminProxy)u1; uu1.CreateCustomer(); IClientProxy u2 = c1.Login("elal", "4321"); CompanyProxy uu2 = (CompanyProxy)u2; uu2.CancelFlight(); IClientProxy u3 = c1.Login("aaa", "4321"); CustomerProxy uu3 = (CustomerProxy)u3; uu3.BuyTicket(); }
//Members //Interface protected void Page_Load(object sender, EventArgs e) { //Event handler for page load event if (!Page.IsPostBack) { //Get query params long issueID = Convert.ToInt64(Request.QueryString["issueID"]); IssueMgtServiceClient client = new IssueMgtServiceClient(); Issue issue = client.GetIssue(issueID); this.lblType.Text = issue.Type; this.lblSubject.Text = issue.Subject; this.lblContact.Text = issue.ContactName; this.lblCompany.Text = issue.CompanyName; this.lblStore.Text = issue.StoreNumber.ToString(); this.lblAgent.Text = issue.AgentNumber; this.lblZone.Text = issue.Zone; CustomerProxy cp = new CustomerProxy(); Argix.Customers.Action[] actions = cp.GetIssueActions(issueID); for (int i = 0; i < actions.Length; i++) { string cell = actions[i].Created.ToString("f") + " " + actions[i].UserID + ", " + actions[i].TypeName; cell += "<br /><br />"; cell += actions[i].Comment; cell += "<br />"; cell += "<hr />"; cell += "<br />"; TableCell tc = new TableCell(); tc.Text = cell; TableRow tr = new TableRow(); tr.Cells.Add(tc); this.tblPage.Rows.Add(tr); } } }
void MergeCustomers() { OrganizationTicketModel[] customers = Source.OrganizationTickets(); if (customers.Length == 0) { return; } OrganizationTicketModel[] destinationCustomers = Destination.OrganizationTickets(); foreach (OrganizationTicketModel customer in customers) { // WHERE NOT EXISTS(SELECT * FROM OrganizationTickets WHERE TicketID ={model.TicketID} and OrganizationId ={proxy.OrganizationID}) if (!destinationCustomers.Where(c => c.Organization.OrganizationID == customer.Organization.OrganizationID).Any()) { CustomerProxy customerProxy = new CustomerProxy() { OrganizationID = customer.Organization.OrganizationID }; Data_API.Create(Destination, customerProxy); } Data_API.Delete(customer); } }
public BFDQuery(AccountDetailProxy accountDetailProxy, CashFlowProxy cashFlowProxy, CustomerProxy customerProxy) { Name = "Query"; Description = "....."; Field <ListGraphType <CashFlowType> >( "CashFlow", resolve: context => cashFlowProxy.GetCashFlowDetails()); Field <ListGraphType <AccountBalanceType> >( "AccountBalance", resolve: context => accountDetailProxy.GetAccountBalances()); Field <ListGraphType <CustomerType> >( "Customer", resolve: context => customerProxy.GetCustomerList()); Field <CustomerType>( "GetCustomerByCustomerId", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IntGraphType> > { Name = "customerId" } ), resolve: context => { var customerId = context.GetArgument <int>("customerId"); return(customerProxy.GetCustomerById(customerId)); }); }
public override void Execute(INotification notification) { CustomerProxy customerProxy = Facade.RetrieveProxy(CustomerProxy.NAME) as CustomerProxy; customerProxy.AddCustomerModel((int)notification.Body); }
public GraphQLController(AccountDetailProxy accountDetailProxy, CashFlowProxy cashFlowProxy, CustomerProxy customerProxy) { _accountDetailsProxy = accountDetailProxy; _cashFlowProxy = cashFlowProxy; _customerProxy = customerProxy; }