Esempio n. 1
0
        public string ReturnNodeName(int NodeId)
        {
            var NodeName   = "";
            var szServices = new DbHelperEfSql <Nodes>();
            var item       = szServices.SearchBySingle(c => c.NodeId == NodeId);

            if (item != null)
            {
                NodeName = item.NodeName;
            }
            return(NodeName);
        }
Esempio n. 2
0
        public bool ChangePassword(Guid welfareCentreId, Guid id, string iNewPassword)
        {
            string sql    = string.Format("UPDATE Users SET Password='******',OperateDate=getdate() where UserID ='{1}'", iNewPassword, id);
            var    isFlag = DbHelperSql.ExecuteNonQuery(sql) > 0;

            if (isFlag == true)
            {
                var isFw = false;
                if (isFw == false)
                {
                    var userService = new DbHelperEfSql <Users>();
                    var userItem    = userService.SearchBySingle(c => c.UserID == id);
                }
            }
            return(isFlag);
        }
Esempio n. 3
0
        /// <summary>
        ///  递归获取护理内容项顶级id
        ///  修改方法:添加参数养老院id--welfareCentreId,防止多家养老院是取值重复 2019-02-28 林中枝修改
        /// </summary>
        /// <param name="parentId"></param>
        /// <param name="resultId"></param>
        private void DoExtByWhole(Guid?welfareCentreId, int?parentId, ref int resultId)
        {
            var szServices = new DbHelperEfSql <tbNursingRank>();
            var item       = szServices.SearchBySingle(c => c.ID == parentId && c.WelfareCentreID == welfareCentreId);

            if (item == null)
            {
                return;
            }
            var listK = szServices.SearchListByCondition(c => c.ParentID == 0 && c.WelfareCentreID == welfareCentreId && c.IsValid == 1);

            if (listK == null || listK.Count <= 0)
            {
                return;
            }
            if (listK.Count(c => c.ID == item.ParentID && c.WelfareCentreID == welfareCentreId) > 0)
            {
                resultId = item.ID;
            }
            else
            {
                DoExtByWhole(item.WelfareCentreID, item.ParentID, ref resultId);
            }
        }
Esempio n. 4
0
        public Roles GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <Roles>();

            return(szServices.SearchBySingle(c => c.RoleID == id));
        }
Esempio n. 5
0
        public tbOrganization GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <tbOrganization>();

            return(szServices.SearchBySingle(c => c.ID == id));
        }
Esempio n. 6
0
        public Attachments GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <Attachments>();

            return(szServices.SearchBySingle(c => c.AttachmentID == id));
        }
Esempio n. 7
0
        public tbPaymentPlan GetById(Guid?welfareCentreId, Guid CustomerId)
        {
            var szServices = new DbHelperEfSql <tbPaymentPlan>();

            return(szServices.SearchBySingle(c => c.WelfareCentreID == welfareCentreId && c.CustomerId == CustomerId && c.IsValid == 1));
        }
Esempio n. 8
0
        /// <summary>
        /// 根据Id获取单条数据...
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public V_ConstructionProject_Dept GetObjectDeptById(int iId)
        {
            var service = new DbHelperEfSql <V_ConstructionProject_Dept>();

            return(service.SearchBySingle(c => c.ID == iId));
        }
Esempio n. 9
0
        public vCustomer GetVijObjectById(Guid welfareCentreId, string BEDNO)
        {
            var szServices = new DbHelperEfSql <vCustomer>();

            return(szServices.SearchBySingle(c => c.WelfareCentreID == welfareCentreId && c.BedNumber == BEDNO && c.IsValid == 1));
        }
Esempio n. 10
0
        public Users LoginUsers(string szUserName, string password)
        {
            var szServices = new DbHelperEfSql <Users>();

            return(szServices.SearchBySingle(c => (c.UserName == szUserName && c.Password == password && c.IsValid == 1)));
        }
Esempio n. 11
0
        public Users LoginUsers(Guid id, string password)
        {
            var szServices = new DbHelperEfSql <Users>();

            return(szServices.SearchBySingle(c => (c.UserID == id && c.Password == password && c.IsValid == 1)));
        }
