public new ActionResult Profile(int id, int arg) { int gender; PersonDAL person = new PersonDAL(id); if (person.Persons.Gender == "Male") { gender = 1; } else { gender = 2; } PersonViewModel personViewModel = new PersonViewModel(person); FeedCombobox(gender); //arg//, 1 profile opened from user so show EDIT botton, 2: profile opened from admin page so hide EDIT button, if (arg == 1) { ViewData["ShowEditBtn"] = true; } else { ViewData["ShowEditBtn"] = false; } return(View(personViewModel)); }
public ResultBM UpdatePerson(PersonBM personBm) { try { AddressBLL addressBll = new AddressBLL(); ResultBM addressResult; PersonDAL personDal = new PersonDAL(); PersonDTO personDto; ResultBM validationResult; validationResult = IsValid(personBm); if (!validationResult.IsValid()) { return(validationResult); } addressResult = addressBll.UpdateAddress(personBm.address); if (!addressResult.IsValid()) { return(addressResult); } personDto = new PersonDTO(personBm.id, personBm.name, personBm.lastName, personBm.Birthdate, personBm.Email, personBm.phone, personBm.gender, personBm.dni, personBm.address.id); personDal.UpdatePerson(personDto); return(new ResultBM(ResultBM.Type.OK, "Se ha actualizado la persona con el nombre " + personBm.name + " " + personBm.lastName + ".", personBm)); } catch (Exception exception) { return(new ResultBM(ResultBM.Type.EXCEPTION, SessionHelper.GetTranslation("UPDATING_ERROR") + " " + exception.Message, exception)); } }
private void BindPersonList() { PersonCollection personList = new PersonCollection(); personList = PersonDAL.GetCollection(); rptPersonList.DataSource = personList; rptPersonList.DataBind(); }
public PersonControllerV1(LeaderboardContext context) { this.context = context; this.context.ChangeTracker.QueryTrackingBehavior = Microsoft.EntityFrameworkCore.QueryTrackingBehavior.NoTracking; personDAL = new PersonDAL(context); }
static void Main(string[] args) { var client = ConfigurationManagerNeo4J.GetDefaultClient(); PersonDAL personDAL = new PersonDAL(); User user1 = new User(); user1.Login = "******"; User user2 = new User(); user2.Login = "******"; int count = personDAL.GetShortestPath(user1.Login, user2.Login); Console.WriteLine(count); //personDAL.CreatePerson(user); //personDAL.UpdatePerson(user, "ostap"); //personDAL.DeletePerson(user); //personDAL.CreateRelationships(user2, user1); //personDAL.DeleteRelationships(user2, user1); var people = personDAL.GetWhoCommon(user1.Login, user2.Login, count); //var people = client.Cypher.Match("(p:Person)").Return(p => p.As<User>()).Results; foreach (var p in people) { Console.WriteLine(p.Login + "\n"); } Console.ReadKey(); }
public Person GetPerson(int personID) { using (PersonDAL pDAL = new PersonDAL()) { return(pDAL.GetPerson(personID)); } }
private void BindPerson() { int personId = Request.QueryString["PersonId"].ToInt(); if (personId > 0) { Person personLookup = PersonDAL.GetItem(personId); if (personLookup != null) { lblPersonId.Text = personLookup.PersonId.ToString(); lblFirstName.Text = personLookup.FirstName; lblLastName.Text = personLookup.LastName; lblDisplayFirstName.Text = personLookup.DisplayFirstName; lblGender.Text = personLookup.Gender; } else { lblMessage.Text = "Person could not be found."; } } else { lblMessage.Text = "Invalid ID. Person record could not be found."; } }
public void save(PersonBO bo) { bo.Tax = CalculateTax(bo.Salary); PersonDAL pdl = new PersonDAL(); pdl.Save(bo); }
public void UpdatePerson(Person person) { Validate(person); // TODO: Call UpdatePerson from Service -> SavePerson() PersonDAL.UpdatePerson(person); }
public static List <PersonViewModel> GetPersonList(int Country, int Ages, string Education, int Nationality, string Gender) { List <PersonViewModel> List = new List <PersonViewModel>(); PersonDAL.GetPersonsList(Country, Ages, Education, Nationality, Gender).ForEach(r => List.Add(new PersonViewModel(r))); return(List); }
public static List <PersonViewModel> GetPersonList() { List <PersonViewModel> List = new List <PersonViewModel>(); PersonDAL.GetPersonsList().ForEach(r => List.Add(new PersonViewModel(r))); return(List); }
/// <see cref="PersonDAL.GetPersonByClinicalAdministratorID(Clinical_Administrator)"/> public Person GetPersonByClinicalAdministratorID(Clinical_Administrator admin) { if (admin == null || admin.ID == null) { throw new ArgumentNullException("admin and its id cannot be null"); } return(PersonDAL.GetPersonByClinicalAdministratorID(admin)); }
/// <see cref="PersonDAL.GetPersonByPatientID(Patient)"/> public Person GetPersonByPatientID(Patient patient) { if (patient == null || patient.ID == null) { throw new ArgumentNullException("patient and its id cannot be null"); } return(PersonDAL.GetPersonByPatientID(patient)); }
/// <see cref="PersonDAL.GetPersonByDoctorID(Doctor)"/> public Person GetPersonByDoctorID(Doctor doctor) { if (doctor == null || doctor.ID == null) { throw new ArgumentNullException("doctor and its id cannot be null"); } return(PersonDAL.GetPersonByDoctorID(doctor)); }
/// <see cref="PersonDAL.GetPersonByNurseID(Nurse)"/> public Person GetPersonByNurseID(Nurse nurse) { if (nurse == null || nurse.ID == null) { throw new ArgumentNullException("nurse and its id cannot be null"); } return(PersonDAL.GetPersonByNurseID(nurse)); }
/// <summary> /// GetPerson By User Id /// </summary> /// <param name="userId"></param> /// <returns></returns> public static PersonViewModel GetPersonByUser(int userId) { PersonDAL P = PersonDAL.GetPersonByUser(userId); PersonViewModel Person = new PersonViewModel(P); return(Person); }
/// <see cref="PersonDAL.GetPersonOfNurseByVisit(Visit)"/> public Person GetNurseByVisitID(Visit visit) { if (visit == null || visit.ID == null) { throw new ArgumentNullException("visit and its id cannot be null"); } return(PersonDAL.GetPersonOfNurseByVisit(visit)); }
public static int Save(Person personToSave) { int returnValue; returnValue = PersonDAL.Save(personToSave); return(returnValue); }
public int SavePerson(PersonModel person) { int personId = 0; PersonDAL dal = new PersonDAL(); personId = dal.SavePerson(person); return(personId); }
public PersonModel GetPersonDetail(int id) { PersonModel p = null; PersonDAL dal = new PersonDAL(); DataSet ds = dal.getPersonDetail(id); p = ConvertDsintoObject(ds); return(p); }
public DataSet Find_Emp(String str) { PersonDAL PFDAL = new PersonDAL(); DataSet data = null; data = PFDAL.Find_Emp(str); return(data); }
public IActionResult EditPerson() { InitView(); var id = HttpContext.Session.GetString(personIdKey); var personDal = new PersonDAL(_configuration); var person = personDal.GetPerson(id); return(View(person)); }
public DataSet ReadPerson() { DataSet set = new DataSet(); PersonDAL dAL = new PersonDAL(); var table = dAL.GetPerson(); set.Tables.Add(table); return(set); }
/// <summary> /// Updates the given Nurse and their information in the db /// </summary> /// <param name="person">The Person of the Nurse to update</param> /// <param name="address">The Address of the Nurse to update</param> /// <param name="nurse">The Nurse to update</param> /// <returns>Whether or not the update succeeded</returns> public bool UpdateNurse(Person person, Address address, Nurse nurse) { using (TransactionScope scope = new TransactionScope()) { AddressDAL.UpdateAddress(address); PersonDAL.UpdatePerson(person); NurseDAL.UpdateNurse(nurse); scope.Complete(); } return(true); }
public IActionResult Page2(PersonModel person) { var personDal = new PersonDAL(_configuration); int personId = personDal.InsertPerson(person); HttpContext.Session.SetString(personIdKey, personId.ToString()); HttpContext.Session.SetString(firstNameKey, person.FirstName); InitView(); return(View(person)); }
public ChatRoomMessageViewModel(ChatRoomMessageDAL U) { _Id = U.ChatRoomMessages.Id; _Message = U.ChatRoomMessages.Message; _MsgDate = U.ChatRoomMessages.MsgDate; _SenderUser_Id = U.ChatRoomMessages.SenderUser_Id; _RelationRequest_Id = U.ChatRoomMessages.RelationRequest_Id; _Entity_Order = U.ChatRoomMessages.Entity_Order; _IMG = PersonDAL.GetPersonPhotoByUserId(U.ChatRoomMessages.SenderUser_Id).Persons.Photo1; _SenderFullName = PersonDAL.GetPersonPhotoByUserId(U.ChatRoomMessages.SenderUser_Id).Persons.FullName; }
/// <summary> /// Updates a Patient's various records in the db /// </summary> /// <param name="person">Person of the patient to update</param> /// <param name="address">Address of the patient to update</param> /// <param name="patient">Patient to update</param> /// <returns></returns> public bool UpdatePatient(Person person, Address address, Patient patient) { using (TransactionScope scope = new TransactionScope()) { AddressDAL.UpdateAddress(address); PersonDAL.UpdatePerson(person); PatientDAL.UpdatePatient(patient); scope.Complete(); } return(true); }
public void UpdateGrid(String sGrid) { try { PersonDAL objdal = new PersonDAL(); objdal.Update(sGrid); } catch { throw; } }
public DataTable GetPersons() { try { PersonDAL objdal = new PersonDAL(); return(objdal.Read()); } catch { throw; } }
/// <summary> /// Deletes the given Patient and their Person from the db /// </summary> /// <param name="patient">Patient to delete</param> /// <returns>Whether or not the Patient was deleted</returns> public bool DeletePatient(Patient patient) { Person person = PersonDAL.GetPersonByPatientID(patient); using (TransactionScope scope = new TransactionScope()) { PatientDAL.DeletePatient(patient); PersonDAL.DeletePerson(person); scope.Complete(); } return(true); }
/// <summary> /// Load records from database /// </summary> /// <returns></returns> public DataTable Load() { PersonDAL pDAL = new PersonDAL(); try { return pDAL.Load(); } catch { throw; } finally { pDAL = null; } }
/// <summary> /// insert records into database /// </summary> /// <param name="person"></param> /// <returns></returns> public int Insert(Person person) { PersonDAL pDAL = new PersonDAL(); try { return pDAL.Insert(person); } catch { throw; } finally { pDAL = null; } }
/// <summary> /// Delete record from database /// </summary> /// <param name="person"></param> /// <returns></returns> public int Delete(Person person) { PersonDAL pDAL = new PersonDAL(); try { return pDAL.Delete(person); } catch { throw; } finally { pDAL = null; } }
public static void Main(string[] args) { //在更新数据前显示对象信息 PersonDAL personDAL = new PersonDAL(); var beforeObj = personDAL.GetPerson(24); personDAL.Display("Before", beforeObj); //更新Person的SecondName,Age两个属性 Person person1 = new Person(); person1.Id = 24; person1.FirstName = "Leslie"; person1.SecondName = "Wang"; person1.Age = 32; person1.Address = "Tianhe"; person1.Telephone = "13660123456"; person1.EMail = "*****@*****.**"; //更新Person的FirstName属性 Person person2 = new Person(); person2.Id = 24; person2.FirstName = "Rose"; person2.SecondName = "Lee"; person2.Age = 34; person2.Address = "Tianhe"; person2.Telephone = "13660123456"; person2.EMail = "*****@*****.**"; //使用异步方式同时更新数据 MyDelegate myDelegate = new MyDelegate(personDAL.Update); myDelegate.BeginInvoke(person1, null, null); myDelegate.BeginInvoke(person2, null, null); Thread.Sleep(300); //在更新数据后显示对象信息 var afterObj = personDAL.GetPerson(24); personDAL.Display("After", afterObj); Console.ReadKey(); }
public void SavePerson(Person person) { PersonDAL personDal = new PersonDAL(); personDal.Save(person); }
public List<Person> GetListOfAllPersons() { PersonDAL personDal = new PersonDAL(); return personDal.Persons.ToList(); }