public AboutViewModel() { AboutItems.Clear(); InfoItems.AddRange(new[] { new MenuItem { Name = "About this app", Icon = "icon_venue.png", Parameter = "about" }, new MenuItem { Name = "Sponsors", Icon = "icon_venue.png", Parameter = "sponsors" }, new MenuItem { Name = "Event Map", Icon = "icon_venue.png", Parameter = "floor-maps" }, //new MenuItem { Name = "Lunch Locations", Icon = "ic_restaurant_menu.png", Parameter = "lunch-locations"}, new MenuItem { Name = "Venue", Icon = "icon_venue.png", Parameter = "venue" }, }); accountItem = new MenuItem { Name = "Logged in as:" }; syncItem = new MenuItem { Name = "Last Sync:" }; UpdateItems(); AccountItems.Add(accountItem); AccountItems.Add(syncItem); //This will be triggered wen Settings.PropertyChanged += async(sender, e) => { if (e.PropertyName == "Email") { Settings.NeedsSync = true; UpdateItems(); OnPropertyChanged("LoginText"); OnPropertyChanged("AccountItems"); //if logged in you should go ahead and sync data. if (Settings.IsLoggedIn) { await ExecuteSyncCommandAsync(); } } if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled") { OnPropertyChanged("AccountItems"); } }; }
public void LoadDetails() { lblResponsibilityCode.Text = clsRC.GetRCName(Request.QueryString["rccode"]); lblAccountCategory.Text = AccountCategory.GetCategoryName(Convert.ToInt16(Request.QueryString["accnt_cat_code"])); lblAccountItem.Text = AccountItems.GetItemName(Convert.ToInt16(Request.QueryString["accnt_items_code"])); lblAccountItemName.Text = AccountItems.GetItemName(Convert.ToInt16(Request.QueryString["accnt_items_code"])); }
/// <summary> /// this private method will generate a list of items that a patron has checked out or reserved /// </summary> /// <param name="accountID"></param> /// <returns></returns> private static List <AccountItems> GeneratePatronItemsList(int accountID) { using (LibraryEntities db = new LibraryEntities()) { try { List <ItemStatusLog> accountitemList = db.ItemStatusLogs.Where(x => x.AccountId == accountID && (x.ItemStatusTypeId == 2 || x.ItemStatusTypeId == 4)).ToList(); List <AccountItems> accountItems = new List <AccountItems>(); if (accountitemList != null || accountitemList.Count != 0) { foreach (var i in accountitemList) { AccountItems accountitem = new AccountItems { item = i.Item, accountID = i.AccountId, account = i.Account, itemTypeID = i.ItemStatusTypeId, itemStatusText = i.ItemStatusType.ItemStatusName }; accountItems.Add(accountitem); } } return(accountItems); } catch { return(null); } } }
protected void ddlAccountCategory_SelectedIndexChanged(object sender, EventArgs e) { divError.Visible = false; ddlAccountItem.DataSource = AccountItems.GetDSLAccountItem(ddlAccountCategory.SelectedValue.ToString()); ddlAccountItem.DataValueField = "pvalue"; ddlAccountItem.DataTextField = "ptext"; ddlAccountItem.DataBind(); }
public void LoadList() { lblItems.Text = ""; string strResult = ""; foreach (DataRow drAccountItems in AccountItems.GetDSG().Rows) { strResult += "<tr>"; strResult += "<td class='GridRows'><a href='AccountItemsMaintenanceModify.aspx?accnt_items_code=" + drAccountItems["accnt_items_code"].ToString() + "&rccode=" + Request.QueryString["rccode"] + "'>" + drAccountItems["oracle_code"] + "</a></td>"; strResult += "<td class='GridRows'>" + drAccountItems["accnt_items_name"] + "</td>"; strResult += "<td class='GridRows'>" + drAccountItems["accnt_cat_name"] + "</td>"; strResult += "<td class='GridRows'>" + drAccountItems["record_status_YN"] + "</td>"; strResult += "</tr>"; } lblItems.Text = strResult; }
public void LoadDdls() { ddlFiscalYear.DataSource = FiscalYear.GetDSLAFiscalYears(); ddlFiscalYear.DataValueField = "pvalue"; ddlFiscalYear.DataTextField = "ptext"; ddlFiscalYear.DataBind(); ddlAccountCategory.DataSource = AccountCategory.GetDSLAccountCategory(); ddlAccountCategory.DataValueField = "pvalue"; ddlAccountCategory.DataTextField = "ptext"; ddlAccountCategory.DataBind(); ddlAccountItem.DataSource = AccountItems.GetDSLAccountItem(ddlAccountCategory.SelectedValue.ToString()); ddlAccountItem.DataValueField = "pvalue"; ddlAccountItem.DataTextField = "ptext"; ddlAccountItem.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { using (AccountItems objAccountItems = new AccountItems()) { objAccountItems.AccountItemsCode = Convert.ToInt16(Request.QueryString["accnt_items_code"]); objAccountItems.AccountItemsName = txtAccountItemName.Text; objAccountItems.AccountCategoryCode = Convert.ToInt16(ddlCategory.SelectedValue); objAccountItems.ModifiedBy = Request.Cookies["Speedo"]["UserName"].ToString(); objAccountItems.OracleCode = txtOracleCode.Text; objAccountItems.RecordStatus = chkbEnable.Checked == true ? "1" : "0"; if (objAccountItems.Update() > 0) { Response.Redirect("AccountItemsMaintenance.aspx?rccode=" + Request.QueryString["rccode"] + ""); //string requestPage = this.hdnURL.Value.ToString(); //Response.Redirect(requestPage, true); } } }
protected void btnSave_Click(object sender, EventArgs e) { using (AccountItems objAccountItems = new AccountItems()) { objAccountItems.AccountItemsName = txtAccountItemName.Text; objAccountItems.AccountCategoryCode = Convert.ToInt16(ddlCategory.SelectedValue); objAccountItems.OracleCode = txtOracleCode.Text; objAccountItems.CreatedBy = Request.Cookies["Speedo"]["UserName"].ToString(); objAccountItems.CreatedOn = DateTime.Now; objAccountItems.ModifiedBy = Request.Cookies["Speedo"]["UserName"].ToString(); objAccountItems.ModifiedOn = DateTime.Now; objAccountItems.RecordStatus = "1"; if (objAccountItems.Insert() > 0) { this.LoadList(); } } }
private static List <AccountItems> GeneratePatronItemsList(int accountID) { using (LibraryEntities db = new LibraryEntities()) { try { IEnumerable <ItemStatusLog> latestActions = from x in db.ItemStatusLogs group x by x.AccountId into g select g.OrderByDescending(y => y.LogDateTime).FirstOrDefault(); List <ItemStatusLog> accountitemList = latestActions.Where(x => x.AccountId == accountID && (x.ItemStatusTypeId == 2 || x.ItemStatusTypeId == 4)).ToList(); List <AccountItems> accountItems = new List <AccountItems>(); if (accountitemList != null || accountitemList.Count != 0) { foreach (var i in accountitemList) { AccountItems accountitem = new AccountItems { item = i.Item, accountID = i.AccountId, account = i.Account, itemTypeID = i.ItemStatusTypeId, itemStatusText = i.ItemStatusType.ItemStatusName }; accountItems.Add(accountitem); } } return(accountItems); } catch { return(null); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.hdnURL.Value = this.Page.Request.UrlReferrer.AbsolutePath.ToString(); this.LoadDLLs(); lblAccountItemCode.Text = Request.QueryString["accnt_items_code"].ToString(); using (AccountItems objAccountItems = new AccountItems()) { objAccountItems.AccountItemsCode = Convert.ToInt16(Request.QueryString["accnt_items_code"]); objAccountItems.Fill(); txtAccountItemName.Text = objAccountItems.AccountItemsName; ddlCategory.SelectedValue = objAccountItems.AccountCategoryCode.ToString(); txtOracleCode.Text = objAccountItems.OracleCode; lblCreatedBy.Text = objAccountItems.CreatedBy; lblCreatedOn.Text = objAccountItems.CreatedOn.ToString(); lblModifiedBy.Text = objAccountItems.ModifiedBy; lblModifiedOn.Text = objAccountItems.ModifiedOn.ToString(); chkbEnable.Checked = objAccountItems.RecordStatus == "1" ? true : false; } } }
public AboutViewModel(INavigationService navigationService, IEventAggregator eventAggregator, IStoreManager storeManager, IToast toast, IFavoriteService favoriteService, ILoggerFacade logger, ILaunchTwitter twitter, ISSOClient ssoClient, IPushNotifications pushNotifications, IReminderService reminderService, IPageDialogService pageDialogService) : base(navigationService, eventAggregator, storeManager, toast, favoriteService, logger, twitter, ssoClient, pushNotifications, reminderService, pageDialogService) { ToolBarItems.Add(new ToolbarItem { Text = LoginText, Command = LoginCommand }); AboutItems.Clear(); AboutItems.Add(new Models.MenuItem { Name = "About this app", Icon = "icon_venue.png" }); InfoItems.AddRange(new[] { new Models.MenuItem { Name = "Conference Feed", Icon = "menu_feed.png", Pagename = nameof(FeedPage) }, new Models.MenuItem { Name = "Sponsors", Icon = "menu_sponsors.png", Pagename = nameof(SponsorsPage) }, new Models.MenuItem { Name = "Venue", Icon = "menu_venue.png", Pagename = nameof(VenuePage) }, new Models.MenuItem { Name = "Floor Maps", Icon = "menu_plan.png", Pagename = nameof(FloorMapsPage) }, new Models.MenuItem { Name = "Conference Info", Icon = "menu_info.png", Pagename = nameof(ConferenceInformationPage) }, new Models.MenuItem { Name = "Settings", Icon = "menu_settings.png", Pagename = nameof(SettingsPage) } }); accountItem = new Models.MenuItem { Name = "Logged in as:" }; syncItem = new Models.MenuItem { Name = "Last Sync:" }; pushItem = new Models.MenuItem { Name = "Enable push notifications" }; pushItem.Command = DelegateCommand.FromAsyncHandler(async () => { if (PushNotifications.IsRegistered) { UpdateItems(); return; } if (Settings.AttemptedPush) { var response = await PageDialogService.DisplayAlertAsync("Push Notification", "To enable push notifications, please go into Settings, Tap Notifications, and set Allow Notifications to on.", "Settings", "Maybe Later"); if (response) { PushNotifications.OpenSettings(); } } await PushNotifications.RegisterForNotifications(); }); UpdateItems(); AccountItems.Add(accountItem); AccountItems.Add(syncItem); AccountItems.Add(pushItem); //This will be triggered wen Settings.PropertyChanged += (sender, e) => { if (e.PropertyName == "Email" || e.PropertyName == "LastSync" || e.PropertyName == "PushNotificationsEnabled") { UpdateItems(); OnPropertyChanged("AccountItems"); } }; AccountItems.CollectionChanged += (sender, e) => { AccountListHeightAdjustment = AccountItems.Count; }; AccountListHeightAdjustment = AccountItems.Count; _isRegistered = PushNotifications.IsRegistered; }
public JsonResult GetMyTrades() { bool success = true; string errors = ""; var contextUser = System.Web.HttpContext.Current.User; bool loggedIn = (contextUser != null) && (contextUser.Identity.IsAuthenticated); if (!loggedIn) { success = false; } ApplicationUser user = System.Web.HttpContext.Current.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(contextUser.Identity.GetUserId()); //DateTime timeSlot = null; //int status = 0; ////string paymentPreference; ////string paymentEmail; //string address1 = ""; //string address2 = ""; //string city = ""; //string state = ""; //string zip = ""; //string brand = ""; //string series = ""; //string carrier = ""; //string color = ""; //int GB = 0; //string condition = ""; var trades = new List <AccountItems>(); using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) { //TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); //var time = timeZoneInfo.ConvertTime(gmTime, timeZone); con.Open(); // // The following code shows how you can use an SqlCommand based on the SqlConnection. // using (SqlCommand cmd = new SqlCommand(@"SELECT [PhoneID], [AddressID], [TimeSlotSelected], [SubmissionTime], [Status] ,[PaymentPreference] ,[PaymentEmail], [PriceOffered] from PhoneSubmissions where [UserID] = @userId", con)) { cmd.Parameters.Add(new SqlParameter("@userId", user.Id)); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { var trade = new AccountItems() { contactEmail = user.Email, phoneId = reader.GetInt32(0), addressId = reader.GetInt32(1), timeSlot = reader.GetDateTime(2).ToString(), submissionTime = reader.GetDateTime(3).ToString(), status = reader.GetInt32(4) == 0 ? "WAITING FOR PICKUP" : (reader.GetInt32(4) == 1 ? "PAYMENT COMPLETED" : "CANCELED"), priceOffered = reader.GetDecimal(7) }; trades.Add(trade); } } } foreach (AccountItems trade in trades) { using (SqlCommand cmd = new SqlCommand(@"SELECT Top 1 [Brand] ,[Series], [Carrier], [Color], [GB], [Condition] from Phones where [PhoneID] = @phoneId", con)) { cmd.Parameters.Add(new SqlParameter("@phoneId", trade.phoneId)); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { trade.brand = reader.GetString(0); trade.series = reader.GetString(1); trade.carrier = reader.GetString(2); trade.color = reader.GetString(3); trade.GB = reader.GetInt32(4); trade.condition = reader.GetString(5); } } } using (SqlCommand cmd = new SqlCommand(@"SELECT Top 1 Address1, Address2, City, State, Zip, PhoneNumber from Addresses where AddressID = @addressId", con)) { cmd.Parameters.Add(new SqlParameter("@addressId", trade.addressId)); using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { trade.address1 = reader.GetString(0); trade.address2 = reader.IsDBNull(1) ? null : reader.GetString(1); trade.city = reader.GetString(2); trade.state = reader.GetString(3); trade.zip = reader.GetString(4); trade.phoneNumber = reader.GetString(5); } } } } } return(Json(new { success, trades })); }