Example #1
0
        public ActionResult AddAdress(Photo image)
        {
            if (Session["Perdorues"] != null)
            {
                ShtetDbClient shtetClient = new ShtetDbClient();
                QytetDbClient qytetClient = new QytetDbClient();

                try
                {
                    ViewBag.Countries = shtetClient.GetCountries();
                    ViewBag.Cities    = qytetClient.GetCities();
                    ViewBag.Flag      = true;
                }
                catch (SqlException ex)
                {
                    ViewBag.Flag         = false;
                    ViewBag.ErrorMessage = "Something went wrong! " + ex.Message;
                }



                TempData["Image"] = image;


                return(View());
            }
            else
            {
                Session["Action"]     = "AddAdress";
                Session["Controller"] = "Publish";
                return(RedirectToAction("NotLogged", "Login"));
            }
        }
Example #2
0
        public ActionResult AddProneData()
        {
            if (Session["Perdorues"] != null)
            {
                ShtetDbClient shtetClient = new ShtetDbClient();
                QytetDbClient qytetClient = new QytetDbClient();

                try
                {
                    ViewBag.Countries = shtetClient.GetCountries();
                    ViewBag.Cities    = qytetClient.GetCities();
                    ViewBag.Flag      = true;
                }
                catch (SqlException ex)
                {
                    ViewBag.Flag         = false;
                    ViewBag.ErrorMessage = "Something went wrong! " + ex.Message;
                }

                KategoriProneDbClient kategoriDbClient = new KategoriProneDbClient();
                try
                {
                    ViewBag.Categories = kategoriDbClient.GetCategories();
                    ViewBag.Flag       = true;
                }
                catch (SqlException ex)
                {
                    ViewBag.Flag         = false;
                    ViewBag.ErrorMessage = "Something went wrong! " + ex.Message;
                }
            }
            else
            {
                Session["Action"]     = "AddProneData";
                Session["Controller"] = "Publish";
                return(RedirectToAction("NotLogged", "Login"));
            }

            return(View());
        }
        public ActionResult AddAddress()
        {
            if (Session["Perdorues"] != null)
            {
                QytetDbClient qdbClient = new QytetDbClient();
                ViewBag.Cities = qdbClient.GetCities();
                ShtetDbClient shdbClient = new ShtetDbClient();
                ViewBag.Countries = shdbClient.GetCountries();

                Konsumator kon = (Konsumator)Session["Perdorues"];
                int        id  = kon.IdKonsumator;
            }
            else
            {
                Session["Action"]     = "AddAddress";
                Session["Controller"] = "Profiles";
                return(RedirectToAction("LoginForm", "Login"));
            }


            return(View());
        }