public ActionResult Index()
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");
            ViewBag.TodaysDate = DateTime.Today.ToString("yyyy-MM-dd");
            if (MyCookie == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            HttpCookie    aCookie  = Request.Cookies["HIWSSettings"];
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition
            return(View());
        }
Beispiel #2
0
        public ActionResult MetaDataInput()
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");

            if (MyCookie == false)
            {
                return(View("index"));
            }

            HttpCookie    aCookie  = Request.Cookies["HIWSSettings"];
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition

            List <SelectListItem> obj = new List <SelectListItem>();

            string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("SPU_HT_CMS_SelectMetadataTypes"))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        obj.Add(new SelectListItem {
                            Text = myReader["MetadataCatagoryName"].ToString(), Value = myReader["MetadataCatagoryId"].ToString()
                        });
                    }

                    connection.Close();
                }
            }

            obj.Insert(0, new SelectListItem {
                Text = "Please Select type..", Value = "0"
            });
            ViewBag.MetadataType     = obj;
            ViewBag.languageSelector = new SelectListItem {
                Text = "Please Select Language..", Value = "0"
            };

            return(View());
        }
Beispiel #3
0
        public ActionResult Index()
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");
            ViewBag.TodaysDate = DateTime.Today.ToString("yyyy-MM-dd");
            if (MyCookie == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            HttpCookie    aCookie  = Request.Cookies["HIWSSettings"];
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition

            var cookieValue = "0-0";
            var myCookie    = Request.Cookies["HIWSSettings"];
            if (myCookie != null)
            {
                cookieValue = myCookie.Value;
            }
            var    obj = "";
            string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("SPU_HT_RetrivePermisionLevel"))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@Guid", cookieValue.Split('=')[1]);


                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        obj = myReader["permisionLevel"].ToString();
                    }

                    connection.Close();
                }
            }

            ViewBag.Permision = obj;

            return(View());
        }
Beispiel #4
0
        public ActionResult Main()
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");

            if (MyCookie == false)
            {
                return(View("index"));
            }

            HttpCookie    aCookie  = Request.Cookies["HIWSSettings"];
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition

            string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("[dbo].[SPU_HT_Dashboard_Overview]"))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@Variable", aCookie["SessionGui"]);

                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        ViewBag.FirstName      = myReader["firstname"].ToString();
                        ViewBag.Surname        = myReader["surname"].ToString();
                        ViewBag.PermisionLevel = Int32.Parse(myReader["permisionlevel"].ToString());
                    }

                    connection.Close();
                }
            }

            ViewBag.Title  = "Main";
            ViewBag.Header = "Welcome to hope.tools";
            return(View());
        }
        public ActionResult ResendComformation(bool?error, bool?sucess)
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");

            if (MyCookie == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            HttpCookie    aCookie  = Request.Cookies["HIWSSettings"];
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition
            if (error != null)
            {
                ViewBag.HtmlStr = "<Div id=\"failureDiv\">The supplied OrderId was not valid.</div>";
            }
            if (sucess != null)
            {
                ViewBag.HtmlStr = "<Div id=\"successDiv\">Confirmation Email Sent.</div>";
            }

            return(View());
        }
