private void InitializeCommands() { GoToCityPageCommand = new RelayCommand(p => CurrentPage = new CityPage(new CityPageVM("NewPasTransfDbConnection"))); GoToRoutePageCommand = new RelayCommand(p => CurrentPage = new RoutePage(new RoutePageVM("NewPasTransfDbConnection"))); GoToTripPageCommand = new RelayCommand(p => CurrentPage = new TripPage(new TripPageVM("NewPasTransfDbConnection"))); GoToClientPageCommand = new RelayCommand(p => CurrentPage = new ClientPage(new ClientPageVM("NewPasTransfDbConnection"))); GoToOrderPageCommand = new RelayCommand(p => CurrentPage = new OrderPage(new OrderPageVM("NewPasTransfDbConnection"))); }
public CityPage GetRecordPage(int iPageNo, int iPageSize) { CityPage objReturn = new CityPage(); try { using (City_DAL objDAL = new City_DAL()) { objReturn = objDAL.GetRecordPage(iPageNo, iPageSize); } } catch (Exception ex) { log.Error("GetRecordPage Error: ", ex); } return(objReturn); }
public CityPage GetRecordPage(int iPageNo, int iPageSize) { CityPage objReturn = new CityPage(); try { using (SqlConnection db = new SqlDBConnect().GetConnection()) { DynamicParameters param = new DynamicParameters(); param.Add("@pageNum", iPageNo); param.Add("@pageSize", iPageSize); param.Add("@TotalRecords", dbType: System.Data.DbType.Int32, direction: System.Data.ParameterDirection.Output); objReturn.Citys = db.Query <City>("udp_City_lstpage", param: param, commandType: System.Data.CommandType.StoredProcedure).ToList(); objReturn.TotalRecords = param.Get <int>("@TotalRecords"); } } catch (Exception ex) { log.Error("GetCityPageList Error: ", ex); } return(objReturn); }