protected void Page_Load(object sender, EventArgs e) { _CurrentUser = SwitchUserManager.GetCurrentUser(); if (Page.IsPostBack == false) { _SelectDate = DateTime.Now.Date; if (_CurrentUser.Roles.Contains(RoleKey.Manager) == true) { _SelectedShop = (ShopItemManager.GetAll().Count == 0) ? "" : ShopItemManager.GetAll()[0].Id; } else if (_CurrentUser.Roles.Contains(RoleKey.BranchManager) == true) { ShopItem ShopItem = ShopItemManager.GetAll().FirstOrDefault(s => s.Name == _CurrentUser.Profiles[ProfileKey.分店]); _SelectedShop = (ShopItem == null) ? "" : ShopItem.Id; } } else { //判斷選項是否存在 _SelectedShop = (ShopItemManager.GetById(_SelectedShop) == null) ? "" : _SelectedShop; } Load_MonthOrderItems(); }
protected void Page_Load(object sender, EventArgs e) { _CurrentUser = SwitchUserManager.GetCurrentUser(); _AllConfigs = ConfigManager.GetAll(); Update_Counter(); }
protected void Page_Load(object sender, EventArgs e) { _CurrentUser = SwitchUserManager.GetCurrentUser(); if (_CurrentUser.Roles.Contains(RoleKey.Login) == false) { Response.Redirect("/Default.aspx"); } if (_CurrentUser.Roles.Intersect(new RoleKey[] { RoleKey.Manager, RoleKey.BranchManager }).Count() == 0) { Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { _Argument = LeftHand.Gadget.Encoder.DictionaryDecoder(Server.UrlDecode(Request.QueryString.ToString())); } _CurrentUser = SwitchUserManager.GetCurrentUser(); switch (_Argument["Mode"]) { case "Add": //暫時沒有新增的需要 break; case "Edit": _OrderItem = OrderItemManager.GetById(decimal.Parse(_Argument["Id"].ToString())); break; } }
protected void Page_Load(object sender, EventArgs e) { _CurrentUser = SwitchUserManager.GetCurrentUser(); _AllAreas = AreaItemManager.GetAll(); _AllShops = ShopItemManager.GetAll(); if (Page.IsPostBack == false) { string AES_OrderItemId = Server.UrlDecode(Request.QueryString.ToString()); if (string.IsNullOrWhiteSpace(AES_OrderItemId)) { _IsUpdateMode = false; _CurrentOrderItem = new OrderItem(null, null, null, DateTime.Now.Date, ""); } else { _IsUpdateMode = true; _CurrentOrderItem = OrderItemManager.GetById(decimal.Parse(LeftHand.Gadget.Encoder.AES_Decryption(AES_OrderItemId))); } } }
protected void Page_Load(object sender, EventArgs e) { EditUser = SwitchUserManager.GetCurrentUser(); }