Ejemplo n.º 1
0
        /// <summary>
        /// 获取油料订单
        /// </summary>
        /// <returns></returns>
        public List <OilMaterialOrderDto> GetOderInfo()
        {
            List <OilMaterialOrderDto> temp = (from oredr in _oilMaterialOrderResposit.FindAll()
                                               join detail in _oilMaterialOrderDetailResposit.FindAll()
                                               on oredr.Id equals detail.OrderId
                                               join user in _staffResposit.FindAll()
                                               on oredr.StaffNoN equals user.NoN
                                               select new OilMaterialOrderDto
            {
                Id = oredr.Id,
                IsDel = oredr.IsDel,
                IsPanke = oredr.IsPanke,
                NoN = oredr.NoN,
                ApplyDate = oredr.ApplyDate,
                StaffNoN = oredr.StaffNoN,
                stfName = user.Name,
                CreateTime = oredr.CreateTime,
                Remark = oredr.Remark,
                OilSpec = detail.OilSpec,
                Volume = detail.Volume,
                Surplus = detail.Surplus,
                DayAvg = detail.DayAvg,
                NeedAmount = detail.NeedAmount,
                DetailID = detail.Id
            }).ToList();

            return(temp);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询在职员工信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public List <object> GetStarffInfo()
        {
            List <object> list = new List <object>();

            list.Add(_staffResposit.FindAll().Select(x => x.Name).ToList());
            return(list);
        }
        /// <summary>
        /// 生成一张员工在职表(如果改员工被同意入职)
        /// </summary>
        /// <param name="RefOrderId"></param>
        public void AddStaffInfo(int RefOrderId)
        {
            //根据记录表中关联的入职信息id 查询到申请人信息
            Entrys entrys = _entrysResposit.FindAll().FirstOrDefault(x => x.Id == RefOrderId);

            //生成一张员工在职表(如果改员工被同意入职)

            #region 生成工号 (后期性能差)
            bool   isoks = true;
            string non   = "";
            while (isoks)
            {
                non = "CH" + GetTime.GetTimeStamp() + GetTime.GetRandom();
                Staff staffNon = _staffResposit.FindAll().FirstOrDefault(x => x.NoN == non);

                if (staffNon == null)
                {
                    isoks = false;
                }
            }
            #endregion

            #region 审批同意后需要生成正式员工表的信息
            Staff staffIn = null;
            staffIn = new Staff()
            {
                JobId       = entrys.JobId,
                BirthDay    = entrys.BirthDay,
                Name        = entrys.StaffName,
                NoN         = non,
                CreateTime  = DateTime.Now,
                RoleId      = entrys.JobId,
                Passwords   = "123456", // 初始密码
                Sex         = entrys.Sex == 1 ? "男" : "女",
                Tel         = entrys.Tel,
                Email       = entrys.Email,
                Statusd     = "入职",
                IsHSEGroup  = "是",
                IsLaunch    = 0,
                OrgID       = 1,
                Addressd    = entrys.Addressd,
                NativePlace = "待定",
            };
            //添加
            _staffResposit.AddInfo(staffIn);
            #endregion
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Passwords"></param>
        /// <returns></returns>
        public object GetLogInfo(string Name, string Passwords)
        {
            Staff Info = _staffResposit.FindAll().FirstOrDefault(x => x.NoN == Name);

            if (Info != null)
            {
                if (Info.Passwords == Passwords)
                {
                    Job job = _jobresposit.FindAll().FirstOrDefault(x => x.Id == Info.JobId);
                    return(new { Info, job });
                }
                else
                {
                    return("密码错误!!");
                }
            }
            else
            {
                return("该用户不存在!!");
            }
        }