Beispiel #1
0
        private void BindDepartments()
        {
            if (DepartmentId.Equals(Guid.Empty))
            {
                rptDepartment.Visible    = true;
                ucDepartmentEdit.Visible = false;

                var groups = new List <GroupInfo>();
                foreach (var g in CoreContext.GroupManager.GetGroups())
                {
                    AppendGroupsWithChild(groups, g);
                }

                groups.Sort((x, y) => string.Compare(x.Name, y.Name));

                rptDepartment.DataSource = groups;
                rptDepartment.DataBind();
            }
            else
            {
                rptDepartment.Visible    = false;
                ucDepartmentEdit.Visible = true;
                ucDepartmentEdit.DepId   = DepartmentId;
            }
        }
Beispiel #2
0
 public bool Equals(Employee other)
 {
     if (other == null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) && Name.Equals(other.Name) &&
            Surname.Equals(other.Surname) && Patronymic.Equals(other.Patronymic) &&
            DepartmentId.Equals(other.DepartmentId) && IsFired.Equals(other.IsFired) &&
            Salary.Equals(other.Salary) && DateHired.Equals(other.DateHired) &&
            DateFired.Equals(other.DateFired));
 }
Beispiel #3
0
 public override bool Equals(object obj)
 {
     return(obj is DepartmentManagerSM manager &&
            EmployeeId.Equals(manager.EmployeeId) &&
            DepartmentId.Equals(manager.DepartmentId));
 }
Beispiel #4
0
        /// <summary>
        /// Returns true if Employee instances are equal
        /// </summary>
        /// <param name="other">Instance of Employee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Employee other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EmployeeId == other.EmployeeId ||
                     EmployeeId != null &&
                     EmployeeId.Equals(other.EmployeeId)
                     ) &&
                 (
                     EmployeeCode == other.EmployeeCode ||
                     EmployeeCode != null &&
                     EmployeeCode.Equals(other.EmployeeCode)
                 ) &&
                 (
                     EmployeeName == other.EmployeeName ||
                     EmployeeName != null &&
                     EmployeeName.Equals(other.EmployeeName)
                 ) &&
                 (
                     Gender == other.Gender ||

                     Gender.Equals(other.Gender)
                 ) &&
                 (
                     DateOfBirth == other.DateOfBirth ||
                     DateOfBirth != null &&
                     DateOfBirth.Equals(other.DateOfBirth)
                 ) &&
                 (
                     PhoneNumber == other.PhoneNumber ||
                     PhoneNumber != null &&
                     PhoneNumber.Equals(other.PhoneNumber)
                 ) &&
                 (
                     DepartmentId == other.DepartmentId ||
                     DepartmentId != null &&
                     DepartmentId.Equals(other.DepartmentId)
                 ) &&
                 (
                     DepartmentName == other.DepartmentName ||
                     DepartmentName != null &&
                     DepartmentName.Equals(other.DepartmentName)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     Salary == other.Salary ||

                     Salary.Equals(other.Salary)
                 ) &&
                 (
                     WorkStatus == other.WorkStatus ||

                     WorkStatus.Equals(other.WorkStatus)
                 ) &&
                 (
                     PositionId == other.PositionId ||
                     PositionId != null &&
                     PositionId.Equals(other.PositionId)
                 ) &&
                 (
                     PositionName == other.PositionName ||
                     PositionName != null &&
                     PositionName.Equals(other.PositionName)
                 ) &&
                 (
                     TaxCode == other.TaxCode ||
                     TaxCode != null &&
                     TaxCode.Equals(other.TaxCode)
                 ) &&
                 (
                     JoinDate == other.JoinDate ||
                     JoinDate != null &&
                     JoinDate.Equals(other.JoinDate)
                 ) &&
                 (
                     IdentityNumber == other.IdentityNumber ||
                     IdentityNumber != null &&
                     IdentityNumber.Equals(other.IdentityNumber)
                 ) &&
                 (
                     IdentityDate == other.IdentityDate ||
                     IdentityDate != null &&
                     IdentityDate.Equals(other.IdentityDate)
                 ) &&
                 (
                     IdentityPlace == other.IdentityPlace ||
                     IdentityPlace != null &&
                     IdentityPlace.Equals(other.IdentityPlace)
                 ));
        }