Пример #1
0
 private void btn_Save_Click(object sender, EventArgs e)
 {
     if (ValidateUI())
     {
         if (Mode == "Add")
         {
             VisitType _bdvisitType = new VisitType();
             _bdvisitType.VisitTypeName = tbx_VisitName.Text.ToString();
             string _message = _bdvisitType.addBDVisitType(_bdvisitType);
             FillVisitTypeCombo();
             MessageBox.Show(_message);
         }
         else if (Mode == "Edit")
         {
             _SelectedVisitType.VisitTypeName = tbx_VisitName.Text.ToString();
             string _message = visitType.addBDVisitType(_SelectedVisitType);
             FillVisitTypeCombo();
             MessageBox.Show(_message);
         }
         ControlUI("Select");
         Mode = "Select";
     }
     else
     {
         MessageBox.Show("برجاء ادخال بيانات صحيحه اولا");
     }
 }
Пример #2
0
            protected override Expression VisitMemberInit(MemberInitExpression memberInitExp)
            {
                flags = VisitType.MemberInit;
                var count = memberInitExp.Bindings.Count;

                for (var i = 0; i < count; i++)
                {
                    var pro = memberInitExp.Bindings[i].Member as PropertyInfo;
                    if (pro == null)
                    {
                        continue;
                    }

                    properties.Add(pro);

                    switch (memberInitExp.Bindings[i].BindingType)
                    {
                    case MemberBindingType.Assignment:
                        var assign = memberInitExp.Bindings[i] as MemberAssignment;
                        if (assign != null && CheckArgumentExpression(assign.Expression))
                        {
                            Visit(assign.Expression);
                        }

                        break;
                    }
                }

                Visit(memberInitExp.NewExpression);
                return(memberInitExp);
            }
Пример #3
0
 private Encounter(Guid clientId, Guid formId, Guid encounterTypeId, DateTime encounterDate, Guid providerId,
                   Guid deviceId, Guid practiceId, DateTime?started, DateTime?stopped, Guid userId, bool isComplete,
                   Guid?indexClientId, VisitType visitType)
     : this(LiveGuid.NewGuid(), clientId, formId, encounterTypeId, encounterDate, providerId, deviceId,
            practiceId, started, stopped, userId, isComplete, indexClientId, visitType)
 {
 }
Пример #4
0
        public async Task <ActionResult <VisitTypeDto> > AddVisitType([FromBody] VisitTypeForCreationDto visitTypeForCreation)
        {
            var validationResults = new VisitTypeForCreationDtoValidator().Validate(visitTypeForCreation);

            validationResults.AddToModelState(ModelState, null);

            if (!ModelState.IsValid)
            {
                return(BadRequest(new ValidationProblemDetails(ModelState)));
                //return ValidationProblem();
            }

            var visitType = _mapper.Map <VisitType>(visitTypeForCreation);
            await _visitTypeRepository.AddVisitType(visitType);

            var saveSuccessful = await _visitTypeRepository.SaveAsync();

            if (saveSuccessful)
            {
                VisitType visitTypeFromRepo = await _visitTypeRepository.GetVisitTypeAsync(visitType.Id);

                var visitTypeDto = _mapper.Map <VisitTypeDto>(visitTypeFromRepo);
                var response     = new Response <VisitTypeDto>(visitTypeDto);

                return(CreatedAtRoute("GetVisitType",
                                      new { visitTypeDto.Id },
                                      response));
            }

            return(StatusCode(500));
        }
