Пример #1
0
        /// <summary>
        /// 分页集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public PageList <ORD_PurchaseOrderResult> GetPageList(ORD_PurchaseOrderParam param)
        {
            this.CheckSession();
            PageList <ORD_PurchaseOrderResult> ret = new PageList <ORD_PurchaseOrderResult>();

            try
            {
                List <Field> field = new List <Field>()
                {
                    Field.All
                };
                ret = this.SelectList <ORD_PurchaseOrderResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), field, GetWhereClip(param), ORD_PurchaseOrder._.CreatedTime.Desc);
                if (ret.ResultList != null && ret.ResultList.Count > 0)
                {
                    HR_OrgBLL orgBLL = new HR_OrgBLL();
                    orgBLL.SessionInfo = this.SessionInfo;
                    HR_OrgParam orgParam = new HR_OrgParam();
                    orgParam.OrgIDs = ret.ResultList.Where(a => a.PurOrgID != null).Select(a => a.PurOrgID).Distinct().ToArray();
                    List <HR_OrgResult> orgList = orgBLL.GetOrgTree(orgParam);

                    HR_DepartmentBLL deptBLL = new HR_DepartmentBLL();
                    deptBLL.SessionInfo = this.SessionInfo;
                    HR_DepartmentParam deptParam = new HR_DepartmentParam();
                    deptParam.DeptIDs = ret.ResultList.Where(a => a.PurDeptID != null).Select(a => a.PurDeptID).Distinct().ToArray();
                    List <HR_DepartmentResult> deptList = deptBLL.GetDeptList(deptParam);
                    HR_Org findOrg = null;
                    HR_DepartmentResult findDept = null;

                    foreach (ORD_PurchaseOrderResult orderResult in ret.ResultList)
                    {
                        findOrg = orgList.Find(a => a.OrgID == orderResult.PurOrgID);
                        if (findOrg != null)
                        {
                            orderResult.PurOrgName = findOrg.OrgName;
                        }
                        findDept = deptList.Find(a => a.DeptID == orderResult.PurDeptID);
                        if (findDept != null)
                        {
                            orderResult.PurDeptName = findDept.DeptName;
                        }
                        orderResult.AllStatus = orderResult.StkInStatus + "->" + orderResult.StkOutStatus;
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Пример #2
0
        /// <summary>
        /// 分页集合
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public PageList <STK_OutResult> GetPageList(STK_OutParam param)
        {
            this.CheckSession();
            PageList <STK_OutResult> ret = new PageList <STK_OutResult>();

            try
            {
                List <Field> field = new List <Field>()
                {
                    Field.All
                };
                ret = this.SelectList <STK_OutResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), field, GetWhereClip(param), STK_Out._.CreatedTime.Desc);
                if (ret.ResultList != null && ret.ResultList.Count > 0)
                {
                    HR_OrgBLL orgBLL = new HR_OrgBLL();
                    orgBLL.SessionInfo = this.SessionInfo;
                    HR_OrgParam orgParam = new HR_OrgParam();
                    orgParam.OrgIDs = ret.ResultList.Where(a => a.OperDeptID != null).Select(a => a.OperOrgID).Distinct().ToArray();
                    List <HR_OrgResult> orgList = orgBLL.GetOrgTree(orgParam);

                    HR_DepartmentBLL deptBLL = new HR_DepartmentBLL();
                    deptBLL.SessionInfo = this.SessionInfo;
                    HR_DepartmentParam deptParam = new HR_DepartmentParam();
                    deptParam.DeptIDs = ret.ResultList.Where(a => a.OperDeptID != null).Select(a => a.OperDeptID).Distinct().ToArray();
                    List <HR_DepartmentResult> deptList = deptBLL.GetDeptList(deptParam);

                    foreach (STK_OutResult orderResult in ret.ResultList)
                    {
                        if (orderResult.OperOrgID != null)
                        {
                            orderResult.OperOrgName = orgList.FirstOrDefault(a => a.OrgID == orderResult.OperOrgID).OrgName;
                        }
                        if (orderResult.OperDeptID != null)
                        {
                            orderResult.OperDeptName = deptList.FirstOrDefault(a => a.DeptID == orderResult.OperDeptID).DeptName;
                        }
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }
Пример #3
0
        public PageList <ORD_SalesOrderResult> GetSimplePageList(ORD_SalesOrderParam param, List <Field> fields)
        {
            PageList <ORD_SalesOrderResult> ret = new PageList <ORD_SalesOrderResult>();

            try
            {
                ret = this.SelectList <ORD_SalesOrderResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), fields, GetWhereClip(param), ORD_SalesOrder._.CreatedTime.Desc);
                if (ret.ResultList != null && ret.ResultList.Count > 0)
                {
                    HR_OrgBLL orgBLL = new HR_OrgBLL();
                    orgBLL.SessionInfo = this.SessionInfo;
                    HR_OrgParam orgParam = new HR_OrgParam();
                    orgParam.OrgIDs = ret.ResultList.Where(a => a.SalDeptID != null).Select(a => a.SalOrgID).Distinct().ToArray();
                    List <HR_OrgResult> orgList = orgBLL.GetOrgTree(orgParam);

                    HR_DepartmentBLL deptBLL = new HR_DepartmentBLL();
                    deptBLL.SessionInfo = this.SessionInfo;
                    HR_DepartmentParam deptParam = new HR_DepartmentParam();
                    deptParam.DeptIDs = ret.ResultList.Where(a => a.SalDeptID != null).Select(a => a.SalDeptID).Distinct().ToArray();
                    List <HR_DepartmentResult> deptList = deptBLL.GetDeptList(deptParam);



                    foreach (ORD_SalesOrderResult orderResult in ret.ResultList)
                    {
                        if (orderResult.SalOrgID != null)
                        {
                            orderResult.SalOrgName = orgList.FirstOrDefault(a => a.OrgID == orderResult.SalOrgID).OrgName;
                        }
                        if (orderResult.SalDeptID != null)
                        {
                            orderResult.SalDeptName = deptList.FirstOrDefault(a => a.DeptID == orderResult.SalDeptID).DeptName;
                        }
                        orderResult.AllStatus = orderResult.NotifyStatus + "->" + orderResult.PurchaseStatus + "->" + orderResult.StkInStatus + "->" + orderResult.StkOutStatus;
                    }
                }
            }
            catch (WarnException exp)
            {
                throw exp;
            }
            catch (System.Exception exp)
            {
                LogInfoBLL.WriteLog(this.SessionInfo, exp);
                throw exp;
            }
            return(ret);
        }