Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var top = LotModel.GetTopLots(1);

            ViewBag.Top = top;
            var secondTop = LotModel.GetTopLots(2);

            ViewBag.SecondTop = secondTop;
            var thirdTop = LotModel.GetTopLots(3);

            ViewBag.ThirdTop = thirdTop;
            var lots = LotModel.GetLotById(null);

            try{
                lots.RemoveAll(l => l.Id == top.Id);
                lots.RemoveAll(l => l.Id == secondTop.Id);
                lots.RemoveAll(l => l.Id == thirdTop.Id);
            }
            catch {
            }
            ViewBag.Categories = CategoryModel.GetCategoryById(null);
            if (Request.IsAuthenticated)
            {
                ViewBag.WinnedBids = BidModel.GetWinnerBids(User.Identity.GetUserId());
            }

            return(View(lots));
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                CategoryModel objResultModel = new CategoryModel();
                int           id             = Convert.ToInt32(Request.QueryString["id"]);
                if (id != 0)
                {
                    var result = objResultModel.GetCategoryById(id);

                    txtCategory.Text     = result.CategoryName;
                    lblHeadText.Text     = "Update Result";
                    btnSaveCategory.Text = "Upadte";
                    Updateid.Value       = Convert.ToString(result.categoryId);
                }
                else
                {
                    lblHeadText.Text     = "Add Category";
                    btnSaveCategory.Text = "Save";
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(" + ex.Message + ")", true);
            }
        }
Ejemplo n.º 3
0
        public ActionResult Category(int id)
        {
            ViewBag.Categories = CategoryModel.GetCategoryById(null);
            ViewBag.Category   = CategoryModel.GetCategoryById(id).First();
            var lots = LotModel.GetLotByCategoryId(id);

            return(View(lots));
        }
Ejemplo n.º 4
0
        public ActionResult Ended()
        {
            ViewBag.Categories = CategoryModel.GetCategoryById(null);

            var lots = LotModel.GetEndedLots();

            return(View(lots));
        }
Ejemplo n.º 5
0
        public ActionResult EditLot(int id)
        {
            LotModel lot = LotModel.GetLotById(id).First();

            ViewBag.Partners   = Partner.GetPartner(null, null);
            ViewBag.Categories = CategoryModel.GetCategoryById(null);
            return(View("CreateLot", lot));
        }
Ejemplo n.º 6
0
        public ActionResult CreateLot()
        {
            ViewBag.Categories = CategoryModel.GetCategoryById(null);
            ViewBag.Partners   = Partner.GetPartner(null, null);
            var lot = new LotModel();

            return(View(lot));
        }
Ejemplo n.º 7
0
        public ActionResult Search(string query)
        {
            ViewBag.Categories = CategoryModel.GetCategoryById(null);

            ViewBag.Query = query;
            var lots = LotModel.GetLotByQuery(query);

            return(View(lots));
        }
Ejemplo n.º 8
0
        public ActionResult Lots(int?id)
        {
            if (id == null)
            {
                id = CategoryModel.GetCategoryById(null).First().Id;
            }
            var lots = LotModel.AdminGetLotByCategoryId(Convert.ToInt32(id));

            ViewBag.Categories = CategoryModel.GetCategoryById(null);

            return(View(lots));
        }
Ejemplo n.º 9
0
 public ActionResult EditCategory(int id)
 {
     if (Convert.ToInt32(Session["UserRollId"]) == 1)
     {
         CategoryModel model      = new CategoryModel();
         var           Categories = model.GetCategoryById(id);
         return(View("Categories", Categories));
     }
     else
     {
         return(Redirect("/Admin/index"));
     }
 }
Ejemplo n.º 10
0
 public String GetCategoryName(int CategoryID)
 {
     categoryLogic = new CategoryModel();
     return(categoryLogic.GetCategoryById(CategoryID).Name);
 }
Ejemplo n.º 11
0
        private void LoadData()
        {
            if (Type == 1)
            {
                userLogic = new UsersModel();
                userLogic = userLogic.GetUserById(UserID);

                usergroupLogic = new GroupModel();

                txtUsername.Text        = userLogic.Username;
                txtEmail.Text           = userLogic.Email;
                txtPassword.Text        = userLogic.Password;
                txtPoint.Text           = userLogic.Point.ToString();
                ddlGroup.DataSource     = usergroupLogic.GetGroupList();
                ddlGroup.DataTextField  = "Name";
                ddlGroup.DataValueField = "GroupID";
                ddlGroup.DataBind();
                ddlGroup.SelectedIndex = userLogic.GroupID - 1;
            }
            else if (Type == 2)
            {
                usergroupLogic = new GroupModel();
                usergroupLogic = usergroupLogic.GetGroupById(GroupID);

                txtName.Text        = usergroupLogic.Name;
                txtDescription.Text = usergroupLogic.Description;
                cbIsLimit.Checked   = usergroupLogic.IsLimit;
                txtDownLimit.Text   = usergroupLogic.DownloadLimit.ToString();
            }
            else if (Type == 3)
            {
                categoryLogic = new CategoryModel();
                categoryLogic = categoryLogic.GetCategoryById(CategoryID);

                txtCategoryName.Text = categoryLogic.Name;
            }
            else if (Type == 4)
            {
                categoryLogic = new CategoryModel();

                docLogic = new DocumentModel();
                docLogic = docLogic.GetDocumentById(DocID);

                txtDocName.Text               = docLogic.Name;
                txtDocLink.Text               = docLogic.Link;
                cbIsError.Checked             = docLogic.IsError;
                ddlDocCategory.DataSource     = categoryLogic.GetCategoryList();
                ddlDocCategory.DataTextField  = "Name";
                ddlDocCategory.DataValueField = "CategoryID";
                ddlDocCategory.DataBind();
                ddlDocCategory.SelectedIndex = docLogic.CategoryID - 1;
                txtDocDescription.Text       = docLogic.Description;
            }
            else if (Type == 5)
            {
                collectionLogic = new CollectionModel();
                collectionLogic = collectionLogic.GetCollectionById(CollectionID);

                txtCollectionName.Text      = collectionLogic.Name;
                txtCollectionDesc.Text      = collectionLogic.Description;
                cbIsCollectionError.Checked = collectionLogic.IsError;
            }
        }
Ejemplo n.º 12
0
        public ActionResult Categories()
        {
            var categories = CategoryModel.GetCategoryById(null);

            return(View(categories));
        }
Ejemplo n.º 13
0
        public ActionResult EditCategory(int id)
        {
            CategoryModel category = CategoryModel.GetCategoryById(id).First();

            return(View("CreateCategory", category));
        }
Ejemplo n.º 14
0
        // GET: Admin
        public ActionResult Index()
        {
            ViewBag.Categories = CategoryModel.GetCategoryById(null);

            return(View());
        }