public EmployeeViewModel(object param)
        {
            var employeeClicked = param as Employee;

            if (employeeClicked != null)
            {
                EmployeeId   = employeeClicked.EmployeeId;
                FirstName    = employeeClicked.FirstName;
                LastName     = employeeClicked.LastName;
                LocationID   = employeeClicked.LocationID;
                LocationName = employeeClicked.LocationName;
                ImageURL     = employeeClicked.ImageURL;
                Title        = employeeClicked.Title;
                FullName     = employeeClicked.FullName;

                Dictionary <string, string> myDict = new Dictionary <string, string>
                {
                    { "EmployeeId", EmployeeId.ToString() },
                    { "FirstName", FirstName },
                    { "LastName", LastName },
                    { "LocationID", LocationID.ToString() }
                };
                _logger.LoggEvent("Load EmployeeViewModel", myDict);
            }
            TapCommand = new Command(OnTapped);
        }
Ejemplo n.º 2
0
        }                                     //per month
        //public double profit { get; set; }
        //public DateTime leaving { get; set; }//If the employee left before the final date.
        //public Enums.Cars car { get; set; }

        public override string ToString()
        {
            string str = "Contract number: " + number.ToString() + "\n";

            str += "Employer Id: " + EmployerId.ToString() + "\n";
            str += "Employee Id " + EmployeeId.ToString() + "\n";
            str += "Interview: ";
            if (interview == true)
            {
                str += "Yes,";
            }
            else
            {
                str += "No,";
            }
            str += "\nSigned: ";
            if (signed == true)
            {
                str += "Yes,";
            }
            else
            {
                str += "No,";
            }

            str += "\nNeto salary: " + netoSalary.ToString() + "\n";
            str += "Beggining date of work: " + beginning.ToShortDateString() + "\n";
            str += "Final date of work: " + final.ToShortDateString() + "\n";
            return(str);
        }
Ejemplo n.º 3
0
        public ClaimsIdentity ToClaimsIdentity()
        {
            var claims = new List <Claim>
            {
                new Claim("EmployeeId", EmployeeId.ToString()),
                new Claim("EmployeeNumber", EmployeeNumber),
                new Claim(ClaimTypes.NameIdentifier, Username),
                new Claim(ClaimTypes.GivenName, FirstName),
                new Claim(ClaimTypes.Surname, LastName),
                new Claim(ClaimTypes.Email, Email),
                new Claim("Title", Title),
                new Claim("Department", Department),
                new Claim("Phone", Phone)
            };

            if (IsAdmin)
            {
                claims.Add(new Claim("IsAdmin", "true"));
            }
            if (IsApprover)
            {
                claims.Add(new Claim("IsApprover", "true"));
            }
            if (IsProcessor)
            {
                claims.Add(new Claim("IsProcessor", "true"));
            }

            return(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme));
        }
Ejemplo n.º 4
0
        public void CreateMeeting(DateTime meetingDate, TimeSpan startTime, int meetingDuration, EmployeeId employeeId)
        {
            var calendarDay = CalendarDay(meetingDate);
            var endTime     = startTime.Add(new TimeSpan(meetingDuration));

            calendarDay.Book(startTime, endTime, employeeId.ToString());
        }
Ejemplo n.º 5
0
        public override string ToString()
        {
            string str = "id: " + EmployeeId.ToString() + "\nLast Name: " + LastName.ToString() + " " + "\nFirst Name: " + FirstName.ToString();

            str += "\nEmployee Born Date: " + EmployeeBornDate.ToString() + "\nPhoneNumber: " + PhoneNumber.ToString() + "\nEmployee Address :" + EmployeeAdrs.ToString();
            str += "\nMilitary Graduate :" + MilitaryGraduate.ToString() + "\nAccount Employee: " + AccountEmployee.ToString() + "\nSpecialization of employee: " + SpecialEmployee.ToString();
            return(str);
        }
Ejemplo n.º 6
0
 public override string ToString()
 {
     return(new StringBuilder()
            .Append("Employee ID: ")
            .AppendLine(EmployeeId.ToString())
            .Append("Name: ")
            .AppendLine(Name)
            .Append("Salary: ")
            .AppendLine(Salary.ToString())
            .ToString());
 }
Ejemplo n.º 7
0
        public async Task <ClaimsIdentity> GenerateUserIdentityAsync(UserManager <ApplicationUser> manager)
        {
            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);

            // Add custom user claims here
            userIdentity.AddClaim(new Claim("EmployeeId", EmployeeId.ToString()));
            userIdentity.AddClaim(new Claim("IsDisabled", IsDisabled.ToString()));
            userIdentity.AddClaim(new Claim("Email", Email.ToString()));
            return(userIdentity);
        }
