Exemple #1
0
        // GET: Admin/Supplier
        public ActionResult Index(int?page, int?size, bool?loadPage, string searchName)
        {
            int  PageNumber = page ?? 1;
            int  PageSize   = size ?? 5;
            bool LoadPage   = loadPage ?? false;

            ViewBag.PageSize   = PageSize;
            ViewBag.LoadPage   = LoadPage;
            ViewBag.SearchName = string.IsNullOrEmpty(searchName) ? "" : searchName;
            List <Supplier> model = null;

            if (loadPage == true || Session["SS_SUPPLIER"] == null)
            {
                LoadPage               = false;
                ViewBag.LoadPage       = LoadPage;
                model                  = supplierBLL.GetAll();
                Session["SS_SUPPLIER"] = model;
            }
            else
            {
                model = (List <Supplier>)Session["SS_SUPPLIER"];
            }
            if (!string.IsNullOrEmpty(searchName))
            {
                model = model.Where(x => (x.Name.ToLower().Contains(searchName.ToLower()))).ToList();
            }
            ViewBag.Total = model.Count;
            ViewBag.Page  = PageNumber;
            return(View(model.ToPagedList(PageNumber, PageSize)));
        }
Exemple #2
0
        private void UpdateGrid()
        {
            dgvSuppliersSearch.Rows.Clear();
            QueryResponse <List <Supplier> > response = _supplierBLL.GetAll();

            if (!response.Success)
            {
                MessageBox.Show(response.Message);
                return;
            }
            _supplierGrid = new List <Supplier>(response.Data);

            InsertGrid(_supplierGrid);
        }
 public void GetAll()
 {
     dgvSupplier.DataSource = supplierBLL.GetAll();
     ClearSelection();
 }
Exemple #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     dgvSuppliers.DataSource = emp.GetAll();
 }
Exemple #5
0
 private void BasePurchaseForm_Load(object sender, EventArgs e)
 {
     cbSupplier.DataSource    = supplierBLL.GetAll();
     cbSupplier.DisplayMember = "SupplierName";
     cbSupplier.ValueMember   = "SupplierID";
 }