public void RezervationInsert() { string beginTime = StartDateTime.ToShortDateString(); DateTime? beginClock = new DateTime(); beginClock = tpStartTime.Value as DateTime?; DateTime? endClock = new DateTime(); endClock = tpEndTime.Value as DateTime?; DateTime beginDateTime = Convert.ToDateTime(beginTime + " " + beginClock.Value.TimeOfDay.ToString()); DateTime endDateTime = Convert.ToDateTime(beginTime + " " + endClock.Value.TimeOfDay.ToString()); SPA_RezervationSchedule reservation = new SPA_RezervationSchedule(); reservation.ID = Guid.NewGuid(); reservation.PersonelID = Guid.Parse(cbPersonelList.EditValue.ToString()); reservation.GuestID = Guid.Parse(GuestID); reservation.IsCanceled = false; reservation.Location = TherapyName; reservation.StartDateTime = beginDateTime; reservation.EndDateTime = endDateTime; reservation.TherapyID = TherapyID; reservation.StatusID = 0; reservation.GuestNote = GuestNote + "--" + txtServisNote.Text; reservation.Subject = RoomNumber + " " + GuestName; context.SPA_RezervationSchedules.Add(reservation); loadOpGuestTherapy = context.Load(context.GetTherapyGuestDetailQuery(ServicePlanID), new Action<LoadOperation<SPA_GuestTherapyDetail>>(GetSpa_TherapyGuestDetailUpdate), true); }
/// <summary> /// Deprecated Method for adding a new object to the SPA_RezervationSchedule EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSPA_RezervationSchedule(SPA_RezervationSchedule sPA_RezervationSchedule) { base.AddObject("SPA_RezervationSchedule", sPA_RezervationSchedule); }
public void ReservationInsert() { string beginTime = dateStart.DateTime.ToShortDateString(); string endTime = dateEnd.DateTime.ToShortDateString(); DateTime? beginClock = new DateTime(); beginClock = tpStart.Value as DateTime?; DateTime? endClock = new DateTime(); endClock = tpEnd.Value as DateTime?; DateTime beginDateTime = Convert.ToDateTime(beginTime + " " + beginClock.Value.TimeOfDay.ToString()); DateTime endDateTime = Convert.ToDateTime(endTime + " " + endClock.Value.TimeOfDay.ToString()); OSYS.Web.DTO.DbPersonelTherapy therapy = cbServisList.SelectedItem as OSYS.Web.DTO.DbPersonelTherapy; string _TherapyName = therapy.TherapyName; DevExpress.Xpf.Scheduler.Drawing.NamedElement personel = cbPersonelList.SelectedItem as DevExpress.Xpf.Scheduler.Drawing.NamedElement; Resource personelID = personel.Id as Resource; PersonelID = Guid.Parse(personelID.Id.ToString()); SPA_RezervationSchedule reservation = new SPA_RezervationSchedule(); reservation.ID = Guid.NewGuid(); reservation.PersonelID = PersonelID; reservation.GuestID = GuestID; reservation.IsCanceled = false; reservation.Location = _TherapyName; reservation.StartDateTime = beginDateTime; reservation.EndDateTime = endDateTime; reservation.TherapyID = Guid.Parse(cbServisList.EditValue.ToString()); reservation.StatusID = 1; reservation.GuestNote = txtDesc.Text; reservation.Subject = Number + " " + GuestName; context.SPA_RezervationSchedules.Add(reservation); context.SubmitChanges().Completed += Reception_Completed; }
/// <summary> /// Create a new SPA_RezervationSchedule object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="personelID">Initial value of the PersonelID property.</param> /// <param name="startDateTime">Initial value of the StartDateTime property.</param> /// <param name="endDateTime">Initial value of the EndDateTime property.</param> public static SPA_RezervationSchedule CreateSPA_RezervationSchedule(global::System.Guid id, global::System.Guid personelID, global::System.DateTime startDateTime, global::System.DateTime endDateTime) { SPA_RezervationSchedule sPA_RezervationSchedule = new SPA_RezervationSchedule(); sPA_RezervationSchedule.ID = id; sPA_RezervationSchedule.PersonelID = personelID; sPA_RezervationSchedule.StartDateTime = startDateTime; sPA_RezervationSchedule.EndDateTime = endDateTime; return sPA_RezervationSchedule; }