Esempio n. 1
0
        public bool AddOrUpdate2(td_Service_2 entity)
        {
            var service = new DbHelperEfSql <td_Service_2>();

            if (entity.ID < 1)
            {
                service.Add(entity);
            }
            return(service.Update(entity, c => c.ID == entity.ID));
        }
Esempio n. 2
0
        public bool AddOrUpdate(AuthNodeButton item)
        {
            var szServices = new DbHelperEfSql <AuthNodeButton>();

            if (item.AuthNodeButtonID == Guid.Empty)
            {
                item.AuthNodeButtonID = Guid.NewGuid();
                return(szServices.Add(item));
            }
            else
            {
                return(szServices.Update(item, c => c.AuthNodeButtonID == item.AuthNodeButtonID));
            }
        }
Esempio n. 3
0
        public Boolean AddOrUpdate(Roles item)
        {
            var szServices = new DbHelperEfSql <Roles>();

            if (item.RoleID == Guid.Empty)
            {
                item.RoleID = Guid.NewGuid();
                return(szServices.Add(item));
            }
            else
            {
                return(szServices.Update(item, c => c.RoleID == item.RoleID));
            }
        }
Esempio n. 4
0
        public bool AddOrUpdate(Depts item)
        {
            var szServices = new DbHelperEfSql <Depts>();

            if (item.DeptID == Guid.Empty)
            {
                item.DeptID = Guid.NewGuid();
                return(szServices.Add(item));
            }
            else
            {
                return(szServices.Update(item, c => c.DeptID == item.DeptID));
            }
        }
Esempio n. 5
0
        public bool AddOrUpdate(Users item, bool isAdd)
        {
            var szServices = new DbHelperEfSql <Users>();

            if (isAdd)
            {
                var isFlag = szServices.Add(item);
                return(isFlag);
            }
            else
            {
                var isFlag = szServices.Update(item, c => c.UserID == item.UserID);
                return(isFlag);
            }
        }
Esempio n. 6
0
        public bool AddOrUpdate(tbOrganization item, bool isAdd)
        {
            var szServices = new DbHelperEfSql <tbOrganization>();

            return(isAdd ? szServices.Add(item) : szServices.Update(item, c => c.ID == item.ID));
        }
Esempio n. 7
0
        public bool AddOrUpdate(Vm item, bool IsAdd)
        {
            var szServices = new DbHelperEfSql <Vm>();

            return(IsAdd ? szServices.Add(item) : szServices.Update(item, c => c.Id == item.Id));
        }
Esempio n. 8
0
        public bool Add(Attachments item)
        {
            var szServices = new DbHelperEfSql <Attachments>();

            return(szServices.Add(item));
        }
Esempio n. 9
0
        public bool AddLog4net(bool IsAdd, Log4net item)
        {
            var szServices = new DbHelperEfSql <Log4net>();

            return(IsAdd ? szServices.Add(item) : szServices.Update(item, c => c.LogID == item.LogID));
        }
