public void GeneratePayslip(string root) { string path = root + " " + $"{Name}.txt"; using StreamWriter sw = File.CreateText(path); { sw.WriteLine("------------------------------------------------------"); sw.WriteLine($"PAYSLIP {DateTime.Now.ToString("MMMM yyyy")}"); sw.WriteLine("------------------------------------------------------"); sw.WriteLine($"Name : {Name}"); sw.WriteLine($"Social Securty : {SocialSecNr}"); sw.WriteLine($"Bank account : {Bankaccount}"); sw.WriteLine($"Sex : {(Sex ? "Male" : "Female")}"); sw.WriteLine($"Birthdate : {Birthdate.ToShortDateString()}"); sw.WriteLine($"Join date : {JoinDate.ToShortDateString()}"); sw.WriteLine($"Function : {Title}"); sw.WriteLine($"Fulltime : {Hours}"); sw.WriteLine($"Company car : {(CompanyCar ? "Yes" : "No")}"); sw.WriteLine("------------------------------------------------------"); sw.WriteLine($"Starting salary : €{Print(StartingSalary)}"); sw.WriteLine($"Seniority : + €{Print(AddSeniority())}"); sw.WriteLine($" : €{Print(Salary)}"); sw.WriteLine($"Social security : - €{Print(DeductSocialSecurity())}"); sw.WriteLine($" : €{Print(Salary)}"); sw.WriteLine($"Withholding tax : - €{Print(DeductWitholdingTax())}"); sw.WriteLine($" : €{Print(Salary)}"); sw.WriteLine($"Net salary : €{Print(Salary)}"); } }
/// <summary> /// 使用一定的格式构造一个字符串 /// </summary> /// <param name="format"></param> /// <param name="formatProvider"></param> /// <returns></returns> public string ToString(string format, IFormatProvider formatProvider) { var b = new StringBuilder(format); b.Replace("username", UserName); b.Replace("userid", UserId.ToString()); b.Replace("mode", _mode.ToString()); b.Replace("pp", Pp.ToString(CultureInfo.InvariantCulture)); b.Replace("globalrank", GlobalRank.ToString()); b.Replace("countryrank", CountryRank.ToString()); b.Replace("cssh", SshCount.ToString()); b.Replace("csh", ShCount.ToString()); b.Replace("css", SsCount.ToString()); b.Replace("cs", SCount.ToString()); b.Replace("ca", ACount.ToString()); b.Replace("acc", $"{Accuracy:f2}%"); b.Replace("rankedscore", RankedScore.ToString(CultureInfo.InvariantCulture)); b.Replace("totalscore", TotalScore.ToString(CultureInfo.InvariantCulture)); b.Replace("playcount", PlayCount.ToString()); b.Replace("level", Level.ToString(CultureInfo.InvariantCulture)); b.Replace("countrycn", GetCountryInCn(Country)); b.Replace("country", Country); b.Replace("joindate", JoinDate.ToString("yyyy/MM/dd HH:mm:ss")); return(b.ToString()); }
public override int GetHashCode() { int hash = 1; if (UserId.Length != 0) { hash ^= UserId.GetHashCode(); } if (Email.Length != 0) { hash ^= Email.GetHashCode(); } if (Password.Length != 0) { hash ^= Password.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (YearBorn != 0) { hash ^= YearBorn.GetHashCode(); } if (Country.Length != 0) { hash ^= Country.GetHashCode(); } if (Marketing != false) { hash ^= Marketing.GetHashCode(); } if (Termsagreed != false) { hash ^= Termsagreed.GetHashCode(); } if (Company.Length != 0) { hash ^= Company.GetHashCode(); } if (Profession.Length != 0) { hash ^= Profession.GetHashCode(); } if (JoinDate != 0L) { hash ^= JoinDate.GetHashCode(); } if (EmailValidated != false) { hash ^= EmailValidated.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
protected void Page_Load(Object sender, EventArgs e) { if (!IsPostBack) { JoinDate.SetValue(DateTime.Now); RoleID.DataSource = db.ExecuteDataTable("SELECT id,name FROM [T_UserRole]"); RoleID.DataTextField = "name"; RoleID.DataValueField = "id"; RoleID.DataBind(); RoleID.Items.Insert(0, new ListItem("选择角色", "0")); if (IsEdit) { LoadData(); UserName.Enabled = false; //Req1.Visible = Req2.Visible = false; } } }
public async Task UserInfo(CommandContext ctx, [Description("User to get info about")] DiscordMember m = null) { if (m == null) { m = ctx.Member; } DateTime JoinDate = m.JoinedAt.DateTime; var user = RPClass.Users.FirstOrDefault(x => x.UserData.UserID == m.Id); if (m.Id == 126070623855312896) { JoinDate = new DateTime(2017, 5, 13, 14, 11, 19); } else if (m.Id == 242720599158423554) { JoinDate = ctx.Guild.CreationTimestamp.DateTime; } else if (m.Id == 286222030997684226) { JoinDate = new DateTime(2017, 10, 11, 19, 12, 32); } else if (m.Id == 221576298743595009) { JoinDate = new DateTime(2017, 11, 24, 18, 2, 13); } var b = new DiscordEmbedBuilder() { Title = $"{m.DisplayName}#{m.Discriminator}", ThumbnailUrl = m.AvatarUrl ?? m.DefaultAvatarUrl, Color = new DiscordColor("4169E1") } .WithFooter($"User ID:{m.Id}") .AddField("Joined Discord on: ", $"{m.CreationTimestamp.ToString("dd MMM yyyy H:mm")} \n({DateTimeOffset.Now.Subtract(m.CreationTimestamp).Days} days ago)", true) .AddField("Joined this Server on: ", $"{JoinDate.ToString("dd MMM yyyy H:mm")}\n({DateTime.Now.Subtract(JoinDate).Days} days ago)", true); if (user != null) { b.AddField("Roleplay Stats: ", $"Message Count: {user.Activity.MessageCount}\nWord Count: {user.Activity.WordCount}\nCharacter Count: {user.Activity.CharacterCount}\n Avg Char Count (per msg): " + (user.Activity.MessageCount > 0 ? "" + (user.Activity.CharacterCount / user.Activity.MessageCount) : "-") + "\n Avg Word Count (per msg): " + (user.Activity.MessageCount > 0 ? "" + (user.Activity.WordCount / user.Activity.MessageCount) : "-"), false); } b.AddField("Roles: ", m.Roles.Any() ? string.Join(", ", m.Roles.Select(x => x.Name)) : "-", false); await ctx.RespondAsync("", embed : b.Build()); }
public async Task UserInfo(CommandContext ctx, [Description("User to get info about")] DiscordMember m = null) { if (m == null) { m = ctx.Member; } DateTime JoinDate = m.JoinedAt.DateTime; if (m.Id == 126070623855312896) { JoinDate = new DateTime(2017, 5, 13, 14, 11, 19); } else if (m.Id == 242720599158423554) { JoinDate = ctx.Guild.CreationTimestamp.DateTime; } else if (m.Id == 286222030997684226) { JoinDate = new DateTime(2017, 10, 11, 19, 12, 32); } else if (m.Id == 221576298743595009) { JoinDate = new DateTime(2017, 11, 24, 18, 2, 13); } var b = new DiscordEmbedBuilder() { Title = $"{m.DisplayName}#{m.Discriminator}", ThumbnailUrl = m.AvatarUrl ?? m.DefaultAvatarUrl, Color = new DiscordColor("4169E1") } .WithFooter($"User ID:{m.Id}") .AddField("Joined Discord on: ", $"{m.CreationTimestamp.ToString("dd MMM yyyy H:mm")} \n({DateTimeOffset.Now.Subtract(m.CreationTimestamp).Days} days ago)", true) .AddField("Joined this Server on: ", $"{JoinDate.ToString("dd MMM yyyy H:mm")}\n({DateTime.Now.Subtract(JoinDate).Days} days ago)", true) .AddField("Roles: ", string.Join(", ", m.Roles.Select(x => x.Name)), true); await ctx.RespondAsync("", embed : b.Build()); }
public override string ToString() { return($"{Name} {JoinDate.ToShortDateString()} {WeeklyWage:C}"); }
private void button1_Click(object sender, EventArgs e) { string error_caption = "Error"; if (string.IsNullOrEmpty(EmployeeName.Text)) { var emp_error = MessageBox.Show("Employee Name cannot be left empty", error_caption, MessageBoxButtons.OK); EmployeeName.Focus(); } else if (!BirthDate.MaskCompleted || !BirthDate.MaskFull) { var emp_error = MessageBox.Show("Birth date is not filled or not finished yet", error_caption, MessageBoxButtons.OK); BirthDate.Focus(); } else if (string.IsNullOrEmpty(Address.Text)) { var emp_error = MessageBox.Show("Address is cannot be left empty", error_caption, MessageBoxButtons.OK); Address.Focus(); } else if (City.SelectedIndex < 0) { var emp_error = MessageBox.Show("Please choose a city", error_caption, MessageBoxButtons.OK); City.Focus(); } else if (Country.SelectedIndex < 0) { var emp_error = MessageBox.Show("Please choose your nation", error_caption, MessageBoxButtons.OK); Country.Focus(); } else if (Qualification.SelectedIndex < 0) { var emp_error = MessageBox.Show("Please choose your highest qualification", error_caption, MessageBoxButtons.OK); Qualification.Focus(); } else if (!Phone.MaskCompleted) { var emp_error = MessageBox.Show("Please enter your phone number", error_caption, MessageBoxButtons.OK); Phone.Focus(); } else if (string.IsNullOrEmpty(Email.Text)) { var emp_error = MessageBox.Show("Please enter your Email", error_caption, MessageBoxButtons.OK); Email.Focus(); } else if (JoinDate.Text.Length == 0) { var emp_error = MessageBox.Show("When did you join this company?", error_caption, MessageBoxButtons.OK); JoinDate.Focus(); } else { string message = "Employee Name: " + this.EmployeeName.Text + "\nDate of birth: " + this.BirthDate.Text + "\nAddress: " + this.Address.Text + "\nCity: " + this.City.Text + "\nCountry: " + this.Country.Text + "\nQualification: " + this.Qualification.Text + "\nPhone: " + this.Phone.Text + "\nEmail: " + this.Email.Text + "\nDate of joining: " + this.JoinDate.Text; string caption = "Information detail"; var result = MessageBox.Show(message, caption, MessageBoxButtons.OK); } }
//会員登録日を表示する public void ShowJoinDate() { string strJoinDate = JoinDate.ToShortDateString(); Console.WriteLine($"会員登録日は{strJoinDate}です。"); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (EmployeeId != null) { hashCode = hashCode * 59 + EmployeeId.GetHashCode(); } if (EmployeeCode != null) { hashCode = hashCode * 59 + EmployeeCode.GetHashCode(); } if (EmployeeName != null) { hashCode = hashCode * 59 + EmployeeName.GetHashCode(); } hashCode = hashCode * 59 + Gender.GetHashCode(); if (DateOfBirth != null) { hashCode = hashCode * 59 + DateOfBirth.GetHashCode(); } if (PhoneNumber != null) { hashCode = hashCode * 59 + PhoneNumber.GetHashCode(); } if (DepartmentId != null) { hashCode = hashCode * 59 + DepartmentId.GetHashCode(); } if (DepartmentName != null) { hashCode = hashCode * 59 + DepartmentName.GetHashCode(); } if (Email != null) { hashCode = hashCode * 59 + Email.GetHashCode(); } hashCode = hashCode * 59 + Salary.GetHashCode(); hashCode = hashCode * 59 + WorkStatus.GetHashCode(); if (PositionId != null) { hashCode = hashCode * 59 + PositionId.GetHashCode(); } if (PositionName != null) { hashCode = hashCode * 59 + PositionName.GetHashCode(); } if (TaxCode != null) { hashCode = hashCode * 59 + TaxCode.GetHashCode(); } if (JoinDate != null) { hashCode = hashCode * 59 + JoinDate.GetHashCode(); } if (IdentityNumber != null) { hashCode = hashCode * 59 + IdentityNumber.GetHashCode(); } if (IdentityDate != null) { hashCode = hashCode * 59 + IdentityDate.GetHashCode(); } if (IdentityPlace != null) { hashCode = hashCode * 59 + IdentityPlace.GetHashCode(); } return(hashCode); } }
/// <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) )); }
//override ToString public override string ToString() { return($"{Name}, {MembersType}, {JoinDate.ToShortDateString()}"); }