コード例 #1
0
        public RNViewModel SearchRN(RNViewModel model)
        {
            PetaPoco.Database db = null;
            var         dbConn   = DataContext.Database.Connection;
            RNViewModel Details  = new RNViewModel();

            try
            {
                using (DataContext)
                {
                    dbConn.Open();
                    db = new PetaPoco.Database(dbConn);
                    db.EnableAutoSelect = false;
                    Details.RNList      = db.Query <RN>("exec usp_SearchRN " + "@SId",
                                                        new { SId = model.SId }).ToList();
                    dbConn.Close();
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            finally
            {
                if (dbConn != null)
                {
                    dbConn.Close();
                }
            }
            return(Details);
        }
コード例 #2
0
        public ActionResult SearchRN(RNViewModel Model)
        {
            StoreService service = new StoreService();

            Model = service.SearchRN(Model);
            return(PartialView("_RNGrid", Model.RNList));
        }
コード例 #3
0
        public ActionResult ManageRN(RNViewModel Model)
        {
            StoreService service = new StoreService();

            ViewBag.Suppliers = new SelectList(AllSuppliers(), "Value", "Text");

            Model = service.SearchRN(Model);

            if (Request.IsAjaxRequest())
            {
                return(PartialView("_RNGrid", Model.RNList));
            }
            return(View("ManageRN", Model));
        }
コード例 #4
0
        public RNViewModel SearchRN(RNViewModel model)
        {
            RNViewModel Details = new RNViewModel();

            try
            {
                Details = _repository.SearchRN(model);
            }

            catch (Exception ex)
            {
                throw;
            }

            return(Details);
        }