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("برجاء ادخال بيانات صحيحه اولا"); } }
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); }
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) { }
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)); }
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()); }
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); }
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)); }
public ActionResult DeleteConfirmed(int id) { VisitType visitType = db.VisitTypes.Find(id); db.VisitTypes.Remove(visitType); db.SaveChanges(); return(RedirectToAction("Index")); }
public void DeleteVisitType(VisitType visitType) { if (visitType == null) { throw new ArgumentNullException(nameof(VisitType)); } _context.VisitTypes.Remove(visitType); }
public ActionResult CreateVisitType(VisitType creating) { if (!Service.CreateVisitType(creating)) { return(View()); } return(RedirectToAction("visitType"));//redirect to equipment list }
public VisitType CreateVisitType(string name) { var visitType = new VisitType { Name = name }; return(visitType); }
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); }
public ActionResult EditVisitType(VisitType editing) { if (!Service.EditVisitType(editing)) { return(View()); } return(RedirectToAction("VisitType"));//redirect to equipment list }
public async Task AddVisitType(VisitType visitType) { if (visitType == null) { throw new ArgumentNullException(nameof(VisitType)); } await _context.VisitTypes.AddAsync(visitType); }
public IEnumerator <TElem> GetEnumerator(VisitType visitType, int depth) { if (visitType == VisitType.BreadthFirst) { return(new TreeNodeElementBFEnumerator <TElem>(this, depth)); } return(new TreeNodeElementDFSEnumerator <TElem>(this, depth)); }
public IEnumerable <ITreeNode <TElem> > GetAllNodes(VisitType visitType) { if (visitType == VisitType.BreadthFirst) { return(GetAllNodes(new TreeNodeBFEnumerator <TElem>(this))); } return(GetAllNodes(new TreeNodeDFEnumerator <TElem>(this))); }
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)); }
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)); }
private bool ValidateVisitType(VisitType validating) { if (String.IsNullOrWhiteSpace(validating.Title)) { Validator.AddError("Title", "You must enter a title"); } return(Validator.IsValid); }
public ActionResult Create([Bind(Include = "VisitTypeID,Type")] VisitType visitType) { if (ModelState.IsValid) { db.VisitTypes.Add(visitType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(visitType)); }
public bool EditVisitType(VisitType editing) { if (ValidateVisitType(editing)) { return(Repository.EditVisitType(editing)); } else { return(false); } }
public bool CreateVisitType(VisitType creating) { if (ValidateVisitType(creating)) { return(Repository.CreateVisitType(creating)); } else { return(false); } }
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)); }
public async Task <IActionResult> Create(VisitType visitType2) { if (ModelState.IsValid) { _context.Add(visitType2); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(visitType2)); }
public void UpdateEncounterDate(Guid id, DateTime encounterDate, VisitType visitType) { var encounter = Get(id); if (null != encounter) { encounter.EncounterDate = encounterDate; encounter.VisitType = visitType; } Update(encounter); }
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; }
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); }