예제 #1
0
        public ActionResult PayOrder(string id)
        {
            int oid = Convert.ToInt32(id);

            Orders orders = OrdersService.LoadEntities(o => o.oid == oid).FirstOrDefault();

            orders.state = "1";
            OrdersService.EditEntity(orders);

            My.RentingSystem.Model.User user = Session["user"] as My.RentingSystem.Model.User;
            @ViewBag.uid = user.uid;
            return(View("MyOrder", new { id = user.uid }));
        }
예제 #2
0
        public ActionResult CancelOrder(string oid, string hid)
        {
            int oidInt = Convert.ToInt32(oid);
            int hidInt = Convert.ToInt32(hid);

            Orders order = OrdersService.LoadEntities(o => o.oid == oidInt).FirstOrDefault();
            House  house = HouseService.LoadEntities(h => h.hid == hidInt).FirstOrDefault();

            house.state = "0";
            OrdersUserHouse ordersUserHouse = OrdersUserHouseService.LoadEntities(o => o.oid == oidInt).FirstOrDefault();

            OrdersService.DeleteEntity(order);
            HouseService.EditEntity(house);
            OrdersUserHouseService.DeleteEntity(ordersUserHouse);

            My.RentingSystem.Model.User user = Session["user"] as My.RentingSystem.Model.User;
            @ViewBag.uid = user.uid;
            return(View("MyOrder", new { id = user.uid }));
        }