protected void Page_Load(object sender, EventArgs e) { BudgetSession S = BudgetSession.Get(this); if (S.Authenticated()) { Response.Redirect("Default.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { ManageDataSession Data = ManageDataSession.Get(this); Data.State = ManageDataState.Main; BudgetSession S = BudgetSession.Get(this); if (S.Authenticated()) { S.LogOut(); } Response.Redirect("Login.aspx"); }
protected void Page_Load(object sender, EventArgs e) { BudgetSession S = BudgetSession.Get(this); if (S.Authenticated()) { navHome.Visible = true; navManageData.Visible = true; navExchange.Visible = true; navLogout.Visible = true; } else { navLogin.Visible = true; } }
protected void SignIn_Click(object sender, EventArgs e) { DAL DbDAL = new DAL(); BudgetSession S = BudgetSession.Get(this); if (!S.LogIn(DbDAL, inputUsername.Value, inputPassword.Value)) { labelError.InnerText = "Wrong username or password"; labelError.Visible = true; return; } if (S.Authenticated()) { Response.Redirect("Default.aspx"); return; } }
protected void Page_Load(object sender, EventArgs e) { BudgetSession S = BudgetSession.Get(this); if (!S.Authenticated()) { Response.Redirect("Login.aspx"); return; } ManageDataSession Data = ManageDataSession.Get(this); if (Data.SelectedCurrency == null) { DAL DbDAL = new DAL(); Data.SelectedCurrency = DbDAL.Select <Currency>().Where(C => C.Code == "HRK").First(); } HandleShowState(Data, Data.State); }
protected void Confirm_Click(object sender, EventArgs e) { ManageDataSession Data = ManageDataSession.Get(this); BudgetSession S = BudgetSession.Get(this); try { HandleStateConfirm(Data, S); } catch (DisplayException E) { labelError.Visible = true; labelError.InnerText = E.Message; return; } catch (Exception E) when(!Debugger.IsAttached) { labelError.Visible = true; labelError.InnerText = "Internal exception occured in HandleStateConfirm"; return; } Server.TransferRequest(Request.Url.AbsolutePath, false); }
protected void Page_Load(object sender, EventArgs e) { DbDAL = new DAL(); if (BudgetSession.GetUser(DbDAL, "admin") == null) { BudgetSession.CreateUser(DbDAL, "admin"); BudgetSession.ResetPassword(DbDAL, "admin", "root"); } BudgetSession S = BudgetSession.Get(this); if (!S.Authenticated()) { Response.Redirect("Login.aspx"); return; } CreateMonthLists(); Calculate(S.CurrentUser); }
protected void Page_Load(object sender, EventArgs e) { BudgetSession S = BudgetSession.Get(this); if (!S.Authenticated()) { Response.Redirect("Login.aspx"); return; } DAL DbDAL = new DAL(); Currency[] Currencies = DbDAL.Select <Currency>(new[] { new SQLiteParameter("@exchg", 1) }).ToArray(); if (S.ExchangeCurrency == null) { S.ExchangeCurrency = Currencies.Where(C => C.Code == "EUR").First(); } RefreshSelected(S); btnDropdown.Clear(); foreach (var Cur in Currencies) { btnDropdown.AddItem(new DropdownEntry(Cur.Code)); } btnDropdown.Bind(); GenerateExchangeTable(DbDAL, Currencies, S); btnDropdown.OnSelect += (Entry) => { S.ExchangeCurrency = Currencies.Where(C => C.Code == Entry.Name).First(); RefreshSelected(S); Server.TransferRequest(Request.Url.AbsolutePath, false); }; }