예제 #1
0
        // GET: Admin/Seller/Edit/{id}
        public async Task <ActionResult> Edit(string id)
        {
            var             userManager = HttpContext.GetOwinContext().GetUserManager <ApplicationUserManager>();
            var             seller      = _sellerService.GetById(id);
            ApplicationUser sellerUser  = await userManager.FindByEmailAsync(seller.email);

            seller.has_account = (sellerUser != null);
            return(View(seller));
        }
예제 #2
0
        // GET: Seller/Home
        public ActionResult Index()
        {
            if (User.Identity.IsAuthenticated)
            {
                //if (User.IsInRole("Administrator")) { return Redirect("/Admin/Products"); }
                return(View("Details", _sellerService.GetById((User.Identity as ClaimsIdentity).FindFirst("urn:iisnap:seller_id").Value)));
            }

            return(View());
        }
예제 #3
0
        public IActionResult GetById(int id)
        {
            var result = _sellerService.GetById(id);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
예제 #4
0
        public ActionResult <BaseResult <SellerViewModel> > Get(int id)
        {
            var result = _sellerService.GetById(id);

            if (result.Success)
            {
                var resultMap = _mapper.Map <SellerViewModel>(result.Data);

                return(BaseResult <SellerViewModel> .OK(resultMap));
            }

            return(BaseResult <SellerViewModel> .NotOK(result.Messages));
        }
        public IActionResult GetById(int id)
        {
            var seller = _sellerService.GetById(id);

            return(Ok(new
            {
                seller.Id,
                seller.firstName,
                seller.lastName,
                seller.userName,
                seller.sex,
                seller.age
            }));
        }
        public ActionResult Usuario()
        {
            dynamic usuario = new ExpandoObject();

            usuario.User = Global.User;

            if (Global.User.TypeM == "0")
            {
                usuario.Customer = customerService.GetById((int)Global.User.Id).ResultObject;
            }
            else if (Global.User.TypeM == "1")
            {
                usuario.Seller = sellerService.GetById((int)Global.User.Id).ResultObject;
            }
            return(View(usuario));
        }
        public IActionResult Ayarlar()
        {
            var usersAndProfile          = _usersAndSellersService.GetByUserId(_userManager.GetUserId(User));
            var sellerId                 = usersAndProfile.SellerId;
            var seller                   = _sellerService.GetById(sellerId);
            var profileSettingsViewModel = new ProfileSettingsViewModel
            {
                SellerId    = seller.SellerId,
                SellerName  = seller.NameAndSurname,
                City        = seller.City,
                Adress      = seller.Adress,
                Email       = seller.EmailAdress,
                PhoneNumber = seller.PhoneNumber
            };

            return(View(profileSettingsViewModel));
        }
예제 #8
0
        public IActionResult Detay(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var productDetailsViewModel = new ProductDetailsViewModel
            {
                Product = _productService.GetById((int)id),
                Seller  = _sellerService.GetById(_productService.GetById((int)id).SellerId)
            };

            if (productDetailsViewModel.Product == null)
            {
                return(NotFound());
            }
            return(View(productDetailsViewModel));
        }
예제 #9
0
 public IHttpActionResult Get(string id)
 {
     return(Ok(_sellerService.GetById(id)));
 }
예제 #10
0
        public ActionResult Edit(int id)
        {
            var data = AutoMapperHelper.MapToSameViewModel <Seller, SellerViewModel>(_sellerService.GetById(id));

            return(View(data.ToVM()));
        }