public static Store GetByCode(string code) { using (StoreServiceClient client = new StoreServiceClient()) { return(new Store(client.GetStoreByCode(code))); } }
public static Store GetById(int id) { using (StoreServiceClient client = new StoreServiceClient()) { return(new Store(client.GetStoreById(id))); } }
public Main() { InitializeComponent(); client = new StoreServiceClient(); gui = new StoreGUIServiceClient(new System.ServiceModel.InstanceContext(this)); client.Open(); gui.registerGui(); Dictionary<string, Book> books = client.getAllBooks(); foreach (string key in books.Keys) { string[] list = new string[3]; list[0] = books[key].title; list[1] = books[key].price.ToString(); list[2] = books[key].quantity.ToString(); ListViewItem v = new ListViewItem(list, books[key].title); stock.Items.Add(v); } Dictionary<int, StoreGUI.StoreServiceReference.Order> orders = client.getAllOrders(); foreach (int key in orders.Keys) { string[] list = new string[8]; list[0] = orders[key].id.ToString(); list[1] = orders[key].book.title; list[2] = orders[key].book.price.ToString(); list[3] = orders[key].quantity.ToString(); list[4] = orders[key].name; list[5] = orders[key].email; list[6] = orders[key].address; list[7] = orders[key].state.ToString(); ListViewItem v = new ListViewItem(list, orders[key].id.ToString()); ordersView.Items.Add(v); } }
public WarehouseForm(ServiceHost h) { open = false; host = h; storeproxy = new StoreServiceClient(new InstanceContext(this)); InitializeComponent(); ListViewHeader(); }
public Store() { using (StoreServiceClient client = new StoreServiceClient()) { Proxy = client.CreateStore(); client.Close(); } }
public StoreWindow() { InitializeComponent(); storeProxy = ((App)Application.Current).StoreProxy; RefreshScreen(); }
public Form1() { InitializeComponent(); _waitForResponse = new AutoResetEvent(false); InstanceContext callbackInstance = new InstanceContext(this); client = new StoreServiceClient(callbackInstance); }
protected void Page_Load(object sender, EventArgs e) { client = new StoreServiceClient(); Dictionary<string, Book> books = client.getAllBooks(); foreach (string t in books.Keys) { listTitle.Items.Add(new ListItem(t)); } }
public EmployeeForm(Employee empl, int department, DataTable deps, DataTable roles, DataTable users, StoreServiceClient client) { InitializeComponent(); employee = empl; _department = department; _deps = deps; _roles = roles; _users = users; _client = client; }
public StoreForm() { InitializeComponent(); storeProxy = new StoreServiceClient(new InstanceContext(this)); BooksView(); active = "books"; incoming = new List <KeyValuePair <string, string> >(); //storeProxy.Open(); }
public MainWindow() { InitializeComponent(); List<Good> goods = new List<Good>(); WCFStoreServiceManager.StoreServiceClient client = new StoreServiceClient(); goods = client.Goods().ToList<Good>(); //WCFClient wcfc = new WCFClient(); //goods = wcfc.Goods().ToList<Good>(); dg_goods.ItemsSource = goods; }
public WarehouseService() { client = new StoreServiceClient(); if (File.Exists(saveFile)) { load(saveFile); } else { orders = new List<WarehouseOrder>(); } }
public IEnumerable<StoreDAO> GetStores() { StoreServiceClient client = new StoreServiceClient(); try { IEnumerable<StoreDAO> result = client.GetStores(); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
public StoreDAO GetStore(int id) { StoreServiceClient client = new StoreServiceClient(); try { StoreDAO result = client.GetStoreByID(id); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
public bool PostStore(StoreDAO store) { StoreServiceClient client = new StoreServiceClient(); try { bool result = client.CreateStore(store); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
private void b_Delete_Click(object sender, RoutedEventArgs e) { if (dg_goods.SelectedItems.Count == 0) { MessageBox.Show("Позиция не выбрана", "Внимание!"); return; } Good item = (Good)dg_goods.SelectedValue; WCFStoreServiceManager.StoreServiceClient client = new StoreServiceClient(); client.DeleteGood(item); //WCFClient wcfc = new WCFClient(); //wcfc.DeleteGood(item); MessageBox.Show("Позиция удалена", "Внимание!"); }
private void btnSave_Click(object sender, RoutedEventArgs e) { StoreServiceClient storeServiceClient = new StoreServiceClient(); Store newStore = new Store { Name = txtStoreName.Text }; bool result = storeServiceClient.SaveStore(newStore); if (result) { MessageBox.Show("Mağaza Kaydedildi !", "Success", MessageBoxButton.OK); } else { MessageBox.Show("Hata Oluştu !", "Error", MessageBoxButton.OK); } }
/// <summary> /// /// </summary> /// <param name="loginForm"></param> /// <returns></returns> public bool Login(LoginTemplate loginForm) { Proxy = new StoreServiceClient(new InstanceContext(this)); if (Proxy.ClientCredentials == null) { return(false); } try { Proxy.ClientCredentials.UserName.UserName = loginForm.Email; Proxy.ClientCredentials.UserName.Password = loginForm.Password; var clerkInformation = Proxy.Profile(); if (clerkInformation != null) { Session = clerkInformation; } else { return(false); } RefreshBooks(); Transactions.Clear(); Transactions.AddRange(Proxy.ListOrders()); Transactions.AddRange(Proxy.ListPurchases()); if (Proxy.State != CommunicationState.Faulted) { Proxy.Subscribe(); } return(true); } catch { return(false); } }
/// <summary> /// /// </summary> private LibrettoClient() { Proxy = new StoreServiceClient(new InstanceContext(this)); }
public LoginWindow() { InitializeComponent(); storeProxy = ((App)Application.Current).StoreProxy; }
public EnterForm(StoreServiceClient client) { InitializeComponent(); _client = client; }
public SellForm(StoreServiceClient sp) { storeProxy = sp; warehouseProxy = new WarehouseServiceClient(); InitializeComponent(); }
public PrinterForm() { InitializeComponent(); proxy = new StoreServiceClient(new InstanceContext(this)); proxy.Open(); }
private void Window_Activated(object sender, EventArgs e) { List<Good> goods = new List<Good>(); WCFStoreServiceManager.StoreServiceClient client = new StoreServiceClient(); goods = client.Goods().ToList<Good>(); //WCFClient wcfc = new WCFClient(); //goods = wcfc.Goods().ToList<Good>(); dg_goods.ItemsSource = goods; }
public OrderGui() { InitializeComponent(); client = new StoreServiceClient(); }
public Sell() { InitializeComponent(); client = new StoreServiceClient(); }
public App() { StoreProxy = new StoreServiceClient(); }