Ejemplo n.º 1
0
        public ActionResult PriceCityEdit(FormCollection collection, PriceCity pc)
        {
            if (Request.Cookies["Username"] != null)
            {
                pc.Name       = collection["Name"].Replace(".", "");
                pc.Ord        = Int32.Parse(collection["Ord"]);
                pc.Price_ship = float.Parse(collection["Price_ship"]);
                string parentLevel = collection["PriceCity"];
                pc.Level = parentLevel + "00000";

                db.sp_PriceCity_Update(pc.Id, pc.Name, pc.Level, pc.Ord, pc.Price_ship);
                db.SaveChanges();

                return(RedirectToAction("PriceCityIndex"));
            }
            else
            {
                return(Redirect("/Admins/admins"));
            }
        }