private void btnInsert_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtName.Text) || string.IsNullOrWhiteSpace(txtSurname.Text)) { MessageBox.Show("Preencha todos os campos."); txtName.Clear(); txtSurname.Clear(); txtName.Focus(); } else { Person person = new Person(); person.Name = txtName.Text; person.Surname = txtSurname.Text; PersonBLL personBLL = new PersonBLL(); Response response = personBLL.Insert(person); MessageBox.Show(response.Message); txtName.Clear(); txtSurname.Clear(); txtName.Focus(); TableResponse tableResponse = personBLL.GetNamesOnly(); dataGridView.DataSource = tableResponse.DataTable; dataGridView.Columns["Nome"].Width = 550; QueryResponse <Person> r1 = personBLL.GetAllList(); lblTotalPersons.Text = "Total de pessoas cadastradas: " + r1.Data.Count.ToString(); } }
public FriendsPage(string friendLogin) { InitializeComponent(); _friendLogin = friendLogin; _userBLL = new UserBLL(); _personBLL = new PersonBLL(); _postBLL = new PostBLL(); _user = _userBLL.GetUser(_friendLogin); info.Content = _user.FirstName + " " + _user.LastName + "\nLogin: "******"\nActive:\n " + _user.LastLogin; if (_personBLL.IsUserFollowing(_userBLL.LoginRead(), _friendLogin)) { btnFollow.BorderBrush = Brushes.MediumPurple; } else { btnFollow.BorderBrush = Brushes.Transparent; } _current_post = new Post(); btnPrev.IsEnabled = false; btnNext.IsEnabled = false; Refresh(); }
public frmAddPersonAndEncounter() { InitializeComponent(); person = new PersonBLL(); encounter = new EncounterBLL(); lblNoFieldEmpty_PersonEncounterForm.Hide(); }
private bool AssociateORCIDWithOrganizationID(Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.Person person, string orcid) { person.ORCID = orcid; person.PersonStatusTypeID = (int)Profiles.ORCID.Utilities.ProfilesRNSDLL.BO.ORCID.REFPersonStatusType.REFPersonStatusTypes.ORCID_Provided; person.ORCIDRecorded = DateTime.Now; return(PersonBLL.Save(person)); }
static void Main(string[] args) { IPersonRepository personRepository = new MongoDbPersonRepository(); IDataService dataService = new MongoDBSimpleDataService(); // // use seed data to test the MongoDB data service // dataService.WriteAll(GenerateListOfPersons(), out DalErrorCode statusCode); if (statusCode == DalErrorCode.GOOD) { PersonBLL personBLL = new PersonBLL(personRepository); PersonPresenter presenter = new PersonPresenter(personBLL); } else { Console.WriteLine("There was an error connecting to data file."); // // application startup // PersonBLL personBLL = new PersonBLL(personRepository); PersonPresenter presenter = new PersonPresenter(personBLL); } }
private void btnExecute_Click(object sender, EventArgs e) { PersonBLL personBLL = new PersonBLL(); Response r1 = personBLL.OrganizeFirstStage(); Response r2 = personBLL.OrganizeSecondStage(); Response r3 = personBLL.OrganizeBreakTime(); consultaToolStripMenuItem.Visible = true; if (r1.Success && r2.Success && r3.Success) { MessageBox.Show("O evento está pronto para ser realizado. Agora você pode consultar os detalhes do evento na aba CONSULTA que acabou de aparecer no menu.", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { MessageBox.Show("Erro, contate o administrador."); } lblTwo.Visible = false; lblThree.Visible = false; lblFour.Visible = false; btnInsertTrainingSpace.Visible = false; btnInsertCoffeeSpace.Visible = false; btnExecute.Visible = false; btnNext1.Visible = false; btnNext2.Visible = false; btnNext3.Visible = false; lblOne.Visible = false; btnNext1.Visible = false; btnInsertPerson.Visible = false; lblTitle.Text = "Evento em andamento, para iniciar novo evento vá para o menu EVENTO > NOVO EVENTO."; }
private void novoEventoToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Criar um novo evento apagará todos os registros de pessoas e salas. Deseja continuar?", "ATENÇÂO", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } else { SpaceTrainingBLL spaceTBLL = new SpaceTrainingBLL(); SpaceCoffeeBLL spaceCBLL = new SpaceCoffeeBLL(); PersonBLL personBLL = new PersonBLL(); Response r1 = spaceTBLL.DeleteAll(); Response r2 = personBLL.DeleteAll(); Response r3 = spaceCBLL.DeleteAll(); lblTwo.Visible = false; lblThree.Visible = false; lblFour.Visible = false; btnInsertTrainingSpace.Visible = false; btnInsertCoffeeSpace.Visible = false; btnExecute.Visible = false; btnNext1.Visible = false; btnNext2.Visible = false; btnNext3.Visible = false; consultaToolStripMenuItem.Visible = false; lblTitle.Text = "SIGA O PASSO A PASSO"; lblOne.Visible = true; btnInsertPerson.Visible = true; MessageBox.Show(r1.Message); } }
private void frmNewSpaceTraining_Load(object sender, EventArgs e) { PersonBLL personBLL = new PersonBLL(); QueryResponse <Person> r0 = personBLL.GetAllList(); int maxCapacity = r0.Data.Count / 2; lblTitle.Text = "Informe a sala que tem a menor capacidade máxima, pois a partir dela nós facilitaremos o processo de cadastro de salas para você.\n\nA capacidade máxima não pode ser maior que: " + maxCapacity + ". \n\nIsso garante que o evento será gerenciado com 100% de sucesso."; }
// view a list of people. static void viewPeople() { foreach (var person in PersonBLL.showPeople()) { Console.WriteLine("Person: \n {0} {1}\n {2}\n {3}\n {4}\n ", person.FirstName, person.LastName, person.Age, person.Gender, person.Birthday); } Console.WriteLine("Let me know you are done viewing by striking a key."); var keyStrike = Console.ReadLine(); }
public IHttpActionResult Get() { // hit the database just so the objects do not get garbage collected PersonBLL bll = new PersonBLL(); bll.Get(1); return(Content(HttpStatusCode.OK, "Staying Alive!")); }
static void choiceListing() { var listPlace = 0; foreach (var person in PersonBLL.showPeople()) { Console.WriteLine(listPlace + " " + person.FirstName + " " + person.LastName); listPlace++; } }
public void GetPerson() { PersonBM personBm = create_person(); PersonBLL personBll = new PersonBLL(); ResultBM personResult = personBll.GetPerson(personBm.id); Assert.IsTrue(personResult.IsValid(), "La persona debería haberse recuperado"); Assert.AreEqual(personResult.GetValue <PersonBM>().id, personBm.id, "Los ids deberían coincidir."); Assert.AreEqual(personResult.GetValue <PersonBM>().Name, personBm.Name, "Los nombres deberían coincidir"); }
public IHttpActionResult GetUsers() { IEnumerable <Person> lst = new PersonBLL().GetPerson(); if (lst == null || lst.Count() <= 0) { return(NotFound()); // Returns a NotFoundResult } return(Ok(lst)); }
public ActionResult MyTeam() { string id = User.Identity.GetUserId(); PersonBLL person = personService.GetPerson(id); TeamBLL team = person.Team; IEnumerable <PersonView> teamOfCurrentManager = mapper.Map <IEnumerable <PersonBLL>, IEnumerable <PersonView> >(personService.GetTeam(id)); ViewBag.TeamName = (team != null) ? team.TeamName : string.Empty; return(PartialView("MyTeam", teamOfCurrentManager.ToList())); }
// modify a person from the list. static void updatePerson() { var PersonList = PersonBLL.showPeople(); Console.WriteLine("who would you like to update?"); choiceListing(); int selectedPerson = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("You've selected " + PersonList[selectedPerson].FirstName + " " + PersonList[selectedPerson].LastName); string previousName = PersonList[selectedPerson].FirstName; Console.WriteLine("What would you like to change?"); Console.WriteLine("First Name(f), Last Name(l), Age(a), Birthday(b), or Gender(g)?"); var personAttribute = Console.ReadLine(); switch (personAttribute) { // alter first name case "f": Console.WriteLine("What would you like to change {0} First Name to?", PersonList[selectedPerson].FirstName); PersonBLL.updatePerson(personAttribute, selectedPerson); Console.WriteLine("{0} first name is now {1}. ", previousName, PersonList[selectedPerson].FirstName); break; // alter last name case "l": Console.WriteLine("{0} current Last Name is {1}. \nWhat would you like to change {0} Last Name to?", PersonList[selectedPerson].FirstName, PersonList[selectedPerson].LastName); PersonBLL.updatePerson(personAttribute, selectedPerson); Console.WriteLine("{0} age is now {1}. ", previousName, PersonList[selectedPerson].LastName); break; // alter the persons age. case "a": Console.WriteLine("{0} current age is {1}. \nWhat would you like to change {0} age to?", PersonList[selectedPerson].FirstName, PersonList[selectedPerson].Age); PersonBLL.updatePerson(personAttribute, selectedPerson); Console.WriteLine("{0} age is now {1}. ", previousName, PersonList[selectedPerson].Age); break; // you are altering the persons birthday case "b": Console.WriteLine("{0} current Birthday is {1}. \nWhat would you like to change {0} Birthday to?", PersonList[selectedPerson].FirstName, PersonList[selectedPerson].Birthday); PersonBLL.updatePerson(personAttribute, selectedPerson); Console.WriteLine("{0} Birthday is now {1}. ", previousName, PersonList[selectedPerson].Birthday); break; // youre altering the persons gender. case "g": Console.WriteLine("{0} current Gender is {1}. \nWhat would you like to change {0} Gender to?", PersonList[selectedPerson].FirstName, PersonList[selectedPerson].Gender); PersonBLL.updatePerson(personAttribute, selectedPerson); Console.WriteLine("{0} Gender is now {1}. ", previousName, PersonList[selectedPerson].Gender); break; } }
private void frmNewPerson_Load(object sender, EventArgs e) { PersonBLL personBLL = new PersonBLL(); QueryResponse <Person> r1 = personBLL.GetAllList(); lblTotalPersons.Text = "Total de pessoas cadastradas: " + r1.Data.Count.ToString(); TableResponse tableResponse = personBLL.GetNamesOnly(); dataGridView.DataSource = tableResponse.DataTable; dataGridView.Columns["Nome"].Width = 460; }
public Settings() { InitializeComponent(); _userBLL = new UserBLL(); _personBLL = new PersonBLL(); var user = _userBLL.GetUser(); firstName.Text = user.FirstName; lastName.Text = user.LastName; login.Text = user.Login; }
private void btnShowAll_Click(object sender, EventArgs e) { PersonBLL personBLL = new PersonBLL(); TableResponse tableResponse = personBLL.GetViewModel(); dataGridView.DataSource = tableResponse.DataTable; dataGridView.Columns["Participante"].Width = 350; dataGridView.Columns["SalaUm"].Width = 180; dataGridView.Columns["SalaDois"].Width = 180; dataGridView.Columns["Café"].Width = 180; }
public void Display() { PersonBLL b1 = new PersonBLL(); List <PersonBO> list = b1.Read(); foreach (var x in list) { textBoxDisplay.Text = x.Name + "\r\n" + x.Salary + "\r\n" + x.Tax; } }
public void Input() { PersonBO PBO = new PersonBO(); PBO.Name = this.textBoxImie.Text; PBO.Salary = double.Parse(this.textBoxSalary.Text); PersonBLL pbll = new PersonBLL(); pbll.save(PBO); }
private ResultBM create_invalid_person(PersonBM personBm) { CountryBLL countryBll = new CountryBLL(); ResultBM result = countryBll.GetCountry("AR"); CountryBM countryBm = result.GetValue <CountryBM>(); AddressBLL addressBll = new AddressBLL(); AddressBM addressBm = new AddressBM("Calle test", 999, "Departamento", "Barrio", "Esta es una dirección creada mediante test", countryBm); PersonBLL personBll = new PersonBLL(); return(personBll.SavePerson(personBm)); }
private void Form1_Load_1(object sender, EventArgs e) { try { PersonBLL p = new PersonBLL(); this.dataGridView1.DataSource = p.GetPersons(); } catch { MessageBox.Show("Error Occurred Form Load"); } }
private void button1_Click_1(object sender, EventArgs e) { try { PersonBLL p = new PersonBLL(); this.dataGridView1.DataSource = p.GetPersons(Convert.ToInt16(this.txtID.Text)); } catch { MessageBox.Show("Error Occurred Get Persons"); } }
public IHttpActionResult GetPerson() { try { var person = PersonBLL.GetPerson(); return(Ok(person)); } catch (Exception e) { return(InternalServerError(e)); } }
// remove a person from the list. static void deletePerson() { Console.WriteLine("Who to remove?"); choiceListing(); var whoToRemove = Console.ReadLine(); Console.WriteLine("Total Number of Peoplebefore removal " + PersonBLL.showPeople().Count); PersonBLL.deletePerson(Convert.ToInt32(whoToRemove)); Console.WriteLine(PersonBLL.showPeople().Last().FirstName + " " + PersonBLL.showPeople().Last().LastName); Console.WriteLine("Total Number of People after remove " + PersonBLL.showPeople().Count); }
public IHttpActionResult GetPerson(PersonVm person) { try { PersonBLL.SavePerson(person); return(Ok("Save was successful!")); } catch (Exception e) { return(InternalServerError(e)); } }
public IHttpActionResult GetAll() { PersonBLL bll = new PersonBLL(); var persons = bll.GetAll(); if (persons == null) { return(Content(HttpStatusCode.NotFound, "No persons exist.")); } else { return(Ok(persons)); } }
public IHttpActionResult GetSummaryForDay(int id, DateTime date) { PersonBLL bll = new PersonBLL(); var person = bll.GetSummaryForDay(id, date); if (person == null) { return(Content(HttpStatusCode.NotFound, "Person does not exist.")); } else { return(Ok(person)); } }
public IHttpActionResult Get(int id) { PersonBLL bll = new PersonBLL(); var person = bll.Get(id); if (person == null) { return(Content(HttpStatusCode.NotFound, "Person does not exist.")); } else { return(Ok(person)); } }
public ActionResult TaskOfMyTeam() { string id = User.Identity.GetUserId(); PersonBLL manager = personService.GetPerson(id); IEnumerable <TaskView> tasksOfMyTeam; tasksOfMyTeam = mapper.Map <IEnumerable <TaskBLL>, IEnumerable <TaskView> >(filterTasks.GetTasksOfTeam(id)); ViewBag.ManagerId = manager.Id; ViewBag.TeamTasksView = true; return(PartialView("Tasks", tasksOfMyTeam)); }
protected void btnLogin_Click(object sender, EventArgs e) { PersonBLL perbll = new PersonBLL(); string name = username.Text; string pwd = txtpwd.Text; int type = rdol.SelectedIndex; string msg; Person per = new Person(); if (perbll.Login(name, pwd, type, out msg, out per)) { cookieUse("islogin", "1", 30); cookieUse("username", per.PLoginName, 30); cookieUse("id", per.PID.ToString(), 30); Response.Redirect(HttpUtility.UrlDecode(Request.QueryString["url"].ToString())); } else { Response.Write("<script>alert('" + msg + "');</script>"); } }
protected void btnpwd_Click(object sender, EventArgs e) { PersonBLL bll = new PersonBLL(); if (bll.ModifyPwd(username, Common.person.PType, oldpwd.Text, newpwd.Text)) { Response.Redirect(HttpUtility.UrlDecode(Request.QueryString["url"].ToString())); } else { Response.Write("<script>alert('修改失败');</script>"); } }
protected void btnSave_Click(object sender, EventArgs e) { PersonBLL bll = new PersonBLL(); Person per = new Person(); per.PID = id; per.PName = reg_name.Text; per.PQQNumber = reg_qq.Text; per.PAreas = reg_area.Text; per.PEmail = reg_email.Text; per.PTelNum = reg_telnum.Text; if (bll.ModifyInfo(per)) { string msg; int type = per.PType; string pwd = per.PPwd; string name = username; bool y = bll.Login(name, pwd, type, out msg, out per); cookieUse("islogin", "1", 30); cookieUse("username", per.PLoginName, 30); cookieUse("id", (per.PID).ToString(), 30); Response.Redirect(HttpUtility.UrlDecode(Request.QueryString["url"].ToString())); } else { Response.Write("<script>alert('修改失败');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { PersonBLL bll = new PersonBLL(); username = cookieRead("username"); id = Convert.ToInt32(cookieRead("id")); if (bll.IsAdmin(id)) { GridView_menber.Enabled = true; GridViewDel.Enabled = true; BindMGV(GridView_menber, 0); BindMGV(GridViewDel, 1); } else { GridView_menber.Enabled = false; GridViewDel.Enabled = false; } }
//绑定 void BindMGV(GridView gv, int isDel) { PersonBLL bll = new PersonBLL(); gv.DataSource = bll.GetAllMenber(isDel); gv.DataBind(); }