コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("请输入转出账户");
            var fromAccountNo = Console.ReadLine();

            Console.WriteLine("请输入转入账户");
            var toAccountNo = Console.ReadLine();

            Console.WriteLine("请输入转账金额");
            var transferMoneyStr = Console.ReadLine();

            try
            {
                var bll = new TransferBLL();
                bll.transfer(fromAccountNo, toAccountNo, transferMoneyStr);
                Console.WriteLine("转账成功");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #2
0
ファイル: PersonController.cs プロジェクト: paddy235/ERCHTMS
        public object GetInfo([FromBody] JObject json)
        {
            try
            {
                string  res          = json.Value <string>("json");
                dynamic dy           = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId       = dy.userid;
                string  id           = dy.data.uid;
                bool    IsPermission = false;             //是否有权限
                OperatorProvider.AppUserId = userId;      //设置当前用户
                var user = userBll.GetUserInfoEntity(id); //获取用户基本信息

                DataItemDetailBLL itemBll = new DataItemDetailBLL();
                string            path    = itemBll.GetItemValue("imgUrl");
                var cert   = new ERCHTMS.Busines.PersonManage.CertificateBLL().GetList(id).Select(t => new { t.CertName, t.CertNum, SendDate = t.SendDate.Value.ToString("yyyy-MM-dd"), t.Years, t.SendOrgan, FilePath = path + t.FilePath }).ToList(); //获取人员证书信息
                var wzInfo = new DesktopBLL().GetWZInfoByUserId(id);                                                                                                                                                                                    //违章信息
                var health = new ERCHTMS.Busines.OccupationalHealthManage.OccupationalstaffdetailBLL().GetUserTable(id);                                                                                                                                //职业病信息
                //20190326 fwz 新增查询个人接触职业危害因素
                string Hazardfactor = "";
                //判断是否是本人\厂领导\EHS部与人力资源部的人
                if (userId == id)
                {
                    IsPermission = true;
                }
                //获取当前操作用户
                var Appuser = userBll.GetUserInfoEntity(userId);   //获取用户基本信息
                //EHS部与人力资源部配置在字典中 通过字典查找
                var Perdeptname = Appuser.DepartmentCode;
                DataItemDetailBLL dataItemDetailBLL = new DataItemDetailBLL();
                var data = dataItemDetailBLL.GetDataItemListByItemCode("'SelectDept'").ToList();
                if (data != null)
                {
                    foreach (var Peritem in data)
                    {
                        string   value  = Peritem.ItemValue;
                        string[] values = value.Split('|');
                        for (int i = 0; i < values.Length; i++)
                        {
                            if (values[i] == Perdeptname) //如果部门编码对应则是有权限的人
                            {
                                IsPermission = true;
                                break;
                            }
                        }
                    }
                }

                //如果是厂领导也有权限
                if (Appuser.RoleName.Contains("厂级部门用户") && Appuser.RoleName.Contains("公司领导"))
                {
                    IsPermission = true;
                }

                if (IsPermission)
                {
                    Hazardfactor = new HazardfactoruserBLL().GetUserHazardfactor(user.Account);
                }

                var    work        = new WorkRecordBLL().GetList(id).Select(t => new { EnterDate = t.EnterDate.ToString().Contains("0001") ? "" : t.EnterDate.ToString("yyyy-MM-dd"), LeaveTime = t.LeaveTime.ToString().Contains("0001") ? "" : t.LeaveTime.ToString("yyyy-MM-dd"), t.DeptName, t.PostName, t.OrganizeName, t.JobName }).ToList();//工作记录
                string deptname    = new TransferBLL().GetDeptName(user.DepartmentId);
                string projectName = "";
                if (!string.IsNullOrEmpty(user.ProjectId))
                {
                    OutsouringengineerEntity entity = new OutsouringengineerBLL().GetEntity(user.ProjectId);
                    if (entity != null)
                    {
                        projectName = entity.ENGINEERNAME;
                    }
                }

                string photo = "";
                if (!string.IsNullOrEmpty(user.HeadIcon))
                {
                    if (!string.IsNullOrEmpty(path))
                    {
                        photo = path + user.HeadIcon;
                    }
                }
                int score = 100;
                var item  = itemBll.GetEntity("csjf");
                if (item != null)
                {
                    score = int.Parse(item.ItemValue);
                }

                int    point    = 0;
                string argValue = new DataItemDetailBLL().GetItemValue("Point");
                if (!string.IsNullOrEmpty(argValue) && argValue == "point")
                {
                    dynamic pointdata = UpdatePoint(user.Account);
                    if (pointdata != null && pointdata.Qualitydata.Count > 0)
                    {
                        point = pointdata.Qualitydata[0].point;
                    }
                }


                //2019-03-08 Fwz修改 加入职务字段 部门显示改为层级显示
                return(new { Code = 0, Count = 1, Info = "获取数据成功", data = new { realname = user.RealName, point = point, sex = user.Gender, identifyid = user.IdentifyID, deptname = deptname, postname = user.DutyName, dutyname = user.PostName, organizename = user.OrganizeName, native = user.Native, nation = user.Nation, isSpecial = user.IsSpecial, isSpecialEqu = user.IsSpecialEqu, isBlack = user.IsBlack, mobile = user.Mobile, usertype = user.UserType, isEpiboly = user.isEpiboly, enterDate = user.EnterTime == null ? "" : user.EnterTime.Value.ToString("yyyy-MM-dd"), leaveTime = user.DepartureTime == null ? "" : user.DepartureTime.Value.ToString("yyyy-MM-dd"), isPresence = user.isPresence, score = new UserScoreBLL().GetUserScore(user.UserId, DateTime.Now.Year.ToString()) + score, projectName = projectName, faceUrl = photo, CertInfo = cert, IllInfo = health, Hazardfactor = Hazardfactor, IsPermission = IsPermission, WorkInfo = work, IllegalInfo = wzInfo, isfourperson = user.IsFourPerson, fourpersontype = user.FourPersonType } });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }