Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
249 changes: 249 additions & 0 deletions RatingColumn/Employee.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
#region Copyright Syncfusion Inc. 2001-2018.
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace GettingStarted
{
public class Employee : INotifyPropertyChanged
{
#region Private members

private bool _selected;
private string _name;
private string _designation;
private string _mail;
private string _trust;
private string _status;
private int _proficiency;
private int _rating;
private int _salary;
private string _address;
private string _gender;


#endregion

public Employee(bool selected, string name, string designation, string mail, string location, string trust, int rating, string status, int proficiency, int salary, string address, string gender)
{
Selected = selected;
EmployeeName = name;
Designation = designation;
Mail = mail;
Location = location;
Trustworthiness = trust;
Rating = rating;
Status = status;
SoftwareProficiency = proficiency;
Salary = salary;
Address = address;
Gender = gender;
}

public bool Selected
{
get
{
return _selected;
}
set
{
_selected = value;
RaisePropertyChanged("Selected");
}
}
/// <summary>
/// Gets or sets the employee name.
/// </summary>
[Display(Name = "Employee Name ")]
public string EmployeeName
{
get
{
return _name;
}
set
{
_name = value;
RaisePropertyChanged("EmployeeName");
}
}

/// <summary>
/// Gets or sets the designation.
/// </summary>
[Display(Name = "Designation ")]
public string Designation
{
get
{
return _designation;
}
set
{
_designation = value;
RaisePropertyChanged("Designation");
}
}

/// <summary>
/// Gets or sets the mail ID.
/// </summary>
[Display(Name = "Mail")]
public string Mail
{
get
{
return _mail;
}
set
{
_mail = value;
RaisePropertyChanged("Mail");
}
}

/// <summary>
/// Gets or sets the location.
/// </summary>
[Display(Name = "Location")]
public string Location { get; set; }

/// <summary>
/// Gets or sets the Trustworthiness.
/// </summary>
[Display(Name = "Trustworthiness")]
public string Trustworthiness
{
get
{
return _trust;
}
set
{
_trust = value;
RaisePropertyChanged("Trustworthiness");
}
}

/// <summary>
/// Gets or sets the rating.
/// </summary>
[Display(Name = "Rating")]
public int Rating
{
get
{
return _rating;
}
set
{
_rating = value;
RaisePropertyChanged("Rating");
}
}

/// <summary>
/// Gets or sets the status.
/// </summary>
[Display(Name = "Status")]
public string Status
{
get
{
return _status;
}
set
{
_status = value;
RaisePropertyChanged("Status");
}
}

/// <summary>
/// Gets or sets the software proficiency .
/// </summary>
[Display(Name = "Software Proficiency")]
public int SoftwareProficiency
{
get
{
return _proficiency;
}
set
{
_proficiency = value;
RaisePropertyChanged("SoftwareProficiency");
}
}

/// <summary>
/// Gets or sets the salary.
/// </summary>
[Display(Name = "Salary")]
public int Salary
{
get
{
return _salary;
}
set
{
_salary = value;
RaisePropertyChanged("Salary");
}
}

/// <summary>
/// Gets or sets the address.
/// </summary>
[Display(Name = "Address")]
public string Address
{
get
{
return _address;
}
set
{
_address = value;
RaisePropertyChanged("Address");
}
}

/// <summary>
/// Gets or sets the Gender.
/// </summary>
[Display(Name = "Gender")]
public string Gender
{
get
{
return _gender;
}
set
{
_gender = value;
RaisePropertyChanged("Gender");
}
}


public event PropertyChangedEventHandler PropertyChanged;

public void RaisePropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
89 changes: 89 additions & 0 deletions RatingColumn/EmployeeCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#region Copyright Syncfusion Inc. 2001-2018.
// Copyright Syncfusion Inc. 2001-2018. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace GettingStarted
{
public class EmployeeCollection
{
public EmployeeCollection()
{
EmployeeDetails = new EmployeeRepository().GetEmployeeDetails(100);
}

private ObservableCollection<Employee> _EmployeeDetails;

/// <summary>
/// Gets or sets the orders details.
/// </summary>
/// <value>The orders details.</value>
public ObservableCollection<Employee> EmployeeDetails
{
get { return _EmployeeDetails; }
set { _EmployeeDetails = value; }
}
}

public class EmployeeRepository
{

/// <summary>
/// Initializes a new instance of the <see cref="EmployeeRepository"/> class.
/// </summary>
public EmployeeRepository()
{
}

/// <summary>
/// Gets the Employee details.
/// </summary>
/// <param name="count">The count.</param>
/// <returns></returns>
public ObservableCollection<Employee> GetEmployeeDetails(int count)
{
string[] employees = { "Michael", "Kathryn", "Tamer", "Martin", "Davolio", "Nancy", "Fuller", "Leverling", "Therasa",
"Margaret", "Buchanan", "Janet", "Andrew", "Callahan", "Laura", "Dodsworth", "Anne",
"Bergs", "Vinet", "Anto", "Fleet", "Zachery", "Van", "Edward", "Jack", "Rose"};
string[] genders = { "1", "2", "1", "1", "2", "2", "1", "2", "2", "2", "1", "2", "1", "1", "2", "1", "2", "1", "1", "1", "1", "1", "1", "1", "1", "2" };

string[] designation = { "Manager", "CFO", "Designer", "Developer", "Program Directory", "System Analyst", "Project Lead" };

string[] mail = { "gmail.com", "yahoo.com", "hotmail.com" };
string[] trust = { "Sufficient", "Perfect", "Insufficient" };
string[] status = { "Active", "Inactive" };
string[] location = { "UK", "USA", "Sweden", "France", "Canada", "Argentina", "Austria", "Germany", "Mexico" };

string[] address = { "59 rue de lAbbaye", "Luisenstr. 48"," Rua do Paço 67", "2 rue du Commerce", "Boulevard Tirou 255",
"Rua do mailPaço 67", "Hauptstr. 31", "Starenweg 5", "Rua do Mercado, 12",
"Carrera 22 con Ave."," Carlos Soublette #8-35", "Kirchgasse 6",
"Sierras de Granada 9993", "Mehrheimerstr. 369", "Rua da Panificadora 12", "2817 Milton Dr.", "Kirchgasse 6",
"Åkergatan 24", "24, place Kléber", "Torikatu 38", "Berliner Platz 43", "5ª Ave. Los Palos Grandes", "1029 - 12th Ave. S.",
"Torikatu 38", "P.O. Box 555", "2817 Milton Dr.", "Taucherstraße 10", "59 rue de lAbbaye", "Via Ludovico il Moro 22",
"Avda. Azteca 123", "Heerstr. 22", "Berguvsvägen 8", "Magazinweg 7", "Berguvsvägen 8", "Gran Vía, 1", "Gran Vía, 1",
"Carrera 52 con Ave. Bolívar #65-98 Llano Largo", "Magazinweg 7", "Taucherstraße 10", "Taucherstraße 10"};


Random random = new Random();
ObservableCollection<Employee> ordersDetails = new ObservableCollection<Employee>();

for (int i = 10000; i < count + 10000; i++)
{
var name = employees[random.Next(25)];
int index = Array.IndexOf(employees, name);
string gender = genders[index];
ordersDetails.Add(new Employee(i % 2 == -1, name, designation[random.Next(6)], name.ToLower() + "@" + mail[random.Next(3)], location[random.Next(8)], trust[random.Next(3)],random.Next(1,5), status[random.Next(2)], random.Next(1, 100), random.Next(100000, 400000), address[random.Next(1, 25)], gender));
}

return ordersDetails;
}
}
}
Loading