Esempio n. 12
0
        public Users LoginHgUsers(string szUserName, string password)
        {
            var szServices = new DbHelperEfSql <Users>();

            return(szServices.SearchBySingle(c => (c.UserType == (int)EUserType.NursesAide || c.UserType == (int)EUserType.NursesAideBzz) && (c.UserName == szUserName && c.Password == password && c.IsValid == 1)));
        }
Esempio n. 13
0
        public bool IsAuthNodeByCondition(Guid iUserId, int iNodeId)
        {
            var szServices = new DbHelperEfSql <AuthNode>();

            return(szServices.SearchBySingle(c => c.UserID == iUserId && c.NodeId == iNodeId) != null);
        }
Esempio n. 14
0
        /// <summary>
        /// 根据Id获取单条数据
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        //public td_Service_1 GetObjectById(int iId)
        //{
        //    return dbContext.SearchBySingle(c => c.ID == iId);
        //}

        /// <summary>
        /// 根据Id获取单条数据(物理)
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public td_Service_1 GetObjectSer1ById(int iId)
        {
            var service = new DbHelperEfSql <td_Service_1>();

            return(service.SearchBySingle(c => c.ID == iId));
        }
Esempio n. 15
0
        public tbCustomer SearchByMaxAge()
        {
            var szSrevices = new DbHelperEfSql <tbCustomer>();

            return(szSrevices.SearchBySingle(c => c.IsValid == 1, false, c => c.CustomerAge));
        }
Esempio n. 16
0
        public vCustomer GetVObjectById(Guid Id)
        {
            var szServices = new DbHelperEfSql <vCustomer>();

            return(szServices.SearchBySingle(c => c.ID == Id));
        }
Esempio n. 17
0
        public Users GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <Users>();

            return(szServices.SearchBySingle(c => c.UserID == id));
        }
Esempio n. 18
0
        /// <summary>
        /// 根据Id获取单条数据
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public V_Network_Dept GetObjectDeptById(int iId)
        {
            var service = new DbHelperEfSql <V_Network_Dept>();

            return(service.SearchBySingle(c => c.ID == iId));
        }
Esempio n. 19
0
        public NodeButton GetObjectByCondition(int nodeId, int buttonId)
        {
            var szServices = new DbHelperEfSql <NodeButton>();

            return(szServices.SearchBySingle(c => c.NodeId == nodeId && c.ButtonId == buttonId));
        }
Esempio n. 20
0
        public Nodes GetObjectById(int id)
        {
            var szServices = new DbHelperEfSql <Nodes>();

            return(szServices.SearchBySingle(c => c.NodeId == id));
        }
Esempio n. 21
0
        public Nodes GetObjectByName(string name)
        {
            var szServices = new DbHelperEfSql <Nodes>();

            return(szServices.SearchBySingle(c => c.NodeName == name));
        }
Esempio n. 22
0
        public vPaymentPlan GetVObjectById(Guid Id)
        {
            var szServices = new DbHelperEfSql <vPaymentPlan>();

            return(szServices.SearchBySingle(c => c.ID == Id));
        }
