Skip to content

Commit

Permalink
Added the design of the number deletion form.
Browse files Browse the repository at this point in the history
  • Loading branch information
Teeslii committed Nov 25, 2021
1 parent 0451473 commit 3195567
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 84 deletions.
127 changes: 53 additions & 74 deletions NumberDelete.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions NumberDelete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,24 @@ public NumberDelete(IDataAcces dataAcces)

private void MapperSearch()
{
SearchDto.Name = txtName.Text;
SearchDto.Lastname = txtLastname.Text;
SearchDto.NameSurname = txtNameSurname.Text;
var config = new MapperConfiguration(cfg => cfg.CreateMap<Person, PersonDTO>());
var mapper = new Mapper(config);
directoryDTO = mapper.Map<PersonDTO>(SearchDto);
ResultForm(dataAcces.Search(directoryDTO)); // mantıklı değil pek
ResultForm(dataAcces.Search(directoryDTO));
}

private void ResultForm(bool _resultSearch)
{
if(_resultSearch == true)
{
pnlDelete.Visible = true;
lblName.Text = SearchDto.Name;
lblLastname.Text = SearchDto.Lastname;
lblNameSurname.Text = SearchDto.NameSurname;

}
else
{
MessageBox.Show("No record found named "+txtName.Text + " " + txtLastname.Text+ ". Please try again");
MessageBox.Show("The data suitable for the " + txtNameSurname.Text + ". you are looking for could not be found in the directory. Please make a selection. End the deletion or try again!");
}
}
private void btnSearch_Click(object sender, EventArgs e)
Expand All @@ -62,5 +61,7 @@ private void btnNo_Click(object sender, EventArgs e)
{
MessageBox.Show("No action was taken.");
}


}
}
3 changes: 1 addition & 2 deletions Person.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ namespace Phonebook
{
public class Person
{
public string Name { get; set; }
public string Lastname { get; set; }
public string NameSurname { get; set; }
public long Number { get; set; }

}
Expand Down
3 changes: 1 addition & 2 deletions models/PersonDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ namespace Phonebook.models
{
public class PersonDTO
{
public string Name { get; set; }
public string Lastname { get; set; }
public string NameSurname { get; set; }
public long Number { get; set; }
}
}

0 comments on commit 3195567

Please sign in to comment.