Ejemplo n.º 1
0
        public ActionResult AddGalleryPanel(FormCollection collection, IEnumerable <HttpPostedFileBase> files)
        {
            if (files != null && collection != null)
            {
                this.rc = new RetrieveContent();
                switch (collection["submit"])
                {
                case "save":
                    var menuTag    = collection["menuTag"];
                    var styleSheet = Convert.ToInt32(collection["panelDesign"], CultureInfo.CurrentCulture);

                    var header       = collection["hdr"];
                    var underMenuTag = collection["underMenuTag"];

                    this.pm = new PanelManagement();
                    this.pm.AddPanel(styleSheet, menuTag, underMenuTag);
                    this.rc.ClearPanelCache();
                    this.rc.GetContent();
                    var id = this.rc.Pan.Last().Panel_Id;
                    this.pm.AddGalleryPanel(id, header);

                    foreach (var item in files)
                    {
                        if (HttpPostedFileBaseExtensions.IsImage(item))
                        {
                            this.pm.AddGalleryImage(id, item);
                        }
                    }

                    this.rc.ClearPanelCache();
                    return(this.RedirectToAction("AdminHome", "Admin"));

                case "cancel":
                    return(this.RedirectToAction("AdminHome", "Admin"));

                default:
                    throw new ArgumentNullException("collection");
                }
            }

            return(this.RedirectToAction("AdminLogOn", "Admin"));
        }
Ejemplo n.º 2
0
        public ActionResult AddComboPanel(FormCollection collection)
        {
            if (System.Web.HttpContext.Current.Session["admin"] != null && System.Web.HttpContext.Current.Session["admin"].ToString() == "iamadmin" && collection != null)
            {
                this.rc = new RetrieveContent();
                switch (collection["submit"])
                {
                case "save":
                    var menuTag    = collection["menuTag"];
                    var styleSheet = Convert.ToInt32(collection["panelDesign"], CultureInfo.CurrentCulture);

                    var header       = collection["hdr"];
                    var pictureAlign = collection["align"];
                    var context      = collection["cntxt"];
                    var imagefile    = this.Request.Files["imagefile"];
                    var underMenuTag = collection["underMenuTag"];

                    this.pm = new PanelManagement();
                    this.pm.AddPanel(styleSheet, menuTag, underMenuTag);

                    this.rc.ClearPanelCache();
                    this.rc.GetContent();

                    var thispanel = this.rc.Pan.Last();
                    this.pm.AddComboPanel(thispanel.Panel_Id, header, context, pictureAlign, imagefile);

                    this.rc.ClearPanelCache();
                    return(this.RedirectToAction("AdminHome", "Admin"));

                case "cancel":
                    return(this.RedirectToAction("AdminHome", "Admin"));

                default:
                    throw new ArgumentNullException("collection");
                }
            }
            else
            {
                return(this.RedirectToAction("AdminLogOn", "Admin"));
            }
        }
Ejemplo n.º 3
0
 public AddController()
 {
     this.rc = new RetrieveContent();
     this.rc.GetIndexing();
 }
Ejemplo n.º 4
0
 public EditController()
 {
     this.rc = new RetrieveContent();
     this.rc.GetIndexing();
     this.rc.RetrievePanelStyles();
 }