Esempio n. 10
0
        /// <summary>
        /// 护工护理内容
        /// </summary>
        /// <param name="welfareCentreId">养老院ID</param>
        /// <param name="HgID">护工ID</param>
        /// <param name="CustomerID">老人ID</param>
        /// <param name="list">护理内容</param>
        /// <param name="listExt">护理内容</param>
        /// <returns></returns>
        public bool AddAll(Guid welfareCentreId, Guid HgID, Guid CustomerID, IList <tbNursingPer> list, IList <tbNursingPerExt> listExt)
        {
            if (list == null || list.Count <= 0)
            {
                return(false);
            }
            var  szNmDao          = new DbHelperEfSql <tbNursingMessage>();
            var  nowTime          = DateTime.Now;
            Guid NursingMessageId = Guid.Empty;//操作记录

            NursingMessageId = Guid.NewGuid();

            var szServices = new DbHelperEfSql <tbNursingPer>();
            var resultList = new List <tbNursingPer>();

            //tbNursingPer
            foreach (var item in list)
            {
                int resultId = 0;
                DoExtByWhole(welfareCentreId, item.NursingRankID, ref resultId);//处理list中NursingRankTopID值
                item.NursingRankTopID = resultId;
                item.NursingMessageID = NursingMessageId;
                resultList.Add(item);
            }
            bool isFlagA = szServices.AddAll(resultList);

            //tbNursingPerExt
            var szServiceExt  = new DbHelperEfSql <tbNursingPerExt>();
            var resultExtList = new List <tbNursingPerExt>();

            foreach (var itemExt in listExt)
            {
                int resultId = 0;
                DoExtByWhole(welfareCentreId, itemExt.NursingRankID, ref resultId);//处理listExt中NursingRankTopID值
                itemExt.NursingRankTopID = resultId;
                itemExt.NursingMessageID = NursingMessageId;
                resultExtList.Add(itemExt);
            }
            bool isFlagB = szServiceExt.AddAll(resultExtList);

            //tbNursingPerLedger
            var szServiceLedger = new DbHelperEfSql <tbNursingPerLedger>();
            var itemLedger      = new tbNursingPerLedger();

            itemLedger.ID               = Guid.NewGuid();
            itemLedger.CustomerID       = list[0].CustomerID;
            itemLedger.HgID             = list[0].HgID;
            itemLedger.OperatorUserID   = itemLedger.HgID;
            itemLedger.PaymentPlanId    = list[0].NursingMessageID;
            itemLedger.NursingTimeStart = list[0].NursingTime;
            itemLedger.NursingTimeEnd   = list[0].NursingTime;
            string content = "";

            DoNurseByWhole(welfareCentreId, list[0].CustomerID ?? Guid.Empty, list[0].HgID ?? Guid.Empty, list[0].NursingMessageID ?? Guid.Empty, ref content);   //护理NursingMessageID不变,导致数据重复问题 (2019-6-11)
            itemLedger.NursingContent  = content;
            itemLedger.IsValid         = 1;
            itemLedger.Remark          = "";
            itemLedger.LedgerType      = 1;
            itemLedger.CreateDate      = list[0].CreateDate;
            itemLedger.OperateDate     = list[0].OperateDate;
            itemLedger.WelfareCentreID = welfareCentreId;
            bool isFlagC = szServiceLedger.Add(itemLedger);

            return(isFlagA && isFlagB && isFlagC);
        }
Esempio n. 11
0
        public bool AddOrUpdate(bool IsAdd, tbCustomer item)
        {
            var szServices = new DbHelperEfSql <tbCustomer>();

            return(IsAdd ? szServices.Add(item) : szServices.Update(item, c => c.ID == item.ID));
        }
Esempio n. 12
0
        public bool AddOrUpdate(Nodes item, bool isAdd)
        {
            var szServices = new DbHelperEfSql <Nodes>();

            return(isAdd ? szServices.Add(item) : szServices.Update(item, c => c.NodeId == item.NodeId));
        }
Esempio n. 13
0
        public bool AddOrUpdate(NodeButton item)
        {
            var szServices = new DbHelperEfSql <NodeButton>();

            return(item.NodeButtonId <= 0 ? szServices.Add(item) : szServices.Update(item, c => c.NodeButtonId == item.NodeButtonId));
        }
Esempio n. 14
0
        public bool AddOrUpdate(Roles item, bool isAdd)
        {
            var szServices = new DbHelperEfSql <Roles>();

            return(isAdd = true ? szServices.Add(item) : szServices.Update(item, c => c.RoleID == item.RoleID));
        }
Esempio n. 15
0
        public bool AddOrUpdate(Depts item, bool isAdd)
        {
            var szServices = new DbHelperEfSql <Depts>();

            return(isAdd = true ? szServices.Add(item) : szServices.Update(item, c => c.DeptID == item.DeptID));
        }