Esempio n. 1
0
        // GET: Category
        public ActionResult Index()
        {
            CategoryBO cbo    = new CategoryBO();
            var        result = cbo.GetList();

            return(View(result));
        }
Esempio n. 2
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            var searchText = textBox1.Text.ToLower();

            switch (CurrentPoco)
            {
            case CurrentPoco.Shipper:
                ShipperBO sb      = new ShipperBO();
                var       list    = sb.GetList();
                var       newList = list.Where(x => x.CompanyName.ToLower().Contains(searchText)).ToList();
                dgvMain.DataSource = null;
                dgvMain.DataSource = newList;
                break;

            case CurrentPoco.Category:
                CategoryBO cb       = new CategoryBO();
                var        list2    = cb.GetList();
                var        newList2 = list2.Where(x => x.CategoryName.ToLower().Contains(searchText)).ToList();
                dgvMain.DataSource = null;
                dgvMain.DataSource = newList2;
                break;

            case CurrentPoco.ApplicationUser:
                ApplicationUserBO ub = new ApplicationUserBO();
                var list3            = ub.GetList();
                var newList3         = list3.Where(x => x.UserName.ToLower().Contains(searchText)).ToList();
                dgvMain.DataSource = null;
                dgvMain.DataSource = newList3;
                break;

            default:
                break;
            }
        }
Esempio n. 3
0
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var msi = sender as ToolStripMenuItem;

            foreach (var item in menuToolStripMenuItem.DropDownItems)
            {
                var myItem = item as ToolStripMenuItem;
                myItem.Checked = false;
            }
            msi.Checked = true;

            if (msi.Text == "Shippers")
            {
                ShipperBO sb = new ShipperBO();
                dgvMain.DataSource = null;
                dgvMain.DataSource = sb.GetList();
                CurrentPoco        = CurrentPoco.Shipper;
            }
            else if (msi.Text == "Categories")
            {
                CategoryBO cb = new CategoryBO();
                dgvMain.DataSource = null;
                dgvMain.DataSource = cb.GetList();
                CurrentPoco        = CurrentPoco.Category;
            }
        }
        // GET: Tables
        public ActionResult Index()
        {
            ShipperBO       sbo        = new ShipperBO();
            CategoryBO      cbo        = new CategoryBO();
            var             shippers   = sbo.GetList();
            var             categories = cbo.GetList();
            TablesViewModel tb         = new TablesViewModel();

            tb.Shippers   = shippers;
            tb.Categories = categories;
            return(View(tb));
        }
Esempio n. 5
0
        private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (CurrentPoco)
            {
            case CurrentPoco.Shipper:
                ShipperBO sb = new ShipperBO();
                dgvMain.DataSource = null;
                dgvMain.DataSource = sb.GetList();
                break;

            case CurrentPoco.Category:
                CategoryBO cb = new CategoryBO();
                dgvMain.DataSource = null;
                dgvMain.DataSource = cb.GetList();
                break;

            default:
                break;
            }
        }