public AppointmentFormOutlook2007Style(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm) : base() { if (control == null) Exceptions.ThrowArgumentException("control", control); if (control.Storage == null) Exceptions.ThrowArgumentException("control.Storage", control.Storage); if (apt == null) Exceptions.ThrowArgumentException("apt", apt); this.openRecurrenceForm = openRecurrenceForm; this.controller = CreateController(control, apt); this.sourceAppointment = apt; // // Required for Windows Form Designer support // InitializeComponent(); SchedulerStorage storage = (SchedulerStorage)control.Storage; repItemAppointmentStatus.Storage = storage; repItemAppointmentLabel.Storage = storage; barAndDockingController.LookAndFeel.ParentLookAndFeel = LookAndFeel; LoadIcons(); LoadImages(); this.control = control; this.storage = control.Storage; }
public MyAppointmentForm(SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm) { this.openRecurrenceForm = openRecurrenceForm; this.controller = new MyAppointmentFormController(control, apt); this.apt = apt; this.control = control; SuspendUpdate(); InitializeComponent(); ResumeUpdate(); UpdateForm(); }
public AppointmentFormOutlook2007Style(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm) : base() { if (control == null) { Exceptions.ThrowArgumentException("control", control); } if (control.Storage == null) { Exceptions.ThrowArgumentException("control.Storage", control.Storage); } if (apt == null) { Exceptions.ThrowArgumentException("apt", apt); } this.openRecurrenceForm = openRecurrenceForm; this.controller = CreateController(control, apt); this.sourceAppointment = apt; // // Required for Windows Form Designer support // InitializeComponent(); SchedulerStorage storage = (SchedulerStorage)control.Storage; repItemAppointmentStatus.Storage = storage; repItemAppointmentLabel.Storage = storage; edtResource.SchedulerControl = control; edtResource.Storage = storage; edtResources.SchedulerControl = control; barAndDockingController.LookAndFeel.ParentLookAndFeel = LookAndFeel; this.spellChecker.LookAndFeel.ParentLookAndFeel = this.LookAndFeel; LoadIcons(); this.control = control; this.storage = control.Storage; }
private void CreateNewAppointment() { _apt = _control.Storage.CreateAppointment(AppointmentType.Normal); _apt.AllDay = true; }
public MyCustomEditForm(SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm, int nDepartmentID,int nEmployee) { this.openRecurrenceForm = openRecurrenceForm; this.controller = new MyAppointmentFormController(control, apt); this.apt = apt; this.control = control; nDepartment = nDepartmentID; nEmp = nEmployee; // // Required for Windows Form Designer support // InitializeComponent(); //this.tblDeliveryScheduleTableAdapter.Fill(this.aCMSDataSet.TblDeliverySchedule, nDepartment); UpdateForm(); // // TODO: Add any constructor code after InitializeComponent call // }
//string SourceCustomStatus //{ // get // { // return (string)SourceAppointment.CustomFields["CustomStatus"]; // } // set // { // SourceAppointment.CustomFields["CustomStatus"] = value; // } //} public MyAppointmentFormController(SchedulerControl control, DevExpress.XtraScheduler.Appointment apt) : base(control, apt) { }
/// <summary> /// Add your code to retrieve a value from the editor and set the custom appointment field. /// </summary> public override bool SaveFormData(DevExpress.XtraScheduler.Appointment appointment) { return(base.SaveFormData(appointment)); }
public CustomAppointmentForm1(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm) : base(control, apt, openRecurrenceForm) { InitializeComponent(); }
protected override AppointmentFormController CreateAppointmentFormController(DevExpress.XtraScheduler.Appointment apt) { return(new CustomAppointmentFormController(Control, apt)); }
private void schedulerControl1_CustomDrawAppointmentBackground(object sender, DevExpress.XtraScheduler.CustomDrawObjectEventArgs e) { DevExpress.XtraScheduler.Drawing.AppointmentViewInfo aptViewInfo = e.ObjectInfo as AppointmentViewInfo; if (aptViewInfo != null) { AppearanceObject app = aptViewInfo.Appearance; DevExpress.XtraScheduler.Appointment appointment = aptViewInfo.Appointment; DataRowView rowView = (DataRowView)appointment.GetRow(schedulerControl1.Storage); if (rowView != null) { DataRow row = rowView.Row; if (ACMS.Convert.ToInt32(row["nStatusID"]) == 2) { app.BackColor = Color.Aqua; app.DrawBackground(e.Cache, e.Bounds); } else if (ACMS.Convert.ToInt32(row["nStatusID"]) == 5) { app.BackColor = Color.Yellow; app.DrawBackground(e.Cache, e.Bounds); } if (ACMS.Convert.ToInt32(row["nStatusID"]) == 2 || ACMS.Convert.ToInt32(row["nStatusID"]) == 5) { // // // DevExpress.Utils.AppearanceObject app2 = new DevExpress.Utils.AppearanceObject(); // Rectangle rect1 = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); // // System.Drawing.StringFormat strFormat = new StringFormat(); // strFormat.Alignment = StringAlignment.Near; // // app2.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Top; // app2.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; // // System.Drawing.FontStyle fs = new FontStyle(); // fs |= FontStyle.Bold; // fs |= FontStyle.Underline; // // app2.Font = new Font(app2.Font.FontFamily, app2.Font.Size, fs); // app2.DrawString(e.Cache, // "M'ID:" + row["strMembershipID"].ToString() + ", S'Code: " + aptViewInfo.DisplayText, // rect1, strFormat); // // app.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; // app.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; // // Rectangle rect2 = new Rectangle(e.Bounds.X, e.Bounds.Y + 5, e.Bounds.Width, e.Bounds.Height + 5); // // app.DrawString(e.Cache, aptViewInfo.DisplayDescription, rect2, app.TextOptions.GetStringFormat()); // // e.Handled = true; } } } }
/// <summary> /// Add your code to obtain a custom field value and fill the editor with data. /// </summary> public override void LoadFormData(DevExpress.XtraScheduler.Appointment appointment) { goodsBindingSource.DataSource = BLLFty.Create <BaseBLL>().GetListBy <Goods>(o => o.Type == (int)GoodsBigType.Mold); wageDesignBindingSource.DataSource = BLLFty.Create <BaseBLL>().GetListBy <WageDesign>(null); //if (appointment.CustomFields["UniqueID"] != null) // prevApt = ((List<Appointments>)MainForm.dataSourceList[typeof(Appointments)]).FirstOrDefault(o => o.UniqueID == (Int64)appointment.CustomFields["UniqueID"]); if (appointment.CustomFields["GoodsID"] == null) { lueGoods.EditValue = null; } else { goodsID = new Guid(appointment.CustomFields["GoodsID"].ToString()); lueGoods.EditValue = goodsID; } //if (prevApt != null) //{ // if (prevApt.GoodsID == null) // CheckedRowIndex = 0; // else // goodsID = prevApt.GoodsID.Value; // ManHour = prevApt.ManHour; // weight = prevApt.Weight; // if (prevApt.WageDesignID == null) // CheckedRowIndex = 0; // else // { // WageDesignID = prevApt.WageDesignID.Value.ToString(); // CheckedRow = ((List<WageDesign>)MainForm.dataSourceList[typeof(WageDesign)]).Find(o => o.ID == new Guid(WageDesignID)); // } // if (!string.IsNullOrEmpty(prevApt.Location)) // tbLocation.EditValue = decimal.Parse(prevApt.Location); // lueGoods.EditValue = goodsID; // seManHour.EditValue = ManHour; // txtWeight.EditValue = weight; //} //else // CheckedRowIndex = 0; if (appointment.CustomFields["ManHour"] != null) { ManHour = decimal.Parse(appointment.CustomFields["ManHour"].ToString()); } seManHour.EditValue = ManHour; if (appointment.CustomFields["Weight"] != null) { weight = decimal.Parse(appointment.CustomFields["Weight"].ToString()); } txtWeight.EditValue = weight; if (appointment.CustomFields["WageDesignID"] == null) { CheckedRowIndex = 0; } else { WageDesignID = appointment.CustomFields["WageDesignID"].ToString(); CheckedRow = BLLFty.Create <BaseBLL>().GetListBy <WageDesign>(o => o.ID == new Guid(WageDesignID)).FirstOrDefault(); } GetTotal(); if (!string.IsNullOrEmpty(appointment.Location)) { tbLocation.EditValue = decimal.Parse(appointment.Location); } edtShowTimeAs.SelectedIndex = int.Parse(appointment.StatusKey.ToString()); //if (appointment.CustomFields["AMT"] != null) //{ // amt = decimal.Parse(appointment.CustomFields["AMT"].ToString()); // tbLocation.EditValue = amt;//AMT可手动修改,所以值以最后保存值为主 //} base.LoadFormData(appointment); }
private void schedulerStorage1_AppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { DevExpress.XtraScheduler.Appointment apt = e.Object as DevExpress.XtraScheduler.Appointment; }
void barManager_ItemClick(object sender, ItemClickEventArgs e) { try { if (e.Item.Caption.Equals("Copy")) { radialMenu1.Collapse(true); DevExpress.XtraScheduler.Appointment apt = schedulerControl1.SelectedAppointments[0]; copiedAppointment = apt.Copy(); } else if (e.Item.Caption.Equals("Paste")) { if (copiedAppointment != null && dateSelected) { radialMenu1.Collapse(true); copiedAppointment.Start = selectedDate; schedulerStorage1.Appointments.Add(copiedAppointment); } } else if (e.Item.Caption.Equals("Delete")) { radialMenu1.Collapse(true); var apptTemp = this.schedulerControl1.SelectedAppointments[0]; using (var context = new LorikeetAppEntities()) { var apptID = (from a in context.Appointments where a.Subject == apptTemp.Subject && DbFunctions.TruncateTime(a.StartDate) == DbFunctions.TruncateTime(apptTemp.Start) select a).DefaultIfEmpty().First(); var appointmentsToRemove = (from atr in context.AppointmentMembers where atr.AppointmentsID == apptID.UniqueID select atr).ToList(); foreach (var a in appointmentsToRemove) { context.AppointmentMembers.Remove(a); context.SaveChanges(); } var notesToRemove = (from ntr in context.Notes where DbFunctions.TruncateTime(ntr.Date) == DbFunctions.TruncateTime(apptID.StartDate) && ntr.Notes == "Member attended " + apptTemp.Subject + " group" select ntr).ToList(); foreach (var ntr in notesToRemove) { context.Notes.Remove(ntr); context.SaveChanges(); } } schedulerStorage1.Appointments.Remove(apptTemp); appointmentsTableAdapter.Update(lorikeetAppDataSet); lorikeetAppDataSet.AcceptChanges(); } else if (e.Item.Caption.Equals("New")) { radialMenu1.Collapse(true); DevExpress.XtraScheduler.Appointment appointmentNew = schedulerStorage1.CreateAppointment(AppointmentType.Normal); appointmentNew.Start = schedulerControl1.SelectedInterval.Start; appointmentNew.End = schedulerControl1.SelectedInterval.End; var form = new OutlookAppointmentForm(schedulerControl1, appointmentNew, false); form.ShowDialog(this); } else if (e.Item.Caption.Equals("Appointment")) { radialMenu1.Collapse(true); DevExpress.XtraScheduler.Appointment apt = schedulerControl1.SelectedAppointments[0]; var form = new OutlookAppointmentForm(schedulerControl1, apt, false); form.ShowDialog(this); } else if (e.Item.Caption.Equals("Members")) { radialMenu1.Collapse(true); DevExpress.XtraScheduler.Appointment apt = schedulerControl1.SelectedAppointments[0]; var form = new FormEditAppointmentMembers(apt, staffID); form.ShowDialog(this); } else if (e.Item.Caption.Equals("Attendance")) { if (schedulerControl1.SelectedAppointments.Count < 1) { DateTime date = schedulerControl1.SelectedInterval.Start; radialMenu1.Collapse(true); var form = new FormEditAttendance(date, staffID); form.ShowDialog(this); } } } catch (Exception ex) { MessageBox.Show(MiscStuff.GetAllMessages(ex)); } }
private void PopulateResourceEditors(DevExpress.XtraScheduler.Appointment apt, AppointmentFormTemplateContainer container) { }
DevExpress.XtraScheduler.Appointment CreateApp(DateTime startDateTime, int hours, int minutes, string subjet) { DevExpress.XtraScheduler.Appointment a = new DevExpress.XtraScheduler.Appointment(startDateTime, new TimeSpan(hours, minutes, 0), subjet); return a; }
private void schedulerStorage1_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e) { //gets the newly created Devexpress appointment; DevExpress.XtraScheduler.Appointment app = e.Objects[0] as DevExpress.XtraScheduler.Appointment; //********************************************************* //questo codice è inserito per risolvere il problema dell'assegnazione della risorsa //dopo il grag drop DevExpress.XtraScheduler.Resource ee = app.ResourceId as DevExpress.XtraScheduler.Resource; //questa situazione si verifica quando lo scheduler non è stato in grado //di assegnare una risorsa all'appuntamento creato nella funzione GetDragData //e pertanto assegna la risorsa "All" all'appuntamento if (ee != null) { Customer ccc = app.GetValue(schedulerStorage1, "Customer") as Customer; if (ccc != null) { app.SetValue(schedulerStorage1, "Resource", ccc.Resource); app.ResourceId = ccc.Resource.Id; } else { WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource t = new ResourceHandler().GetAll()[0] as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource; app.SetValue(schedulerStorage1, "Resource", t); app.ResourceId = t.Id; } } else { app.SetValue(schedulerStorage1, "Resource", new ResourceHandler().GetElementById(app.ResourceId.ToString()) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource); } //****************************************************************++ //imposto per sicurezza il campo allday a false; app.AllDay = false; ////i get my custom object MyAppointment a = app.GetSourceObject(schedulerStorage1) as MyAppointment; ////i save on my db AppointmentHandler h = new AppointmentHandler(); try { h.SaveOrUpdate(a); } catch (Exception ex) { WIN.SCHEDULING_APP.GUI.Utility.ErrorHandler.Show(ex); return; } //notifico l'id all'oggetto appena creato Key newId = a.Key; app.SetValue(schedulerStorage1, "Key", newId); //Appointment app1 = app.Copy(); //app1.Start = DateTime.Now.AddHours(2); //schedulerStorage1.Appointments.Add(app1); //foreach (Appointment item in schedulerStorage1 .Appointments.Items ) //{ // MyAppointment a1 = app.GetSourceObject(schedulerStorage1) as MyAppointment; //} }
static void FillAppointmentsStorage(AppointmentCollection c) { DevExpress.XtraScheduler.Appointment wAppointment; using (DataClasses1DataContext dc = new DataClasses1DataContext()) { foreach (Appointment a in dc.Appointments) { wAppointment = new DevExpress.XtraScheduler.Appointment (a.Start.Value,a.End.Value); wAppointment.Subject = a.Subject; wAppointment.StatusId = a.Status.Value; c.Add(wAppointment); } } }
private void scRandevuStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { deleteResult = MessageBox.Show("Silmek istediğinize emin misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); currentAppointment = (DevExpress.XtraScheduler.Appointment)e.Object; }
public CustomAppointmentForm1(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt) : base(control, apt) { InitializeComponent(); }
public CustomAppointmentForm(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm) : base(control, apt, openRecurrenceForm) { InitializeComponent(); this.edtStartTime.Properties.Mask.EditMask = "T"; this.edtEndTime.Properties.Mask.EditMask = "T"; }
/// <summary> /// Add your code to obtain a custom field value and fill the editor with data. /// </summary> public override void LoadFormData(DevExpress.XtraScheduler.Appointment appointment) { base.LoadFormData(appointment); }
public MyCustomEditForm(SchedulerControl control, DevExpress.XtraScheduler.Appointment apt, bool openRecurrenceForm) { this.openRecurrenceForm = openRecurrenceForm; this.controller = new MyAppointmentFormController(control, apt); this.apt = apt; this.control = control; // // Required for Windows Form Designer support // InitializeComponent(); UpdateForm(); // // TODO: Add any constructor code after InitializeComponent call // }
/// <summary> /// Add your code to notify that any custom field is changed. Return true if a custom field is changed, otherwise false. /// </summary> public override bool IsAppointmentChanged(DevExpress.XtraScheduler.Appointment appointment) { return(false); }
protected internal virtual AppointmentFormController CreateController(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt) { return(new AppointmentFormController(control, apt)); }
// Set the current appointment. public void SetAppointment(DevExpress.XtraScheduler.Appointment newApt) { apt = newApt; }
public AppointmentFormOutlook2007Style(DevExpress.XtraScheduler.SchedulerControl control, DevExpress.XtraScheduler.Appointment apt) : this(control, apt, false) { }
private bool IsIntersectingWithAnotherAppointment(DevExpress.XtraScheduler.Appointment appointment, DevExpress.XtraScheduler.ResourceIdCollection resourceIdCollection) { AppointmentBaseCollection abc = schedulerStorage1.GetAppointments(appointment.Start, appointment.End); return(abc.Count > 0? true:false); }