// Method ListForExcel public void ListForExcel(MetroGrid grid, string keyword, string sortColumn, string sortBy) { grid.Rows.Clear(); grid.Columns.Clear(); List <PlaceStuffsModel> stuffs = PlaceStuffsDao.Instance.ListForExcel(keyword, !string.IsNullOrEmpty(sortColumn) ? HelperBll.GetColumnNameInSQLByPropertyName <PlaceStuffsModel>(sortColumn) : "", sortBy); PlaceStuffsModel nameOf = new PlaceStuffsModel(); grid.Columns.Add(nameof(nameOf.Name), nameof(nameOf.Name)); grid.Columns.Add(nameof(nameOf.CountStuffs), nameof(nameOf.CountStuffs)); for (int i = 0; i < stuffs.Count; i++) { grid.Rows.Add(); grid[nameof(nameOf.Name), i].Value = stuffs[i].Name; grid[nameof(nameOf.CountStuffs), i].Value = stuffs[i].CountStuffs; } }
// Method Delete public int Delete(PlaceStuffsModel placeStuff, string[] parameters) { Dictionary <string, object> dicParameters = HelperDao.GenerateParameter <PlaceStuffsModel>(placeStuff, parameters); return(DataProvider.Instance.Execute(PlaceStuffsQuerys.Delete(parameters), dicParameters)); }
// Method CheckExist public int CheckExist(PlaceStuffsModel placeStuff, string[] parameters) { Dictionary <string, object> dicParameters = HelperDao.GenerateParameter <PlaceStuffsModel>(placeStuff, parameters); return(DataProvider.Instance.Count(PlaceStuffsQuerys.CheckExsist(parameters, placeStuff.Id), dicParameters)); }