public ActionResult AddressUpdate(int adressid = 0)
        {
            // id kontroll
            if (adressid > 0)
            {
                if (Session["Login"] != null)
                {
                    AppUsers gelenuser = (AppUsers)Session["Login"];
                    int      gelenid   = gelenuser.UserID;

                    if (AdressManagement.AdressControlUpdate(adressid, gelenid) != null)
                    {
                        ViewBag.adressveri = AdressManagement.AdressControlUpdate(adressid, gelenid);


                        int        gelenil = (int)AdressManagement.AdressControlUpdate(adressid, gelenid).County.City.CityID;
                        var        adres   = CountandCityManagement.getallCity();
                        SelectList list    = new SelectList(adres, "CityID", "CityName", gelenil);
                        ViewBag.city = list;



                        int        gelenilce = (int)AdressManagement.AdressControlUpdate(adressid, gelenid).County.CountyID;
                        var        ilce      = CountandCityManagement.getCompanyCounty(gelenil);
                        SelectList list2     = new SelectList(ilce, "CountyID", "CountyName", gelenilce);

                        ViewBag.County = list2;

                        return(View());
                    }
                    else
                    {
                        Session.Add("AdressController", "Adress Hatalı Farklı Bir Kişinin Adresine Erişemezsiniz");
                        return(View());
                    }
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public ActionResult AddAdress()
        {
            if (Session["Login"] != null)
            {
                AppUsers gelenuser = (AppUsers)Session["Login"];
                int      id        = gelenuser.UserID;
                if (payinfoManagement.PayInfoUserCartControl(id))
                {
                    var adres = CountyandCityManagement.getallCity();
                    ViewBag.city = adres;

                    SelectList list = new SelectList(adres, "CityID", "CityName");
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
            else
            {
                return(RedirectToAction("LoginUser", "Home"));
            }
            return(View());
        }
Beispiel #3
0
 // GET: AdminStorage
 public ActionResult Storage()
 {
     if (Session["Login"] != null && Session["Company"] != null)
     {
         gelen        = (AppUsers)Session["Login"];
         companybilgi = (Company)Session["Company"];
     }
     else
     {
         return(RedirectToAction("Index", "Home", new { area = "" }));
     }
     if (gelen.Status.Value == 2)
     {
         var allStorage = storageManagement.getAllCompanyStorage(companybilgi.CompanyID);
         ViewBag.storage = allStorage;
         var cities = countyAndCityManagement.getallCity();
         return(View(cities));
     }
     else
     {
         return(RedirectToAction("Index", "Admin"));
     }
 }