Esempio n. 1
0
        public bool UpdateDoctorClinicWorkPlan(CommContracts.DoctorClinicWorkPlan DoctorClinicWorkPlan)
        {
            using (DAL.HisContext ctx = new DAL.HisContext())
            {
                var temp = ctx.DoctorClinicWorkPlans.FirstOrDefault(m => m.ID == DoctorClinicWorkPlan.ID);
                if (temp != null)
                {
                    temp.LevelTwoDepartmentID = DoctorClinicWorkPlan.LevelTwoDepartmentID;
                    temp.Doctor     = DoctorClinicWorkPlan.Doctor;
                    temp.SourceType = DoctorClinicWorkPlan.SourceType;
                    temp.TimeBucket = DoctorClinicWorkPlan.TimeBucket;
                    temp.Fee        = DoctorClinicWorkPlan.Fee;
                    temp.MaxNum     = DoctorClinicWorkPlan.MaxNum;
                    temp.Zhou       = DoctorClinicWorkPlan.Zhou;
                }
                else
                {
                    return(false);
                }

                try
                {
                    ctx.SaveChanges();
                }
#pragma warning disable CS0168 // 声明了变量“ex”,但从未使用过
                catch (Exception ex)
#pragma warning restore CS0168 // 声明了变量“ex”,但从未使用过
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 2
0
        public bool SaveDoctorClinicWorkPlan(CommContracts.DoctorClinicWorkPlan DoctorClinicWorkPlan)
        {
            using (DAL.HisContext ctx = new DAL.HisContext())
            {
                var config = new MapperConfiguration(cfg =>
                {
                    cfg.CreateMap <CommContracts.DoctorClinicWorkPlan, DAL.DoctorClinicWorkPlan>();
                });
                var mapper = config.CreateMapper();

                DAL.DoctorClinicWorkPlan temp = new DAL.DoctorClinicWorkPlan();
                temp = mapper.Map <DAL.DoctorClinicWorkPlan>(DoctorClinicWorkPlan);

                ctx.DoctorClinicWorkPlans.Add(temp);
                try
                {
                    ctx.SaveChanges();
                }
#pragma warning disable CS0168 // 声明了变量“ex”,但从未使用过
                catch (Exception ex)
#pragma warning restore CS0168 // 声明了变量“ex”,但从未使用过
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 3
0
 public bool SaveDoctorClinicWorkPlan(CommContracts.DoctorClinicWorkPlan DoctorClinicWorkPlan)
 {
     return(client.SaveDoctorClinicWorkPlan(DoctorClinicWorkPlan));
 }