// GET: Account
        public ActionResult OwnCabinet(string trader_id)
        {
            // define the user
            _accUsr = _repositForAcc
                      .getItemFromDB_byParams(ChoiseTraderColumn.ID, trader_id).First();
            //
            _lordId = Int32.Parse(trader_id);
            // get all items
            itemsList = _repositForAcc.getAllItemsFromDB(trader_id, null);

            PhysicalPathOfCatalog = CreateSubString(Request.PhysicalPath,
                                                    (string)RouteData.Values["controller"],
                                                    (string)RouteData.Values["action"],
                                                    (string)RouteData.Values["trader_id"]);

            return(View(itemsList));
        }
Beispiel #2
0
        public PartialViewResult LogInOut(bool forgotFields = false)
        {
            ViewData["forgotenfields"] = false;
            if (forgotFields == true)
            {
                ViewData["forgotenfields"] = true;
            }
            string a = (string)Request.Form["em"];
            string b = (string)Request.Form["ps"];

            if (a == null || b == null)
            {
                return(PartialView());
            }

            _logUsr = _repositForLog
                      .getItemFromDB_byParams(ChoiseTraderColumn.EMailAndPassword, a, b).First();

            return(PartialView(_logUsr));
        }
Beispiel #3
0
        // do view for All users
        public ActionResult BaseAuction(string category = null)
        {
            // to prepare variable to start searching by trader's name
            List <Trader> namesByQuery;

            string [] idsByQuery;
            int       count = 0;
            string    name;

            try
            {
                name = Request.Form["filter_items_by_trader's_name"].ToString();
            }
            catch (Exception e) { name = null; }
            // if searching by trader's name was started
            // get all the traders by name
            if (!String.IsNullOrEmpty(name))
            {
                // where is the [new] operator for this ?
                namesByQuery = _repositForCurrTrader
                               .getItemFromDB_byParams(ChoiseTraderColumn.Name, name);
                count      = namesByQuery.Count();
                idsByQuery = new string[count];
                for (var i = 0; i < count; i++)
                {
                    idsByQuery[i] = namesByQuery.First().trader_ID.ToString();
                    baseList.AddRange(_repositForCurrTrader
                                      .getAllItemsFromDB(idsByQuery[i], category));
                }
                // output a small list
                return(View(baseList));
            }

            // output a big list
            baseList =
                _repositForCurrTrader.getAllItemsFromDB(null, category);
            return(View(baseList));
        }