Пример #5
0
        public void AddMethod(string methodName, Type returnType, VisitType visitType, Type[] paramTypes, string body, params AdditionType[] additionTypes)
        {
            var builder = new StringBuilder();

            builder.Append(GetVisitCode(visitType));
            foreach (var additionType in additionTypes)
            {
                builder.Append(" ").Append(GetAdditionType(additionType));
            }
            builder.Append(" ").Append(returnType.Equals(typeof(void)) ? "void" : returnType.FullName).Append(" ").Append(methodName);
            builder.Append("(");
            if (paramTypes != null)
            {
                for (var i = 0; i < paramTypes.Length; i++)
                {
                    var paramType = paramTypes[i];
                    if (i > 0)
                    {
                        builder.Append(",");
                    }
                    builder.Append(paramType.FullName).Append(" ").Append("arg" + i);
                }
            }
            builder.Append(")");
            builder.Append("{").Append(body).Append("}");
            this.Methods.Add(builder.ToString());
        }
        private CustomItem SetVisitType(VisitType visitType)
        {
            var vtype = (int)visitType;
            var v     = VisitTypes.FirstOrDefault(x => x.Value == vtype.ToString());

            return(v ?? VisitTypes.First());
        }
Пример #7
0
        public void CopyTo(TElem[] array, int arrayIndex, VisitType visitType)
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array));
            }

            if (arrayIndex < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(arrayIndex));
            }

            var items = GetAllNodes(visitType).ToArray();

            if (items.Length > array.Length - arrayIndex)
            {
                throw new ArgumentException(
                          $"The number of elements in this ICollection is greater than the available space from {arrayIndex} to the end of the destination array.");
            }

            Array.Copy(sourceArray: items,
                       sourceIndex: 0,
                       destinationArray: array,
                       destinationIndex: arrayIndex,
                       length: items.Length);
        }