Beispiel #6
0
        //Minuets
        public ActionResult Minutes()
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");
            ViewBag.TodaysDate = DateTime.Today.ToString("yyyy-MM-dd");
            if (MyCookie == false)
            {
                return(RedirectToAction("Index", "Home"));
            }

            HttpCookie aCookie = Request.Cookies["HIWSSettings"];
            ViewBag.Gui = aCookie.Value;
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition

            List <SelectListItem> obj  = new List <SelectListItem>();
            List <SelectListItem> obj2 = new List <SelectListItem>();
            List <SelectListItem> obj3 = new List <SelectListItem>();
            obj.Add(new SelectListItem {
                Text = "Please Select One...", Value = "0"
            });

            string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            #region Generate Active Channels dropdown
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("SPU_HT_Get_Active_Channel"))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        obj.Add(new SelectListItem {
                            Text = myReader["channelname"].ToString(), Value = myReader["channelid"].ToString()
                        });
                    }

                    connection.Close();
                }
            }
            #endregion

            #region Generate Active Producers dropdown
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("SPU_HT_Get_Active_Producers"))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        obj2.Add(new SelectListItem {
                            Text = myReader["firstname"].ToString() + " " + myReader["lastname"].ToString(), Value = myReader["firstname"].ToString() + " " + myReader["lastname"].ToString()
                        });
                    }

                    connection.Close();
                }
            }
            #endregion

            #region Generate Active Presenter dropdown
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("SPU_HT_Get_Active_Presenter"))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        obj3.Add(new SelectListItem {
                            Text = myReader["firstname"].ToString() + " " + myReader["lastname"].ToString(), Value = myReader["firstname"].ToString() + " " + myReader["lastname"].ToString()
                        });
                    }

                    connection.Close();
                }
            }
            #endregion

            ViewBag.ActiveChannels   = obj;
            ViewBag.ActiveProducers  = obj2.OrderBy(o => o.Text).ToList();;
            ViewBag.ActivePresenters = obj3.OrderBy(o => o.Text).ToList();;

            return(View());
        } //Done
Beispiel #7
0
        public ActionResult FavoredBrandSelector(bool?compleate, FormCollection formCollection, int languageIdFromNonForm = 0)
        {
            //Repetitition need to find a way to extract
            #region Repeated Page validation and navigation controll
            bool MyCookie = IsCookiePresentAndSessionValid("HIWSSettings");

            if (MyCookie == false)
            {
                return(View("index"));
            }

            HttpCookie    aCookie  = Request.Cookies["HIWSSettings"];
            List <string> somelist = new LogOnController().GenerateMenuForSession(aCookie["SessionGui"]);
            if (somelist != null)
            {
                StringBuilder astring = new StringBuilder();
                foreach (string buttonString in somelist)
                {
                    astring.Append(buttonString);
                }

                ViewBag.MenuHtml = astring.ToString();
            }
            #endregion
            //End Repetition

            var languageId = "";
            if (languageIdFromNonForm == 0)
            {
                languageId = formCollection["ActiveLanguage"].ToString();
            }
            else
            {
                languageId = languageIdFromNonForm.ToString();
            }

            List <SelectListItem> obj = new List <SelectListItem>();

            string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("SPU_HT_CMS_Retrieve_Brands"))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@LanguageId", languageId);
                    command.Connection = connection;
                    connection.Open();
                    SqlDataReader myReader = command.ExecuteReader();
                    while (myReader.Read())
                    {
                        obj.Add(new SelectListItem {
                            Text = myReader["name"].ToString(), Value = myReader["id"].ToString() + '-' + myReader["bareference"].ToString()
                        });
                    }

                    connection.Close();
                }
            }

            ViewBag.FavoredBrand1 = obj;
            ViewBag.FavoredBrand2 = generateDropDownOrder(obj, 1);
            ViewBag.FavoredBrand3 = generateDropDownOrder(obj, 2);
            ViewBag.FavoredBrand4 = generateDropDownOrder(obj, 3);
            ViewBag.FavoredBrand5 = generateDropDownOrder(obj, 4);
            ViewBag.FavoredBrand6 = generateDropDownOrder(obj, 5);
            ViewBag.FavoredBrand7 = generateDropDownOrder(obj, 6);
            ViewBag.FavoredBrand8 = generateDropDownOrder(obj, 7);
            ViewBag.FavoredBrand9 = generateDropDownOrder(obj, 8);
            ViewBag.FavoredBrand0 = generateDropDownOrder(obj, 9);
            List <SelectListItem> hiddenObject = new List <SelectListItem>();
            hiddenObject.Add(new SelectListItem {
                Text = languageId, Value = languageId
            });
            ViewBag.ActiveLanguage = hiddenObject;

            if (compleate == true)
            {
                ViewBag.HtmlStr = "<Div id=\"CompleateDiv\">The Featured Brands have been updated.</div>";
            }
            if (compleate == false)
            {
                ViewBag.HtmlStr = "<Div id=\"CompleateDiv\">The Featured Brands have NOT been updated, please select brands that are unique.</div>";
            }

            return(View());
        }