private async void LoadCustomers() { try { CustomerDataGroup firstGroup = _customerDataGroups.FirstOrDefault(); if (firstGroup == null) { firstGroup = new CustomerDataGroup("Customer Default", "Customers", "Customer SubTitle", "image", "Customer Description"); _customerDataGroups.Add(firstGroup); } // TODO: Create an appropriate data model for your problem domain to replace the sample data ObservableCollection <CustomerDataGroup> customerDataGroups = await CustomerDataSource.GetGroupsAsync(); if (!customerDataGroups.Any()) { return; } foreach (CustomerDataItem item in customerDataGroups.First().Items) { firstGroup.Items.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } }
public List <WCSA_Entity_Classes.Customer> fetchCustomerList() { List <WCSA_Entity_Classes.Customer> customerList = new List <WCSA_Entity_Classes.Customer>(); CustomerDataSource sds = new CustomerDataSource(); sds.returnEntireList(customerList); return(customerList); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper" /> /// </param> /// <param name="e"> /// Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)" /> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited. /// </param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data CustomerDataGroup group = await CustomerDataSource.GetGroupAsync((String)e.NavigationParameter); DefaultViewModel["Group"] = group; DefaultViewModel["Items"] = group.Items; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper" /> /// </param> /// <param name="e"> /// Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)" /> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited. /// </param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { _customerDataGroups = await CustomerDataSource.GetGroupsAsync(); DefaultViewModel["Groups"] = _customerDataGroups; //var result = await SaleSaveInfo.GetSaleList(); //pendingInvoiceCount.Text = "Pending Invoices: " + result.Count; }
public CustomerListViewModel() { _CapabilityService = DependencyService.Get<ICapabilityService>(); DataSource = new CustomerDataSource(); SubscribeToSaveCustomerMessages(); SubscribeToDeleteCustomerMessages(); }
public void BtnAdd_TouchUpInside(object sender,EventArgs e) { string txtValue = this.txt.Text; if (!string.IsNullOrEmpty (txtValue)) { dataViewSource = (CustomerDataSource)this.dataTable.Source; dataViewSource.datas.Insert (0, txtValue); //this.dataTable.InsertRows (new NSIndexPath[]{ NSIndexPath.FromRowSection (0, 0) }, UITableViewRowAnimation.Bottom); this.dataTable.ReloadData(); } }
public void BtnDelete_TouchUpInside(object sender,EventArgs e) { dataViewSource = (CustomerDataSource)this.dataTable.Source; foreach (int i in dataViewSource.selectRows) { dataViewSource.datas.RemoveAt (i); } dataViewSource.selectRows = new List<int> (); dataTable.ReloadData(); }
public ActionResult Index(string state, string code) { string error = string.Empty; var sessionState = HttpContext.Session["state"]; if (sessionState.Equals(state)) { OidcModel oauthModel = SuperOfficeAuthHelper.GetOAuthModel(code); if (SuperOfficeAuthHelper.TryLogin(oauthModel, out error)) { var context = SuperOfficeAuthHelper.Context; //Store the System User Information in the Database CustomerDataSource dataSource = new CustomerDataSource(); var customer = dataSource.Customers.FirstOrDefault(c => c.ContextIdentifier == context.ContextIdentifier); //var databaseContext = new PartnerDatabaseContext(); //var customer = databaseContext.Customers.FirstOrDefault(c => c.ContextIdentifier == context.ContextIdentifier); if (customer == null) { dataSource.Customers.Add(new CustomerInfo { AssociateID = context.AssociateId, ContextIdentifier = context.ContextIdentifier, IsActive = true, LastSync = new DateTime(2000, 1, 1), SystemUserToken = context.SystemToken }); dataSource.Save(); } // Redirect to original request var redirectUr = Session["RedirectUrl"] as string; if (!String.IsNullOrEmpty(redirectUr)) { return(Redirect(redirectUr)); } else { return(RedirectToAction("Index", "Home")); } } } return(RedirectToAction("Welcome", "Home", new { Error = error })); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper" /> /// </param> /// <param name="e"> /// Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)" /> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited. /// </param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { try { // TODO: Create an appropriate data model for your problem domain to replace the Customer data CustomerDataItem customer = await CustomerDataSource.GetItemAsync((String)e.NavigationParameter); IEnumerable <SaleableItemDataGroup> saleableItemDataGroups = await SaleableItemDataSource.GetGroupsAsync(); DefaultViewModel["ItemsToSell"] = saleableItemDataGroups; var currentSale = new Sale(); currentSale.Customer = customer; DefaultViewModel["Sale"] = currentSale; } catch (Exception ex) { Debug.WriteLine(ex); } }
public void modifyCustomerDetails(string name, string mail, string address, string phone, string nid, string licence) { CustomerDataSource sds = new CustomerDataSource(); sds.ModifyList(new WCSA_Entity_Classes.Customer(name, mail, address, phone, nid, licence)); }
public WCSA_Entity_Classes.Customer checkcustomerDetails(string nid) { CustomerDataSource sds = new CustomerDataSource(); return(sds.ReturnAnItem(nid)); }
public void Add(string name, string mail, string phone, string address, string nid, string licence) { CustomerDataSource sds = new CustomerDataSource(); sds.AddToList(new WCSA_Entity_Classes.Customer(name, mail, phone, address, nid, licence)); }
public ActionResult Index(CallbackModel callbackModel) { if (callbackModel == null) { return(RedirectToAction("Index", "Home")); } /* * Here it is up to the partner intercept the callback from SuperID * and route the user to the correct partner application instance. * * This is also the opportunity for the Partner to create a system user * in the customers superoffice database for future use and storage. * * This is where any additional setup or configuration options are input into * the partners application for future use. */ string error = string.Empty; if (SuperOfficeAuthHelper.TryLogin(callbackModel, out error)) { var context = SuperOfficeAuthHelper.Context; //Store the System User Information in the Database CustomerDataSource dataSource = new CustomerDataSource(); var customer = dataSource.Customers.FirstOrDefault(c => c.ContextIdentifier == context.ContextIdentifier); //var databaseContext = new PartnerDatabaseContext(); //var customer = databaseContext.Customers.FirstOrDefault(c => c.ContextIdentifier == context.ContextIdentifier); if (customer == null) { dataSource.Customers.Add(new CustomerInfo { AssociateID = context.AssociateId, ContextIdentifier = context.ContextIdentifier, IsActive = true, LastSync = new DateTime(2000, 1, 1), SystemUserToken = context.SystemToken }); dataSource.Save(); } // Redirect to original request var redirectUr = Session["RedirectUrl"] as string; if (!String.IsNullOrEmpty(redirectUr)) { return(Redirect(redirectUr)); } else { return(RedirectToAction("Index", "Home")); } } else { return(RedirectToAction("Welcome", "Home", new { Error = error })); } }