Ejemplo n.º 8
0
 private void EmployeeEntry_Load(object sender, EventArgs e)
 {
     if (Operation == "Update")
     {
         lblEmpId.Visible = false;
         if (EmployeeId > 0)
         {
             lblEmpId.Text = EmployeeId.ToString();
         }
     }
     lblSession.Text = CommonFunctions.GetCurrentSession;
     GetEmployeeDetailstoUpdate();
 }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //THIS WORKS
     if (!EmployeeId.HasValue)
     {
         Response.Redirect("~", true);
     }
     if (!Request.IsAuthenticated || !User.IsInRole(Settings.PurchasingRole))
     {
         Response.Redirect("~", true);
     }
     if (EmployeeId.HasValue)
     {
         Employee.Text = EmployeeId.ToString();
     }
 }
        public async Task GetExtendedEmployee()
        {
            var handle = Insights.TrackTime("GetExtendedEmployee", new Dictionary <string, string>()
            {
                { "EmployeeId", EmployeeId.ToString() }
            });

            handle.Start();

            EmployeeManager em = new EmployeeManager();
            EmployeeDetail  employeeDetailModel = await em.GetEmployee(EmployeeId);

            if (employeeDetailModel != null)
            {
                var primaryEmail = employeeDetailModel.EmployeeVirtualAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 4 && x.Primary);
                PrimaryEmail = (primaryEmail != null) ? primaryEmail.Address : "";

                var additionalEmail = employeeDetailModel.EmployeeVirtualAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 4 && !x.Primary);
                AdditionalEmail = (additionalEmail != null) ? additionalEmail.Address : "";

                var primaryPhone = employeeDetailModel.EmployeeVirtualAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 1);
                PrimaryPhone = (primaryPhone != null) ? primaryPhone.Address : "";

                var homePhone = employeeDetailModel.EmployeeVirtualAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 2);
                HomePhone = (homePhone != null) ? homePhone.Address : "";

                var officePhone = employeeDetailModel.EmployeeVirtualAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 3);
                OfficePhone = (officePhone != null) ? officePhone.Address : "";

                var homeAddress       = employeeDetailModel.EmployeePhysicalAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 1);
                var homeStreetAddress = (homeAddress != null) ? string.Format("{0} {1}", homeAddress.AddressLine1, homeAddress.AddressLine2) : "";
                var homeZipAndArea    = (homeAddress != null) ? string.Format("{0} {1}", homeAddress.ZipCode, homeAddress.City) : "";
                HomeAddress = (homeAddress != null) ? (homeStreetAddress + Environment.NewLine + homeZipAndArea) : "";

                var workAddress       = employeeDetailModel.EmployeePhysicalAddresses.FirstOrDefault(x => x.AddressType.AddressTypeId == 2);
                var workStreetAddress = (homeAddress != null) ? string.Format("{0} {1}", workAddress.AddressLine1, workAddress.AddressLine2) : "";
                var workZipAndArea    = (homeAddress != null) ? string.Format("{0} {1}", workAddress.ZipCode, workAddress.City) : "";
                WorkAddress = (workAddress != null) ? (workStreetAddress + Environment.NewLine + workZipAndArea) : "";

                var employeePhysicalAddresses = employeeDetailModel.EmployeePhysicalAddresses;
                EmployeePhysicalAddresses = employeePhysicalAddresses;

                var employeeVirtualAddresses = employeeDetailModel.EmployeeVirtualAddresses;
                EmployeeVirtualAddresses = employeeVirtualAddresses;
            }
            handle.Stop();
        }
Ejemplo n.º 11
0
        public override string ToString()

        {
            return(EmployeeId.ToString().PadRight(5) + (LastName + ", " + FirstName).PadRight(30) + JobTitle.PadRight(30) + Gender.PadRight(3) + BirthDate.ToShortDateString().PadRight(10));
        }
 public override int GetHashCode()
 {
     return((EmployeeId.ToString() + "|" + TerritoryId.ToString()).GetHashCode());
 }
Ejemplo n.º 13
0
        public ClaimsIdentity ToClaimsIdentity()
        {
            var claims = new List <Claim>
            {
                new Claim("EmployeeId", EmployeeId.ToString()),
                new Claim(ClaimTypes.NameIdentifier, Username),
                new Claim(ClaimTypes.Name, Name),
                new Claim(ClaimTypes.GivenName, FirstName),
                new Claim(ClaimTypes.Surname, LastName),
                new Claim(ClaimTypes.Email, Email)
            };

            if (MiddleName != null)
            {
                claims.Add(new Claim("MiddleName", MiddleName));
            }
            if (Title != null)
            {
                claims.Add(new Claim("Title", Title));
            }
            if (Department != null)
            {
                claims.Add(new Claim("Department", Department));
            }
            if (Service != null)
            {
                claims.Add(new Claim("Service", Service));
            }
            if (Address != null)
            {
                claims.Add(new Claim(ClaimTypes.StreetAddress, Address));
            }
            if (City != null)
            {
                claims.Add(new Claim(ClaimTypes.Locality, City));
            }
            if (State != null)
            {
                claims.Add(new Claim(ClaimTypes.StateOrProvince, State));
            }
            if (Zip != null)
            {
                claims.Add(new Claim(ClaimTypes.PostalCode, Zip));
            }
            if (Phone != null)
            {
                claims.Add(new Claim("Phone", Phone));
            }
            if (CellPhone != null)
            {
                claims.Add(new Claim(ClaimTypes.MobilePhone, CellPhone));
            }

            if (SupervisorName != null)
            {
                claims.Add(new Claim("Supervisor", SupervisorName));
            }

            if (SupportUnitId != null)
            {
                claims.Add(new Claim("SupportUnitId", SupportUnitId.ToString()));
            }

            if (IsAdmin)
            {
                claims.Add(new Claim("IsAdmin", "true"));
            }
            if (IsApprover)
            {
                claims.Add(new Claim("IsApprover", "true"));
            }

            return(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme));
        }
Ejemplo n.º 14
0
 public override string ToString()
 {
     return(EmployeeId.ToString() + " " + FirstName + " " + CompanyId.ToString());
 }
Ejemplo n.º 15
0
 public override string ToString() =>
 //:C不能有空格
 $"{_id.ToString()}: {_name,-20} {_salary:C}";