/// <summary> /// Fügt einen Eintrag zur Buchausleih-Liste hinzu /// </summary> public void AddToAusleihList() { try { DataRow relation; string[] exemlarDetails = new string[2]; exemlarDetails[0] = Copy.CopyId.ToString(); exemlarDetails[1] = ReturnDate.ToShortDateString(); if (BorrowTable.Columns.Count != 2) { BorrowTable.Columns.Add(); BorrowTable.Columns.Add(); } relation = BorrowTable.NewRow(); relation.ItemArray = exemlarDetails; BorrowTable.Rows.Add(relation); } catch { MessageBox.Show("Beim Hinzufügen dieses Buches zur Buchausleihliste ist ein Fehler aufgetreten.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void ProcessRequest(HttpContext context) { var Re = new ReturnDate(); mydbEntities1 db = new mydbEntities1(); var query = from p in db.users select p; List<person> new1 = new List<person>(); foreach (var q in query) { person p1 = new person(); p1.id = q.id; p1.firstname = q.firstname; p1.lastname = q.lastname; p1.phone = q.phone; p1.email = q.email; new1.Add(p1); } Re.total = new1.Count.ToString(); Re.rows = new1; DataContractJsonSerializer json = new DataContractJsonSerializer(Re.GetType()); json.WriteObject(context.Response.OutputStream, Re); }
//加载窗口函数 private void R_historyRecord_Load(object sender, EventArgs e) { SqlConnection conn = SQLbase.getConn(); try { if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); string RID = LogWindow.logname; SqlCommand selectCmd = new SqlCommand("select BID,BorrowDate,ReturnDate,RealDate,Note from Borrow where RID='" + RID + "'", conn); SqlDataReader datareader = selectCmd.ExecuteReader(); string Bid, Bname, BorrowDate, ReturnDate, RealDate, Note; int rowindex = 0; this.dataGridView1.Rows.Clear(); while (datareader.Read()) { Bid = datareader["BID"].ToString(); BorrowDate = datareader["BorrowDate"].ToString(); ReturnDate = datareader["ReturnDate"].ToString(); RealDate = datareader["RealDate"].ToString(); Note = datareader["Note"].ToString(); rowindex = this.dataGridView1.Rows.Add(); //trim函数同于去除字符串两头的空格 this.dataGridView1.Rows[rowindex].Cells[0].Value = Bid.Trim(); this.dataGridView1.Rows[rowindex].Cells[2].Value = BorrowDate.Trim(); this.dataGridView1.Rows[rowindex].Cells[3].Value = ReturnDate.Trim(); this.dataGridView1.Rows[rowindex].Cells[4].Value = RealDate.Trim(); this.dataGridView1.Rows[rowindex].Cells[5].Value = Note.Trim(); } datareader.Close(); SQLbase.close(selectCmd); int n = this.dataGridView1.RowCount; for (int i = 0; i < n; i++) { Bid = this.dataGridView1.Rows[i].Cells[0].Value.ToString(); Bname = select(conn, Bid); this.dataGridView1.Rows[i].Cells[1].Value = Bname.Trim(); } } catch { MessageBox.Show("操作错误!"); } SQLbase.close(conn); }
private void setReturnDate() { _returnDate = DateTime.Today.AddDays(SettingsModel.MaxDaysCount); #region Check the calculated date is a holiday and set the date to next bool isAHoliday = HolidayController.IsAHoliday(ReturnDate); while (isAHoliday) { ReturnDate.AddDays(1); isAHoliday = HolidayController.IsAHoliday(ReturnDate); } #endregion returnDatePicker.Value = ReturnDate; }
/// <summary> /// Selects FlightDetails.ReturnDate on calendar, or performs OneWayOnly.Click, if FlightDetails.DepartureDate == null /// </summary> /// <param name="flight"></param> /// <returns></returns> public StartPage SetReturnDate(ref FlightDetails flight) { if (flight == null) { throw new ArgumentNullException($"Flight details is null : {MethodBase.GetCurrentMethod().Name}"); } else { if (flight.ReturnDate == null) { ReturnDate.Click(); new Actions(_driver).MoveToElement(ReturnDate).Click().Build().Perform(); return(new CalendarPopUp(_driver, _wait).SelectOneWayOnly()); } else { throw new NotImplementedException("Set particular date not implemented yet."); } } }
public override string ToString() { return(Name + " - Launch Date: " + LaunchDate.ToShortDateString() + " - Return Date: " + ReturnDate.ToShortDateString() + " - Space Ship: " + SpaceShip); }
public void extendReturnDate() { ReturnDate = ReturnDate.AddMonths(1); }
public string[] Details() { string[] details = { id, issuedDate.ToString(), ReturnDate.ToString(), getItemDetails() }; return(details); }
public String ToCSV() { return($"{IdCustomer};{TumbleNumber};{LoanDate.ToString("dd/MM/yyyy")};{ReturnDate.ToString("dd/MM/yyyy")};{LoanStatus}"); }
public override string ToString() { return($"{MyMovie.Title}, {ReturnDate.ToShortDateString()}, {Price}"); }