Пример #8
0
        public async Task <IActionResult> Edit(int id, [Bind("visitTypeId,visitType")] VisitType visitType1)
        {
            if (id != visitType1.visitTypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(visitType1);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VisitTypeExists(visitType1.visitTypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(visitType1));
        }
Пример #9
0
        public ActionResult DeleteConfirmed(int id)
        {
            VisitType visitType = db.VisitTypes.Find(id);

            db.VisitTypes.Remove(visitType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #10
0
        public void DeleteVisitType(VisitType visitType)
        {
            if (visitType == null)
            {
                throw new ArgumentNullException(nameof(VisitType));
            }

            _context.VisitTypes.Remove(visitType);
        }
Пример #11
0
        public ActionResult CreateVisitType(VisitType creating)
        {
            if (!Service.CreateVisitType(creating))
            {
                return(View());
            }

            return(RedirectToAction("visitType"));//redirect to equipment list
        }
Пример #12
0
        public VisitType CreateVisitType(string name)
        {
            var visitType = new VisitType
            {
                Name = name
            };

            return(visitType);
        }
Пример #13
0
        public bool Remove(TElem item, VisitType visitType)
        {
            if (visitType == VisitType.BreadthFirst)
            {
                return(Remove(item, new TreeNodeBFEnumerator <TElem>(this)));
            }

            return(Remove(item, new TreeNodeDFEnumerator <TElem>(this)));
        }
        private void AssociateQueryWithQuestion(Query query, int patientNumber, VisitType visitType, FormType formType,
                                                Func <int, Question> questionFinder)
        {
            var patient = Patients.First(p => p.PatientNumber == patientNumber);
            var visit   = patient.Visits.First(v => v.VisitType == visitType);
            var form    = visit.Forms.First(f => f.FormType == formType);

            query.Question = questionFinder(form.Id);
        }
Пример #15
0
        public ActionResult EditVisitType(VisitType editing)
        {
            if (!Service.EditVisitType(editing))
            {
                return(View());
            }

            return(RedirectToAction("VisitType"));//redirect to equipment list
        }
Пример #16
0
        public async Task AddVisitType(VisitType visitType)
        {
            if (visitType == null)
            {
                throw new ArgumentNullException(nameof(VisitType));
            }

            await _context.VisitTypes.AddAsync(visitType);
        }
Пример #17
0
        public IEnumerator <TElem> GetEnumerator(VisitType visitType, int depth)
        {
            if (visitType == VisitType.BreadthFirst)
            {
                return(new TreeNodeElementBFEnumerator <TElem>(this, depth));
            }

            return(new TreeNodeElementDFSEnumerator <TElem>(this, depth));
        }
Пример #18
0
        public IEnumerable <ITreeNode <TElem> > GetAllNodes(VisitType visitType)
        {
            if (visitType == VisitType.BreadthFirst)
            {
                return(GetAllNodes(new TreeNodeBFEnumerator <TElem>(this)));
            }

            return(GetAllNodes(new TreeNodeDFEnumerator <TElem>(this)));
        }
Пример #19
0
 public ActionResult Edit([Bind(Include = "ID,Name,Description,SelfRegistration,Duration")] VisitType visitType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(visitType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(visitType));
 }
Пример #20
0
 public ActionResult Edit([Bind(Include = "VisitTypeID,Type")] VisitType visitType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(visitType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(visitType));
 }
Пример #21
0
        private bool ValidateVisitType(VisitType validating)
        {
            if (String.IsNullOrWhiteSpace(validating.Title))
            {
                Validator.AddError("Title", "You must enter a title");
            }


            return(Validator.IsValid);
        }
Пример #22
0
        public ActionResult Create([Bind(Include = "VisitTypeID,Type")] VisitType visitType)
        {
            if (ModelState.IsValid)
            {
                db.VisitTypes.Add(visitType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(visitType));
        }
Пример #23
0
 public bool EditVisitType(VisitType editing)
 {
     if (ValidateVisitType(editing))
     {
         return(Repository.EditVisitType(editing));
     }
     else
     {
         return(false);
     }
 }
Пример #24
0
 public bool CreateVisitType(VisitType creating)
 {
     if (ValidateVisitType(creating))
     {
         return(Repository.CreateVisitType(creating));
     }
     else
     {
         return(false);
     }
 }
Пример #25
0
        public ActionResult Create([Bind(Include = "ID,Name,Description,SelfRegistration,Duration")] VisitType visitType)
        {
            if (ModelState.IsValid)
            {
                db.VisitTypes.Add(visitType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(visitType));
        }
Пример #26
0
        public async Task <IActionResult> Create(VisitType visitType2)
        {
            if (ModelState.IsValid)
            {
                _context.Add(visitType2);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(visitType2));
        }
Пример #27
0
        public void UpdateEncounterDate(Guid id, DateTime encounterDate, VisitType visitType)
        {
            var encounter = Get(id);

            if (null != encounter)
            {
                encounter.EncounterDate = encounterDate;
                encounter.VisitType     = visitType;
            }
            Update(encounter);
        }
Пример #28
0
        public async Task VisitAsync(VisitType visitType)
        {
            if (visitType != VisitType.Eager)
            {
                return;
            }

            foreach (var migrator in _migrators)
            {
                await migrator.UpAsync();
            }
        }
        private void Fillcbx_VisitType()
        {
            VisitType _visitType = new VisitType();

            _AllVisits = _visitType.GetVisitsWithPrics(DateTime.Now.Date);
            cbx_VisitType.DataSource    = null;
            cbx_VisitType.DataSource    = _AllVisits;
            cbx_VisitType.DisplayMember = "VisitTypeName";
            cbx_VisitType.ValueMember   = "VisitTypeID";
            cbx_VisitType.SelectedIndex = -1;
            PhysicianPrice = 0;
            VisitPrice     = 0;
        }
Пример #30
0
        public static List <VisitTypeBL> GetAll()
        {
            List <VisitTypeBL> res = new List <VisitTypeBL>();

            List <VisitType> all = VisitType.GetAll();

            if ((all == null) || (all.Count <= 0))
            {
                return(res);
            }

            return(Translate(all));
        }
        private void AssociateQueryWithQuestion(Query query, int patientNumber, VisitType visitType, FormType formType,
		                                        Func<int, Question> questionFinder)
        {
            var patient = Patients.First(p => p.PatientNumber == patientNumber);
            var visit = patient.Visits.First(v => v.VisitType == visitType);
            var form = visit.Forms.First(f => f.FormType == formType);
            query.Question = questionFinder(form.Id);
        }