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)); }
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); } }
public ActionResult Category(int id) { ViewBag.Categories = CategoryModel.GetCategoryById(null); ViewBag.Category = CategoryModel.GetCategoryById(id).First(); var lots = LotModel.GetLotByCategoryId(id); return(View(lots)); }
public ActionResult Ended() { ViewBag.Categories = CategoryModel.GetCategoryById(null); var lots = LotModel.GetEndedLots(); return(View(lots)); }
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)); }
public ActionResult CreateLot() { ViewBag.Categories = CategoryModel.GetCategoryById(null); ViewBag.Partners = Partner.GetPartner(null, null); var lot = new LotModel(); return(View(lot)); }
public ActionResult Search(string query) { ViewBag.Categories = CategoryModel.GetCategoryById(null); ViewBag.Query = query; var lots = LotModel.GetLotByQuery(query); return(View(lots)); }
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)); }
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")); } }
public String GetCategoryName(int CategoryID) { categoryLogic = new CategoryModel(); return(categoryLogic.GetCategoryById(CategoryID).Name); }
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; } }
public ActionResult Categories() { var categories = CategoryModel.GetCategoryById(null); return(View(categories)); }
public ActionResult EditCategory(int id) { CategoryModel category = CategoryModel.GetCategoryById(id).First(); return(View("CreateCategory", category)); }
// GET: Admin public ActionResult Index() { ViewBag.Categories = CategoryModel.GetCategoryById(null); return(View()); }