コード例 #1
0
ファイル: InvoiceController.cs プロジェクト: rrossenbg/vprint
        public ActionResult Search()
        {
            var model = new InvoiceSearch_Model();

            model.Country = CurrentUser.CountryID;

            ViewData["HeadOfficeList"] = HttpContext.Session.Get <int, List <HeadOffice> >("HeadOfficeList" + CurrentUser.CountryID,
                                                                                           Helper.CreateHeadOfficeDropDownLoadFunction(), CurrentUser.CountryID).CreateSelectList((h) => string.Format("{0} - {1}", h.Name, h.Id), (h) => h.Id.ToString());

            ViewData["RetailerList"] =
                HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyDropDownLoadFunction());

            return(View(model));
        }
コード例 #2
0
ファイル: InvoiceController.cs プロジェクト: rrossenbg/vprint
        public ActionResult Search(InvoiceSearch_Model model)
        {
            model.Validate(this.ModelState);

            if (this.ModelState.IsValid)
            {
                if (model.UseNumber)
                {
                    ViewData["InvoiceSearchList"] =
                        PTFDataAccess.SelectForNotaDebitosByNumber(model.Country, model.Number, model.FromDate, model.ToDate);
                }
                else
                {
                    ViewData["InvoiceSearchList"] =
                        PTFDataAccess.SelectForNotaDebitosPerHeadOffice(model.Country, model.HeadOffice, model.FromDate, model.ToDate);
                }
            }
            ViewData["HeadOfficeList"] = HttpContext.Session.Get <int, List <HeadOffice> >("HeadOfficeList" + CurrentUser.CountryID,
                                                                                           Helper.CreateHeadOfficeDropDownLoadFunction(), CurrentUser.CountryID).CreateSelectList((h) => string.Format("{0} - {1}", h.Name, h.Id), (h) => h.Id.ToString());

            ViewData["RetailerList"] =
                HttpContext.Session.Get <List <SelectListItem> >("Empty", Helper.CreateEmptyDropDownLoadFunction());
            return(View(model));
        }