private void SaveC(object obj)
        {
            var procedure = new DentalProcedure
            {
                Date       = this.date,
                Diagnosis  = this.diagnosis,
                Note       = this.note,
                PatientId  = this.patientId,
                Tooth      = this.tooth,
                ActivityId = this.selectedActivityId,
                MDTId      = this.selectedMdtId,
                DoctorId   = this.selectedDoctorId,
                Id         = this.id,
                PaidValue  = this.paidValue
            };

            if (this.selectedMdtId > 0)
            {
                procedure.MDTId = this.selectedMdtId;
            }
            else
            {
                procedure.MDTId = null;
            }

            this.dentalProceduresService.Update(procedure);
        }
Beispiel #2
0
        public void Update(DentalProcedure model)
        {
            var procedure = this.context.DentalProcedures.Find(model.Id);

            procedure.ActivityId = model.ActivityId;
            procedure.Date       = model.Date;
            procedure.Diagnosis  = model.Diagnosis;
            procedure.DoctorId   = model.DoctorId;
            procedure.MDTId      = model.MDTId;
            procedure.Note       = model.Note;
            procedure.Tooth      = model.Tooth;
            procedure.MDTId      = model.MDTId;
            procedure.PaidValue  = model.PaidValue;

            this.context.SaveChanges();
        }
Beispiel #3
0
 public void Add(DentalProcedure model)
 {
     this.context.DentalProcedures.Add(model);
     this.context.SaveChanges();
 }