Пример #1
0
        public bool UpdateSubjective(List <Comm_ResidentFile_Followup_Surgery> subjectiveList, string resident_id)
        {
            int count = CurrentDal.LoadEntities(t => t.resident_id == resident_id).Count();

            if (count > 0)
            {
                CurrentDal.DeleteByLambda(t => t.resident_id == resident_id);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            if (subjectiveList.Count() != 0)
            {
                CurrentDal.AddAllEntity(subjectiveList);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            return(true);
        }
        public bool UpdateSubjective(List <Chronic_disease_Comm_HumorAdd> subjectiveList, string id)
        {
            int count = CurrentDal.LoadEntities(t => t.humor_id == id).Count();

            if (count > 0)
            {
                CurrentDal.DeleteByLambda(t => t.humor_id == id);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            if (subjectiveList.Count() != 0)
            {
                CurrentDal.AddAllEntity(subjectiveList);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #3
0
        public bool UpdateSubjective(List <Chronic_disease_Diabetes_family_relation> subjectiveList, string relation_id)
        {
            int count = CurrentDal.LoadEntities(t => t.relation_id == relation_id).Count();

            if (count > 0)
            {
                CurrentDal.DeleteByLambda(t => t.relation_id == relation_id);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            if (subjectiveList.Count() != 0)
            {
                CurrentDal.AddAllEntity(subjectiveList);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #4
0
        public bool UpdateSubjective(List <Chronic_disease_Hospitalization_DischargeAbstract_Advice> subjectiveList, string id)
        {
            int count = CurrentDal.LoadEntities(t => t.advice_id == id).Count();

            if (count > 0)
            {
                CurrentDal.DeleteByLambda(t => t.advice_id == id);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            if (subjectiveList.Count() != 0)
            {
                CurrentDal.AddAllEntity(subjectiveList);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #5
0
        public bool UpdateSubjective(List <Chronic_disease_Outpatient_AccessoryExamination> subjectiveList, string id)
        {
            int count = CurrentDal.LoadEntities(t => t.contact_id == id).Count();

            if (count > 0)
            {
                CurrentDal.DeleteByLambda(t => t.contact_id == id);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            if (subjectiveList.Count() != 0)
            {
                CurrentDal.AddAllEntity(subjectiveList);
                if (!(Db.SaveChanges() > 0))
                {
                    return(false);
                }
            }
            return(true);
        }