Exemplo n.º 1
0
 protected void LogOut(object sender, EventArgs e)
 {
     iStore.Modules.Logic.Auth.Users ubl = new iStore.Modules.Logic.Auth.Users();
     if (ubl.CurrentUser != null)
     {
         ubl.LogOut(ubl.CurrentUser.UserID);
     }
     Response.Redirect(Request.Url.AbsoluteUri);
 }
Exemplo n.º 2
0
        public void Delete(Guid id)
        {
            iStore.Modules.Logic.Auth.Users ul = new iStore.Modules.Logic.Auth.Users();
            int errorMessageId = cbl.DeleteCategoryByIdWithErrorMessage(id);
            string errorMessage = string.Empty;

            divError.Visible = true;

            switch (errorMessageId)
            {
                //HasChilds = 1, HasProducts = 2, Invalid = 3, Success = 4
                case 1: { divError.InnerHtml = "Deletion failed. Please first delete subcategories."; break; };
                case 2: { divError.InnerHtml = "Deletion failed. Please first delete all products of this category"; break; };
                case 3: { divError.InnerHtml = "Deletion failed. Please chouse category"; break; };
                default: divError.InnerHtml = "Category successfully deleted.";  break;
            }
        }
Exemplo n.º 3
0
 private void Delete(string sid)
 {
     iStore.Modules.Logic.Auth.Users ubl = new iStore.Modules.Logic.Auth.Users();
     if (ubl.CurrentUserIdAdministrator)
     {
         int id = Convert.ToInt32(sid);
         BL.Modules.Pages.Pages pbl = new BL.Modules.Pages.Pages();
         BL.Page page = pbl.GetPageById(id);
         if (page != null)
         {
             pbl.DeletePageById(page.PageID);
             HttpContext.Current.Response.Redirect(iStore.Site.SiteAdminUrl + "Pages/");
         }
     }
     else
     {
         HttpContext.Current.Response.Redirect(iStore.Site.SiteUrl);
     }
 }
Exemplo n.º 4
0
 private void DeActivate()
 {
     string sid = Request.QueryString["deactivid"];
     if (sid != null)
     {
         iStore.Modules.Logic.Auth.Users ubl = new iStore.Modules.Logic.Auth.Users();
         if (ubl.CurrentUserIdAdministrator)
         {
             int id = Convert.ToInt32(sid);
             BL.Modules.News.News nbl = new BL.Modules.News.News();
             BL.News news = BL.Modules.News.News.GetNewsById(id);
             if (news != null)
             {
                 nbl.DeAcivateNewsById(news.NewsID);
                 Response.Redirect(iStore.Site.SiteAdminUrl + "News/");
             }
         }
         else
         {
             Response.Redirect(iStore.Site.SiteUrl);
         }
     }
 }