Esempio n. 23
0
        public bool AddOrUpdae(Users item)
        {
            try
            {
                var isAdd = true;

                #region
                var query = _context.Set <Users>().FirstOrDefault(c => c.UserID == item.UserID);
                if (query == null)
                {
                    isAdd = true;
                    var model = new Users();
                    model.UserID          = item.UserID;
                    model.WelfareCentreID = item.WelfareCentreID;
                    model.Password        = item.Password;
                    model.OperateDate     = item.OperateDate;
                    model.UserCode        = item.UserCode;
                    model.UserName        = item.UserName;
                    model.RealName        = item.RealName;
                    model.DeptID          = item.DeptID;
                    model.RoleID          = item.RoleID;
                    model.Remark          = item.Remark;
                    model.UserType        = item.UserType;
                    model.IcCardNo        = item.IcCardNo;
                    model.CreateDate      = item.CreateDate;
                    model.IsValid         = item.IsValid;
                    _context.Set <Users>().Add(model);
                }
                else
                {
                    isAdd                 = false;
                    query.UserID          = item.UserID;
                    query.WelfareCentreID = item.WelfareCentreID;
                    if (item.Password != null && item.Password.Length > 0)
                    {
                        query.Password = item.Password;
                    }

                    query.OperateDate = item.OperateDate;
                    query.UserCode    = item.UserCode;
                    query.UserName    = item.UserName;
                    query.RealName    = item.RealName;
                    query.DeptID      = item.DeptID;
                    query.RoleID      = item.RoleID;
                    query.Remark      = item.Remark;
                    query.UserType    = item.UserType;
                    query.IcCardNo    = item.IcCardNo;
                }
                #endregion

                #region tbUserWelfareCentre
                if (item.UserType == (int)EUserType.YuanZhang)
                {
                    var welfareCentreDao  = new DbHelperEfSql <tbWelfareCentre>();
                    var welfareCentreItem = welfareCentreDao.SearchBySingle(c => c.ID == item.WelfareCentreID);

                    var query2 = _context.Set <tbUserWelfareCentre>().FirstOrDefault(c => c.WelfareCentreId == item.WelfareCentreID && c.UserName == item.UserName);
                    if (query2 == null)
                    {
                        var itemUserWelfareCentre = new tbUserWelfareCentre();
                        itemUserWelfareCentre.ID       = Guid.NewGuid();
                        itemUserWelfareCentre.UserName = item.UserName;
                        if (item.Password != null && item.Password.Length > 0)
                        {
                            itemUserWelfareCentre.UserPassword = item.Password;
                        }
                        itemUserWelfareCentre.WebServiesUrl     = Config.YuanZhan_URL;
                        itemUserWelfareCentre.IsUpdate          = 1;
                        itemUserWelfareCentre.WelfareCentreId   = item.WelfareCentreID;
                        itemUserWelfareCentre.WelfareCentreName = welfareCentreItem.WelfareCentreName;
                        itemUserWelfareCentre.IsValid           = 1;
                        itemUserWelfareCentre.CreateDate        = DateTime.Now;
                        itemUserWelfareCentre.Remark            = "";
                        _context.Set <tbUserWelfareCentre>().Add(itemUserWelfareCentre);
                    }
                    else
                    {
                        query2.UserName = item.UserName;
                        if (item.Password != null && item.Password.Length > 0)
                        {
                            query2.UserPassword = item.Password;
                        }
                        query2.WebServiesUrl     = Config.YuanZhan_URL;
                        query2.IsUpdate          = 1;
                        query2.WelfareCentreId   = item.WelfareCentreID;
                        query2.WelfareCentreName = welfareCentreItem.WelfareCentreName;
                        query2.IsValid           = 1;
                        query2.CreateDate        = DateTime.Now;
                        query2.Remark            = "";
                    }
                }

                #endregion

                _context.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                MessageLog.WriteLog(new LogParameterModel()
                {
                    ClassName        = this.GetType().ToString(),
                    MethodName       = "AddOrUpdaeUsers",
                    MethodParameters = "添加失败",
                    LogLevel         = ELogLevel.Warn,
                    Message          = ex.Message
                });
                return(false);
            }
        }
Esempio n. 24
0
        public AuthNodeButton GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <AuthNodeButton>();

            return(szServices.SearchBySingle(c => c.AuthNodeButtonID == id));
        }
Esempio n. 25
0
        public tbOrgTLJGCongYe GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <tbOrgTLJGCongYe>();

            return(szServices.SearchBySingle(c => c.ID == id));
        }
Esempio n. 26
0
        public tbOrganization SearchItemByNew(Guid?iWelfareId)
        {
            var szServices = new DbHelperEfSql <tbOrganization>();

            return(szServices.SearchBySingle(c => c.IsValid == 1 && c.WelfareId == iWelfareId, true, c => c.OperateDate));
        }
Esempio n. 27
0
        public tbOrgTLJGCongYe GetObjectByWelfareId(Guid welfareId)
        {
            var szServices = new DbHelperEfSql <tbOrgTLJGCongYe>();

            return(szServices.SearchBySingle(c => c.WelfareId == welfareId));
        }
Esempio n. 28
0
        public tbOrganization GetObjectByWelfareId(Guid?welfareId)
        {
            var szServices = new DbHelperEfSql <tbOrganization>();

            return(szServices.SearchBySingle(c => c.WelfareId == welfareId && c.IsValid == 1));
        }
Esempio n. 29
0
        public Depts GetObjectById(Guid id)
        {
            var szServices = new DbHelperEfSql <Depts>();

            return(szServices.SearchBySingle(c => c.DeptID == id));
        }