Example #1
0
 public ActionResult Index(PriceSearchModel model, Grid <CRMPriceQuotation> grid)
 {
     _grid       = grid;
     priceSearch = model;
     Session[PRICE_SEARCH_MODEL] = model;
     UpdateGrid();
     ViewBag.SearchingModel = model;
     return(PartialView("_List", _grid));
 }
Example #2
0
        public ActionResult ListByCus(long refId)
        {
            var sort     = new SSM.Services.SortField("Subject", true);
            var totalRow = 0;
            var search   = new PriceSearchModel()
            {
                CusId = refId
            };
            IEnumerable <CRMPriceQuotation> customers = priceQuotationService.GetAll(search, sort, out totalRow, 1, 100, CurrenUser);

            crmCustomer = crmCustomer ?? crmCustomerService.GetModelById(refId);
            var value = new
            {
                Views      = this.RenderPartialView("_ListForCus", customers),
                CloseOther = true,
                Title      = string.Format(@"{0}", "List Bao gia cua khách hàng " + crmCustomer.CompanyShortName),
            };

            return(JsonResult(value, true));
        }
Example #3
0
        public ActionResult Index(long?refId)
        {
            _grid = (Grid <CRMPriceQuotation>)Session[PRICE_LIST_MODEL];
            if (_grid == null)
            {
                _grid = new Grid <CRMPriceQuotation>
                        (
                    new Pager
                {
                    CurrentPage = 1,
                    PageSize    = 50,
                    Sord        = "asc",
                    Sidx        = "Subject"
                }
                        );
                _grid.SearchCriteria = new CRMPriceQuotation();
            }
            var searchModel = (PriceSearchModel)Session[PRICE_SEARCH_MODEL];

            priceSearch = searchModel ?? new PriceSearchModel()
            {
                DateType = "U"
            };
            ViewBag.SearchingModel = priceSearch;
            if (refId.HasValue)
            {
                priceSearch.CusId = refId.Value;
            }
            GetBaseData();
            var sales = usersServices.GetAllSales(CurrenUser, false);
            var depts = usersServices.GetAllDepartmentActive(CurrenUser);

            ViewBag.AllSales = new SelectList(sales, "Id", "FullName");
            ViewBag.AllDept  = new SelectList(depts, "Id", "DeptName");
            UpdateGrid();
            Session[PRICE_LIST_MODEL] = _grid;
            return(View(_grid));
        }