/// <summary> /// 获得上市公司高管信息字符串 /// </summary> /// <returns></returns> public override string ToString() { string str = $"[{CodeTS}]{Name}\n"; str += $"公告日期: {AnnouncementDate?.ToString("yyyy-MM-dd")}\n"; str += $"性别: {Enum.GetName(typeof(Gender), Gender)}\n"; str += $"职务:{Position}({PositionType})\n"; str += $"学历: {Education}\n"; str += $"国籍: {Nationality}\n"; str += $"出生年月: {Birthday?.ToString("yyyy-MM")}({(int)((DateTime.Today - (Birthday??DateTime.Now)).TotalDays / 365)})\n"; str += $"上任日期: {AppointmentDate?.ToString("yyyy-MM-dd")}\n"; str += $"离任日期: {DepartureDate?.ToString("yyyy-MM-dd")}\n"; str += $"个人简历: {Resume}\n"; return(str); }
protected void Page_Load(object sender, EventArgs e) { try { CustomerNum = util.GetCustomerNum(Message); if (CustomerNum == 0) { return; } #region process dates int Year = 0; int Month = 0; int Day = 0; DateTime AppointmentDate = DateTime.MinValue; if (Request["year"] != null && Request["month"] != null && Request["day"] != null) { Int32.TryParse(Request["year"].ToString().Trim(), out Year); Int32.TryParse(Request["month"].ToString().Trim(), out Month); Int32.TryParse(Request["day"].ToString().Trim(), out Day); AppointmentDate = new DateTime(Year, Month, Day); } else { //dennis set cookies here this would be read by javascript on the client browser. HttpCookie DemoDateCookieY = new HttpCookie("DemoDateCookieY"); HttpCookie DemoDateCookieM = new HttpCookie("DemoDateCookieM"); HttpCookie DemoDateCookieD = new HttpCookie("DemoDateCookieD"); if (CustomerNum == util.GetDemoDentalOfficeID()) { AppointmentDate = util.GetDemoTodayDate(); //for demo only. The date is set to a preset date in webconfig. DemoDateCookieY.Value = AppointmentDate.Year + ""; DemoDateCookieM.Value = AppointmentDate.Month + ""; DemoDateCookieD.Value = AppointmentDate.Day + ""; } else { DemoDateCookieY.Value = ""; // these are explicitely set to empty, because the javascript on the browser is picking values from previously set cookies DemoDateCookieM.Value = ""; DemoDateCookieD.Value = ""; AppointmentDate = DateTime.Today; } Response.Cookies.Add(DemoDateCookieY); // if expiry is not specified the cookie lasts till the end of session Response.Cookies.Add(DemoDateCookieM); Response.Cookies.Add(DemoDateCookieD); } DayLabel.Text = AppointmentDate.ToString("ddd") + ", " + AppointmentDate.ToString("MMM") + AppointmentDate.ToString("dd"); DateTime PreviousDate = AppointmentDate.AddDays(-1); PreviousDateDay = PreviousDate.Day; PreviousDateMonth = PreviousDate.Month; PreviousDateYear = PreviousDate.Year; DateTime NextDate = AppointmentDate.AddDays(1); NextDateDay = NextDate.Day; NextDateMonth = NextDate.Month; NextDateYear = NextDate.Year; #endregion #region process providers long ProvNum = 0; if (Request["ProvNum"] == null) { if (Session["ProvNum"] != null) { Int64.TryParse(Session["ProvNum"].ToString(), out ProvNum); } } else { Int64.TryParse(Request["ProvNum"].ToString().Trim(), out ProvNum); Session["ProvNum"] = ProvNum.ToString(); } #endregion List <Appointmentm> appointmentmList; if (ProvNum == 0) { appointmentmList = Appointmentms.GetAppointmentms(CustomerNum, AppointmentDate, AppointmentDate); } else { appointmentmList = Appointmentms.GetAppointmentms(CustomerNum, ProvNum, AppointmentDate, AppointmentDate); } appointmentmList = appointmentmList.Where(a => a.AptStatus != ApptStatus.UnschedList && a.AptStatus != ApptStatus.Planned).ToList(); //exclude unscheduled and planned appointments. Repeater1.DataSource = appointmentmList; Repeater1.DataBind(); } catch (Exception ex) { LabelError.Text = Util.ErrorMessage; Logger.LogError(ex); } }