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); }
public ActionResult SearchRN(RNViewModel Model) { StoreService service = new StoreService(); Model = service.SearchRN(Model); return(PartialView("_RNGrid", Model.RNList)); }
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)); }
public RNViewModel SearchRN(RNViewModel model) { RNViewModel Details = new RNViewModel(); try { Details = _repository.SearchRN(model); } catch (Exception ex) { throw; } return(Details); }