예제 #1
0
        public JsonResult GetBasPdcSequence(GridParam gp)
        {
            int pageCount, totalCount;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("Pdc", Request.QueryString["Pdc"]);
            var data = _BasPdcSequenceDBAccess.GetList(gp, dic, out pageCount, out totalCount).ToList();

            var jsonData = new
            {
                total   = pageCount, //totalpages
                page    = gp.page,
                records = totalCount,
                rows    = (from c in data
                           select new
                {
                    cell = new string[] {
                        c.BasPdcSequenceId,
                        c.Pdc,
                        c.SequenceNumber.ToString(),
                        c.CreatedUserCode,
                        c.CreatedDate.ToString("yyyy-MM-dd"),
                        c.Active?"<=Yes>":"<=No>"
                    }
                }
                           ).ToArray()
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
        public async Task <HtmlGrid <UserListDetails> > GetUserLists(GridParam gridParam)
        {
            List <Task <UserListDetails> > tasksUserlists = new List <Task <UserListDetails> >();
            var details = _userManagementRepository.GetUserLists(StoredProcedureName, gridParam);

            foreach (UserListDetails user in details)
            {
                tasksUserlists.Add(Task.Run(() => UserGridManagement(user)));
            }

            var results = await Task.WhenAll(tasksUserlists);

            var userList = results.ToList();

            _log.Information("User details got as {0}", JsonConvert.SerializeObject(userList));
            var userLists = new HtmlGrid <UserListDetails> {
                aaData = userList
            };
            var firstDefault = userList.FirstOrDefault();

            if (firstDefault != null)
            {
                userLists.iTotalDisplayRecords = Convert.ToInt32(firstDefault.FilterCount);
                userLists.iTotalRecords        = Convert.ToInt32(firstDefault.FilterCount);
            }

            return(userLists);
        }
예제 #3
0
        public JsonResult GetBasNormalScheduleVTmDet(GridParam gp)
        {
            string basNormalScheduleVTmId = Request.QueryString["BasNormalScheduleVTmId"];
            var    data = _BasNormalScheduleVTmDetDBAccess.GetList(basNormalScheduleVTmId).OrderBy(gp.sidx, gp.sord).ToList();

            var jsonData = new
            {
                rows = (from c in data
                        select new
                {
                    cell = new string[] {
                        c.BasNormalScheduleVTmDetId,
                        c.Pdc,
                        c.TransMode,
                        c.SecondVLeadtime.ToString(),
                        c.SecondVLeadtimeAmPm,
                        c.SecondVLeadtimeStart.ToString("HH:mm:ss"),
                        c.SecondVLeadtimeEnd.ToString("HH:mm:ss")
                    }
                }
                        ).ToArray()
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
예제 #4
0
        public JsonResult GetBasSpecialScheduleIndex(GridParam gp)
        {
            int pageCount, totalCount;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("ScheduleNo", Request.QueryString["ScheduleNo"]);
            var data = _BasSpecialScheduleIndexDBAccess.GetList(gp, dic, out pageCount, out totalCount).ToList();

            var jsonData = new
            {
                total   = pageCount, //totalpages
                page    = gp.page,
                records = totalCount,
                rows    = (from c in data
                           select new
                {
                    cell = new string[] {
                        c.BasSpecialScheduleIndexId,
                        c.ScheduleNo,
                        c.EffectiveDate.ToString("yyyy-MM-dd"),
                        c.ExpirationDate.ToString("yyyy-MM-dd"),
                        c.Remark,
                        c.CreatedUserCode,
                        c.CreatedDate.ToString("yyyy-MM-dd")
                    }
                }
                           ).ToArray()
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
        public IQueryable <SysRole> GetList(GridParam gp, Dictionary <string, string> condition, out int pageCount, out int totalCount)
        {
            IQueryable <SysRole> originalSource = DataContext.SysRole.OrderByDescending(r => r.RoleCode);

            string RoleCode = condition.ContainsKey("RoleCode") == true ? condition["RoleCode"] : "";

            if (!RoleCode.IsNullString())
            {
                originalSource = originalSource.Where(o => o.RoleCode.Contains(RoleCode));
            }

            string RoleName = condition.ContainsKey("RoleName") == true ? condition["RoleName"] : "";

            if (!RoleName.IsNullString())
            {
                originalSource = originalSource.Where(o => o.RoleName.Contains(RoleName));
            }

            //string SysOrganizationId = condition.ContainsKey("SysOrganizationId") == true ? condition["SysOrganizationId"] : "";
            //if (!SysOrganizationId.IsNullString())
            //    originalSource = originalSource.Where(o => o.SysOrganizationId == SysOrganizationId);

            //string OrganizationName = condition.ContainsKey("OrganizationName") == true ? condition["OrganizationName"] : "";
            //if (!OrganizationName.IsNullString())
            //    originalSource = originalSource.Where(o => o.SysOrganization.OrganizationName.Contains(OrganizationName));

            pageCount      = 0;
            totalCount     = originalSource.Count();
            originalSource = originalSource.OrderBy(gp.sidx, gp.sord);

            var dataSouce = Paging <SysRole>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
예제 #6
0
        public IQueryable <SysUserRole> GetList(GridParam gp, Dictionary <string, string> condition, out int pageCount, out int totalCount)
        {
            IQueryable <SysUserRole> originalSource = DataContext.SysUserRole.OrderByDescending(r => r.SysUserRoleId);

            string SysRoleId = condition.ContainsKey("SysRoleId") == true ? condition["SysRoleId"] : "";

            if (!SysRoleId.IsNullString())
            {
                originalSource = originalSource.Where(o => o.SysRoleId == SysRoleId);
            }

            string SysUserId = condition.ContainsKey("SysUserId") == true ? condition["SysUserId"] : "";

            if (!SysUserId.IsNullString())
            {
                originalSource = originalSource.Where(o => o.SysUserId == SysUserId);
            }

            pageCount  = 0;
            totalCount = originalSource.Count();

            var dataSouce = Paging <SysUserRole>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
예제 #7
0
        public IQueryable <CBasCodeType> GetList(GridParam gp, Dictionary <string, string> condition, out int pageCount, out int totalCount)
        {
            IQueryable <CBasCodeType> originalSource = DataContext.CBasCodeType.OrderByDescending(r => r.UpdatedDate);
            string CodeType = condition["CodeType"];

            if (!string.IsNullOrEmpty(CodeType))
            {
                originalSource = originalSource.Where(o => o.CodeType.Contains(CodeType));
            }

            string CodeName = condition["CodeName"];

            if (!string.IsNullOrEmpty(CodeName))
            {
                originalSource = originalSource.Where(o => o.CodeName.Contains(CodeName));
            }

            pageCount      = 0;
            originalSource = originalSource.OrderBy(gp.sidx, gp.sord);
            totalCount     = originalSource.Count();
            //originalSource = originalSource.FilterSource().OrderBy(c=>c.UpdatedDate);
            var dataSouce = Paging <CBasCodeType>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
예제 #8
0
        public JsonResult GetDashboardData(GridParam gp)
        {
            int pageCount, totalCount;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("UserId", System.Web.HttpContext.Current.User.Identity.Name);
            var data = dashboard.GetList(gp, dic, out pageCount, out totalCount).ToList();

            var jsonData = new
            {
                total = totalCount,
                rows  = (from c in data
                         select new DashboardInfo()
                {
                    Guid = c.Guid,
                    ReportName = c.ReportName,
                    ReportSpecName = c.ReportSpecName,
                    ReportType = c.ReportType == "PieChart" ? "Pie" : c.ReportType == "LineChart" ? "Line" : c.ReportType == "Bar" ? "Bar" : "Group Bar",
                    ReportSpec = c.ReportSpec
                }
                         ).ToArray()
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
        public HtmlGrid <RoleLists> GetRoleLists(GridParam roleDetails)
        {
            List <RoleLists> roleLists = new List <RoleLists>();
            var details = _roleManagementRepository.GetRoleLists(roleDetails, StoredProcedureName);

            foreach (RoleLists role in details)
            {
                var detail = new RoleLists()
                {
                    Name        = role.Name,
                    FilterCount = role.FilterCount
                };
                var           roleId        = _encryptionService.EncryptString(role.Id);
                StringBuilder actionDetails = new StringBuilder();
                if (_roleExtension.HasPermission(PermissionValueLists.EditRole))
                {
                    actionDetails.Append("<a href='" + _configuration["ApplicationData:RootUrl"] + "/CoreSetup/Role/EditRole/" + roleId + "' class='btn btn-sm btn-link btn-round' title='Edit Role'><i class=\"fas fa-user-edit\"></i></a>");
                }
                detail.Action = actionDetails.ToString();
                roleLists.Add(detail);
            }
            _log.Information("role list get list response as {0}", JsonConvert.SerializeObject(roleLists));
            var roleList = new HtmlGrid <RoleLists>();

            roleList.aaData = roleLists;
            var firstDefault = roleLists.FirstOrDefault();

            if (firstDefault != null)
            {
                roleList.iTotalDisplayRecords = Convert.ToInt32(firstDefault.FilterCount);
                roleList.iTotalRecords        = Convert.ToInt32(firstDefault.FilterCount);
            }
            return(roleList);
        }
        public string GetGridDetails(GridDetails param)
        {
            var accountDetails = new GridParam
            {
                DisplayLength = param.length,
                DisplayStart  = param.start,
                SortDir       = param.order[0].dir,
                SortCol       = param.order[0].column,
                Flag          = "A",
                Search        = param.search.value,
                UserName      = StaticData.GetUser()
            };
            var gridList = buss.GetGridList(accountDetails);

            foreach (var item in gridList)
            {
                item.Action = StaticData.GetActions(ControllerName, item.UniqueId, "", AddEditId);
                //item.CreatedDate = StaticData.DBToFrontDate(item.CreatedDate);
            }
            HtmlGrid <GroceriesCommon> companyGrid = new HtmlGrid <GroceriesCommon>();
            var firstDefault = gridList.FirstOrDefault();

            companyGrid.aaData = gridList;
            if (firstDefault != null)
            {
                companyGrid.iTotalDisplayRecords = Convert.ToInt32(firstDefault.FilterCount);
                companyGrid.iTotalRecords        = Convert.ToInt32(firstDefault.FilterCount);
            }

            var result = JsonConvert.SerializeObject(companyGrid).ToString();

            return(result);
        }
예제 #11
0
        public JsonResult GetBasAdjustmentTable(GridParam gp)
        {
            int pageCount, totalCount;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("AdjustmentType", Request.QueryString["AdjustmentType"]);
            var data = _BasAdjustmentTableDBAccess.GetList(gp, dic, out pageCount, out totalCount).ToList();

            var jsonData = new
            {
                total   = pageCount, //totalpages
                page    = gp.page,
                records = totalCount,
                rows    = (from c in data
                           select new
                {
                    cell = new string[] {
                        c.PrintDate.HasValue?c.PrintDate.Value.ToString("yyyy-MM-dd") : "",
                            c.TnNo,
                            c.TnProperty
                    }
                }
                           ).ToArray()
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Get Role Lists For Grid
        /// </summary>
        /// <param name="roleDetails"></param>
        /// <param name="storedProcedureName"></param>
        /// <returns></returns>
        public List <RoleLists> GetRoleLists(GridParam roleDetails, string storedProcedureName)
        {
            _log.Information("sp call for getting available roles as with query {0} {1}", "EXEC " + storedProcedureName, JsonConvert.SerializeObject(roleDetails));
            var response = _dapperDao.ExecuteQuery <RoleLists>(storedProcedureName, roleDetails);

            _log.Information("response returned as {0}", JsonConvert.SerializeObject(response));
            return(response);
        }
        public List <UserListDetails> GetUserLists(string storedProcedureName, GridParam gridParam)
        {
            _log.Information("sp call for getting list of user with query {0} {1}", "EXEC " + storedProcedureName, JsonConvert.SerializeObject(gridParam));
            var response = _dapperDao.ExecuteQuery <UserListDetails>(storedProcedureName, gridParam);

            _log.Information("response returned as {0}", JsonConvert.SerializeObject(response));
            return(response);
        }
예제 #14
0
        public IQueryable <SysFunction> GetList(GridParam gp, Dictionary <string, string> dicCondtion,
                                                out int pageCount, out int totalCount)
        {
            IQueryable <SysFunction> originalSource = DataContext.SysFunction.OrderByDescending(r => r.SysFunctionId);

            string FunctionName = dicCondtion.ContainsKey("FunctionName") == true ? dicCondtion["FunctionName"] : "";

            if (!string.IsNullOrEmpty(FunctionName))
            {
                originalSource = originalSource.Where(o => o.FunctionName.Contains(FunctionName));
            }

            string ActionName = dicCondtion.ContainsKey("ActionName") == true ? dicCondtion["ActionName"] : "";

            if (!string.IsNullOrEmpty(ActionName))
            {
                originalSource = originalSource.Where(o => o.ActionName.Contains(ActionName));
            }

            string ControllerName = dicCondtion.ContainsKey("ControllerName") == true ? dicCondtion["ControllerName"] : "";

            if (!string.IsNullOrEmpty(ControllerName))
            {
                originalSource = originalSource.Where(o => o.ControllerName.Contains(ControllerName));
            }

            string ParentId = dicCondtion.ContainsKey("ParentId") == true ? dicCondtion["ParentId"] : "";

            if (!string.IsNullOrEmpty(ParentId))
            {
                originalSource = originalSource.Where(o => o.ParentId.Contains(ParentId));
            }

            string FunctionType = dicCondtion.ContainsKey("FunctionType") == true ? dicCondtion["FunctionType"] : "";

            if (!string.IsNullOrEmpty(FunctionType))
            {
                int iFuncType = Convert.ToInt16(FunctionType);
                originalSource = originalSource.Where(o => o.FunctionType == iFuncType);
            }

            string GroupType = dicCondtion.ContainsKey("GroupType") == true ? dicCondtion["GroupType"] : "";

            if (!string.IsNullOrEmpty(GroupType))
            {
                int igroupType = Convert.ToInt16(GroupType);
                originalSource = originalSource.Where(o => o.GroupType == igroupType);
            }

            pageCount      = 0;
            totalCount     = originalSource.Count();
            originalSource = originalSource.OrderBy(gp.sidx, gp.sord);

            var dataSouce = Paging <SysFunction>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
예제 #15
0
        public ActionResult GetGridList(GridParam gp, string F_Equipment_Id = null)
        {
            var data = new
            {
                rows  = maintenanceBLLBLL.GetGridList(gp, F_Equipment_Id),
                total = gp.total
            };

            return(Content(data.ToJson()));
        }
예제 #16
0
        public ActionResult GetDetailById(string f_id, GridParam gp)
        {
            var data = new
            {
                rows  = bomDetailBLL.GetDetailById(f_id, gp),
                total = gp.total
            };

            return(Content(data.ToJson()));
        }
예제 #17
0
        public ActionResult GetGridList(GridParam gp)
        {
            var data = new
            {
                rows  = GetProductMakeList(ProductMakeBLL.GetGridList(gp)),
                total = gp.total
            };

            return(Content(data.ToJson()));
        }
예제 #18
0
파일: BomBLL.cs 프로젝트: ranchg/PIMS
        public DataTable GetGridList(GridParam gp)
        {
            StringBuilder sb = new StringBuilder(@"SELECT * FROM (SELECT T1.*,T2.F_NAME AS F_PRODUCT_NAME FROM T_BOM T1 INNER JOIN T_PRODUCT T2 ON T1.F_PRODUCT_ID=T2.F_ID WHERE T1.F_DELETE_MARK = 0) T2 WHERE 1=1");

            if (!string.IsNullOrEmpty(gp.query))
            {
                sb.Append(ConditionBuilder.GetWhereSql2(gp.query.JsonToList <Condition>()));
            }
            return(Repository().FindTablePageBySql(sb.ToString(), ref gp));
        }
예제 #19
0
        public ActionResult GetGridList(GridParam gp)
        {
            var data = new
            {
                rows  = partBLL.GetGridList(gp),
                total = gp.total
            };

            return(Content(data.ToJson()));
        }
예제 #20
0
        public ActionResult GetProductList(GridParam gp)
        {
            List <T_Product> list = new ProductBLL().GetGridList(gp).ToList();
            var data = new
            {
                rows  = list,
                total = gp.total
            };

            return(Content(data.ToJson()));
        }
예제 #21
0
        /// <summary>
        /// 查询数据列表、返回List
        /// </summary>
        /// <param name="strSql">Sql语句</param>
        /// <param name="jqgridparam">分页参数</param>
        /// <returns></returns>
        public List <T> FindListPageBySql(string strSql, ref GridParam gp)
        {
            int      pageIndex = gp.offset / gp.limit + 1;
            int      pageSize  = gp.limit;
            int      totalRow  = 0;
            List <T> List      = DataFactory.Database().FindListPageBySql <T>(strSql, gp.sort, gp.order, pageIndex, pageSize, ref totalRow);

            gp.total = totalRow;
            AddGridSql2Cahce(strSql);
            return(List);
        }
예제 #22
0
        public static IQueryable <T> TakePage <T>(this IQueryable <T> query, GridParam gridParam) where T : class
        {
            var newQuery = query;

            if (!string.IsNullOrEmpty(gridParam.Sort))
            {
                var sortProperty = gridParam.Sort.Pascalize();
                newQuery = OrderingHelper(newQuery, sortProperty, gridParam.SortDirection == SortDirection.DESC, false);
            }
            return(newQuery.Skip(gridParam.SkipCount).Take(gridParam.MaxResultCount));
        }
예제 #23
0
        /// <summary>
        /// 查询数据列表、返回 DataTable
        /// </summary>
        /// <param name="strSql">Sql语句</param>
        /// <param name="jqgridparam">分页参数</param>
        /// <returns></returns>
        public DataTable FindTablePageBySql(string strSql, ref GridParam gp)
        {
            int       pageIndex = gp.offset / gp.limit + 1;
            int       pageSize  = gp.limit;
            int       totalRow  = 0;
            DataTable dt        = DataFactory.Database().FindTablePageBySql(strSql, gp.sort, gp.order, pageIndex, pageSize, ref totalRow);

            AddGridSql2Cahce(strSql);
            gp.total = totalRow;
            return(dt);
        }
예제 #24
0
        public IQueryable <CBasNormalScheduleVCtDet> GetList(GridParam gp, Dictionary <string, string> condition, out int pageCount, out int totalCount)
        {
            IQueryable <CBasNormalScheduleVCtDet> originalSource = DataContext.CBasNormalScheduleVCtDet;

            pageCount      = 0;
            originalSource = originalSource.OrderBy(gp.sidx, gp.sord);
            totalCount     = originalSource.Count();
            var dataSouce = Paging <CBasNormalScheduleVCtDet>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
예제 #25
0
        /// <summary>
        /// 查询数据列表、返回List
        /// </summary>
        /// <param name="WhereSql">条件</param>
        /// <param name="parameters">sql语句对应参数</param>
        /// <param name="jqgridparam">分页参数</param>
        /// <returns></returns>
        public List <T> FindListPage(string WhereSql, DbParameter[] parameters, ref GridParam gp)
        {
            int      pageIndex = gp.offset / gp.limit + 1;
            int      pageSize  = gp.limit;
            int      totalRow  = 0;
            string   querySql  = string.Empty;
            List <T> List      = DataFactory.Database().FindListPage <T>(WhereSql, parameters, gp.sort, gp.order, pageIndex, pageSize, ref totalRow, out querySql);

            gp.total = totalRow;
            AddGridSql2Cahce(querySql);
            return(List);
        }
예제 #26
0
파일: UserLogBLL.cs 프로젝트: ranchg/PIMS
        //获取表格列表 By 阮创 2017/11/30
        public List <T_User_Log> GetGridList(GridParam gp)
        {
            string select = "SELECT * FROM", where = "WHERE 1=1";
            string from   = "SELECT T1.* FROM T_USER_LOG T1 WHERE T1.F_DELETE_MARK = 0";

            if (!string.IsNullOrEmpty(gp.query))
            {
                where += ConditionBuilder.GetWhereSql2(gp.query.JsonToList <Condition>());
            }
            string sql = string.Format("{0} ({1}) TT {2}", select, from, where);

            return(Repository().FindListPageBySql(sql, ref gp));
        }
        public IQueryable <CBasSpecialSchedule> GetList(GridParam gp, Dictionary <string, string> condition, out int pageCount, out int totalCount)
        {
            IQueryable <CBasSpecialSchedule> originalSource = DataContext.CBasSpecialSchedule;
            string BasSpecialScheduleIndexId = condition["BasSpecialScheduleIndexId"];

            if (!string.IsNullOrEmpty(BasSpecialScheduleIndexId))
            {
                originalSource = originalSource.Where(o => o.BasSpecialScheduleIndexId == BasSpecialScheduleIndexId);
            }

            string dealerCode = condition["DealerCode"];

            if (!string.IsNullOrEmpty(dealerCode))
            {
                originalSource = originalSource.Where(o => o.DealerCode.Contains(dealerCode));
            }

            if (condition.ContainsKey("PickupDayFrom"))
            {
                string startdate = condition["PickupDayFrom"];
                if (!string.IsNullOrEmpty(startdate))
                {
                    DateTime startDate = Convert.ToDateTime(startdate);
                    if (startDate != null)
                    {
                        originalSource = originalSource.Where(o => o.PickupDay >= startDate);
                    }
                }
            }
            if (condition.ContainsKey("PickupDayTo"))
            {
                string endingdate = condition["PickupDayTo"];
                if (!string.IsNullOrEmpty(endingdate))
                {
                    DateTime endingDate = Convert.ToDateTime(endingdate);
                    if (endingDate != null)
                    {
                        originalSource = originalSource.Where(o => o.PickupDay <= endingDate);
                    }
                }
            }

            pageCount      = 0;
            originalSource = originalSource.OrderBy(gp.sidx, gp.sord);
            totalCount     = originalSource.Count();
            var dataSouce = Paging <CBasSpecialSchedule>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
예제 #28
0
        public IQueryable <CBasCity> GetList(GridParam gp, Dictionary <string, string> condition, out int pageCount, out int totalCount)
        {
            IQueryable <CBasCity> originalSource = DataContext.BasCity;
            string CityCode = condition["CityCode"];

            if (!CityCode.IsNullString())
            {
                originalSource = originalSource.Where(o => o.CityCode.Contains(CityCode));
            }

            string CityName = condition["CityName"];

            if (!CityName.IsNullString())
            {
                originalSource = originalSource.Where(o => o.CityName.Contains(CityName));
            }

            string CityTypeCode = condition["CityTypeCode"];

            if (!CityTypeCode.IsNullString())
            {
                originalSource = originalSource.Where(o => o.CityTypeCode == CityTypeCode);
            }

            string ProvinceId = condition["ProvinceId"];

            if (!ProvinceId.IsNullString())
            {
                originalSource = originalSource.Where(o => o.ProvinceId == ProvinceId);
            }

            string Active = condition["Active"];

            if (Active == "Y")
            {
                originalSource = originalSource.Where(o => o.Active);
            }
            else if (Active == "N")
            {
                originalSource = originalSource.Where(o => !o.Active);
            }

            pageCount      = 0;
            originalSource = originalSource.OrderBy(gp.sidx, gp.sord);
            totalCount     = originalSource.Count();
            var dataSouce = Paging <CBasCity>(originalSource, gp.rows, gp.page, out pageCount);

            return(dataSouce);
        }
        public List <ClothesCommon> GetGridList(GridParam gridParam)
        {
            var list = new List <ClothesCommon>();

            try
            {
                var sql = "EXEC proc_tblClothes ";
                sql += " @FLAG = " + dao.FilterString("A");
                sql += ",@User = "******",@Search = " + dao.FilterString(gridParam.Search);
                sql += ",@DisplayLength = " + dao.FilterString(gridParam.DisplayLength.ToString());
                sql += ",@DisplayStart = " + dao.FilterString(gridParam.DisplayStart.ToString());
                sql += ",@SortDir = " + dao.FilterString(gridParam.SortDir);
                sql += ",@SortCol = " + dao.FilterString(gridParam.SortCol.ToString());
                var dt = dao.ExecuteDataTable(sql);

                if (null != dt)
                {
                    int sn = 1;
                    foreach (System.Data.DataRow item in dt.Rows)
                    {
                        var common = new ClothesCommon()
                        {
                            UniqueId           = Convert.ToInt32(item["RowId"]),
                            ProductReferenceId = item["ProductReferenceId"].ToString(),
                            ProductDestintId   = item["ProductDestintId"].ToString(),
                            Brand           = item["Brand"].ToString(),
                            ProductName     = item["ProductName"].ToString(),
                            ProductPrice    = item["ProductPrice"].ToString(),
                            DiscountPercent = item["DiscountPercent"].ToString(),
                            ProductFor      = item["ProductFor"].ToString(),
                            //ProductName = item["ProductName"].ToString(),
                            //ProductName = item["ProductName"].ToString(),
                            User        = item["CreatedBy"].ToString(),
                            CreatedDate = item["CreatedDate"].ToString(),
                            FilterCount = item["FilterCount"].ToString(),
                        };
                        sn++;
                        list.Add(common);
                    }
                }
                return(list);
            }

            catch (Exception e)
            {
                return(list);
            }
        }
예제 #30
0
        public List <T_Part> GetGridList(GridParam gp)
        {
            string select = "SELECT * FROM", where = "WHERE 1=1";
            string from   =
                @"SELECT T1.*
              FROM V_PART T1";

            if (!string.IsNullOrEmpty(gp.search))
            {
                where += string.Format(" AND (F_NAME LIKE '%{0}%' OR F_CODE LIKE '%{0}%' OR F_SPEC LIKE '%{0}%')", gp.search);
            }
            string sql = string.Format("{0} ({1}) TT {2}", select, from, where);

            return(new Repository <T_Part>().FindListPageBySql(sql, ref gp));
        }