示例#1
0
        public ActionResult Edit(Guid locationId)
        {
            bn_Location bnLocation = new bn_Location();
            var         model      = bnLocation.GetById(locationId);

            return(View(model));
        }
示例#2
0
        public ActionResult Delete(Guid locationId)
        {
            bn_Location bnLocation = new bn_Location();
            var         re         = bnLocation.Delete(locationId);

            if (re < 0)
            {
                ViewBag.MessError = "";
            }
            return(RedirectToAction("Index", "User"));
        }
示例#3
0
        public ActionResult Index(Guid?userId)
        {
            if (!userId.HasValue)
            {
                userId = ps_Membership.GetUser().UserId;
            }

            bn_Location bnLocation = new bn_Location();
            var         model      = bnLocation.GetByUserId((Guid)userId);

            ViewBag.UserId = userId;

            return(View(model));
        }
示例#4
0
        public ActionResult p_UserLocation(Guid userId)
        {
            bn_Location bnLocation = new bn_Location();
            var         model      = bnLocation.GetByUserId((Guid)userId);

            if (model.Count > 0)
            {
                return(View(model));
            }
            else
            {
                return(null);
            }
        }
示例#5
0
        public ActionResult Edit(pb_Location model)
        {
            if (ModelState.IsValid && model.Address != null)
            {
                bn_Location bnLocation = new bn_Location();
                var         re         = bnLocation.Update(
                    model.LocationId,
                    model.Latitude,
                    model.Longitude,
                    model.Address);

                if (re >= 0)
                {
                    return(RedirectToAction("Index", "User"));
                }

                //return fail.
            }
            return(View(model));
        }
示例#6
0
        public ActionResult New(pb_Location model)
        {
            if (ModelState.IsValid && model.Address != null)
            {
                bn_Location bnLocation = new bn_Location();
                var         re         = bnLocation.Create(
                    model.UserId,
                    model.Latitude,
                    model.Longitude,
                    model.Address);

                if (re != Guid.Empty)
                {
                    return(RedirectToAction("Index", "User"));
                }

                //return fail.
            }
            return(View(model));
        }