public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; IAppointmentStorageBase appointmentStorage = container.Control.Storage.Appointments; IAppointmentLabel label = appointmentStorage.Labels.GetById(apt.LabelKey); IAppointmentStatus status = appointmentStorage.Statuses.GetById(apt.StatusKey); edtLabel.SelectedIndex = appointmentStorage.Labels.IndexOf(label); edtStatus.SelectedIndex = appointmentStorage.Statuses.IndexOf(status); PopulateResourceEditors(apt, container); AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (apt.HasReminder) { cbReminder.Value = apt.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } //btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; JSProperties.Add("cpHasExceptions", apt.HasExceptions); //btnDelete.Enabled = !container.IsNewAppointment; }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; edtLabel.SelectedIndex = apt.LabelId; edtStatus.SelectedIndex = apt.StatusId; if (!Object.Equals(apt.ResourceId, Resource.Empty.Id)) { edtResource.Value = apt.ResourceId.ToString(); } else { edtResource.Value = SchedulerIdHelper.EmptyResourceId; } AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { cbReminder.Value = container.Appointment.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; //btnDelete.Enabled = !container.IsNewAppointment; }
protected void RenderRecurrenceControl(bool isRecurring) { if (this.recurrenceControl != null) { this.recurrenceControl.Visible = isRecurring; return; } AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; this.recurrenceControl = new AppointmentRecurrenceControl(); recurrenceControl.ID = "RecurrenceControl1"; recurrenceControl.Visible = isRecurring;//container.ShouldShowRecurrence; recurrenceControl.DayNumber = container.RecurrenceDayNumber; recurrenceControl.End = container.RecurrenceEnd; recurrenceControl.Month = container.RecurrenceMonth; recurrenceControl.OccurrenceCount = container.RecurrenceOccurrenceCount; recurrenceControl.Periodicity = container.RecurrencePeriodicity; recurrenceControl.RecurrenceRange = container.RecurrenceRange; recurrenceControl.Start = container.RecurrenceStart; recurrenceControl.WeekDays = container.RecurrenceWeekDays; recurrenceControl.WeekOfMonth = container.RecurrenceWeekOfMonth; recurrenceControl.RecurrenceType = container.RecurrenceType; recurrenceControl.IsFormRecreated = container.IsFormRecreated; RecurrencePanel.Controls.Add(recurrenceControl); recurrenceControl.EditorsInfo = new EditorsInfo(container.Control, container.Control.Styles.FormEditors, container.Control.Images.FormEditors, container.Control.Styles.Buttons); }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; edtLabel.SelectedIndex = (int)apt.LabelKey; edtStatus.SelectedIndex = (int)apt.StatusKey; if (!Object.Equals(apt.ResourceId, ResourceEmpty.Id)) { edtResource.Value = apt.ResourceId.ToString(); } else { edtResource.Value = SchedulerIdHelper.EmptyResourceId; } AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { cbReminder.Value = container.Appointment.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } btnOk.ClientSideEvents.Click = string.Format("function() {{ if (confirm('Apply changes?')) ASPx.AppointmentSave('{0}'); }}", container.Control.ClientID); btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; }
private void PopulateResourceEditors(Appointment apt, AppointmentFormTemplateContainer container) { if (ResourceSharing) { ASPxGridView gvMultiResource = ddResource.FindControl("gvMultiResource") as ASPxGridView; if (gvMultiResource == null || Page.Request["__CALLBACKID"].Contains(gvMultiResource.ID)) { return; } SetGridViewSelectedRows(gvMultiResource, apt.ResourceIds); ddResource.JSProperties.Add("cp_Caption_ResourceNone", SchedulerLocalizer.GetString(SchedulerStringId.Caption_ResourceNone)); } else { if (!Object.Equals(apt.ResourceId, ResourceEmpty.Id)) { edtResource.Value = apt.ResourceId.ToString(); } else { edtResource.Value = SchedulerIdHelper.EmptyResourceId; } } }
protected override void PrepareChildControls() { AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; ASPxScheduler control = container.Control; AppointmentRecurrenceForm1.EditorsInfo = new EditorsInfo(control, control.Styles.FormEditors, control.Images.FormEditors, control.Styles.Buttons); base.PrepareChildControls(); }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; DevExpress.XtraScheduler.Appointment apt = container.Appointment; PopulateResourceEditors(apt, container); AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { } else { } btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; //fill data on Edit if (container.Appointment.CustomFields["PatientID"] != null) { cbDoctors.SelectedIndex = cbDoctors.Items.IndexOfValue(container.Appointment.CustomFields["DoctorID"].ToString()); cbPatients.SelectedIndex = cbPatients.Items.IndexOfValue(container.Appointment.CustomFields["PatientID"].ToString()); cbClinics.SelectedIndex = cbClinics.Items.IndexOfValue(container.Appointment.CustomFields["ClinicID"].ToString()); cbStatus.SelectedIndex = cbStatus.Items.IndexOfText(container.Appointment.CustomFields["Status"].ToString()); } //btnDelete.Enabled = !container.IsNewAppointment; }
private void PopulateResourceEditors(Appointment apt, AppointmentFormTemplateContainer container) { if (ResourceSharing) { ASPxListBox edtMultiResource = ddResource.FindControl("edtMultiResource") as ASPxListBox; if (edtMultiResource == null) { return; } SetListBoxSelectedValues(edtMultiResource, apt.ResourceIds); List <String> multiResourceString = GetListBoxSeletedItemsText(edtMultiResource); string stringResourceNone = SchedulerLocalizer.GetString(SchedulerStringId.Caption_ResourceNone); ddResource.Value = stringResourceNone; if (multiResourceString.Count > 0) { ddResource.Value = String.Join(", ", multiResourceString.ToArray()); } ddResource.JSProperties.Add("cp_Caption_ResourceNone", stringResourceNone); } else { if (!Object.Equals(apt.ResourceId, ResourceEmpty.Id)) { edtResource.Value = apt.ResourceId.ToString(); } else { edtResource.Value = SchedulerIdHelper.EmptyResourceId; } } }
void PrepareChildControls() { AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; ASPxScheduler control = container.Control; AppointmentRecurrenceForm1.EditorsInfo = new EditorsInfo(control, control.Styles.FormEditors, control.Images.FormEditors); ASPxEditBase[] edits = new ASPxEditBase[] { lblSubject, tbSubject, lblLocation, tbLocation, lblLabel, edtLabel, lblStartDate, edtStartDate, lblEndDate, edtEndDate, lblStatus, edtStatus, lblAllDay, chkAllDay, lblResource, edtResource, tbDescription }; foreach (ASPxEditBase edit in edits) { edit.ParentSkinOwner = control; edit.ParentStyles = control.Styles.FormEditors; edit.ParentImages = control.Images.FormEditors; } ASPxButton[] buttons = new ASPxButton[] { btnOk, btnCancel, btnDelete }; foreach (ASPxButton button in buttons) { button.ParentSkinOwner = control; button.ControlStyle.CopyFrom(control.Styles.FormButton); } }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; edtLabel.Value = container.Control.Storage.Appointments.Labels.GetById(apt.LabelKey); edtStatus.Value = container.Control.Storage.Appointments.Statuses.GetById(apt.StatusKey); PopulateResourceEditors(apt, container); AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { cbReminder.Value = container.Appointment.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; //btnDelete.Enabled = !container.IsNewAppointment; }
protected override void Render(System.Web.UI.HtmlTextWriter writer) { AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; ASPxScheduler control = container.Control; RecurrenceControl.EditorsInfo = new EditorsInfo(control, control.Styles.FormEditors, control.Images.FormEditors, control.Styles.Buttons); RecurrenceControl.Visible = chkRecurrence.Checked && chkRecurrence.Visible; base.Render(writer); }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; IAppointmentStorageBase appointmentStorage = container.Control.Storage.Appointments; IAppointmentLabel label = appointmentStorage.Labels.GetById(apt.LabelKey); IAppointmentStatus status = appointmentStorage.Statuses.GetById(apt.StatusKey); edtLabel.ValueType = apt.LabelKey.GetType(); edtLabel.SelectedIndex = appointmentStorage.Labels.IndexOf(label); edtStatus.ValueType = apt.StatusKey.GetType(); edtStatus.SelectedIndex = appointmentStorage.Statuses.IndexOf(status); PopulateResourceEditors(apt, container); BindSubjectCombobox(); cbSubject.Value = container.Subject; tbCustomInfo.Text = container.Appointment.CustomFields["ApptCustomInfo"] != null ? container.Appointment.CustomFields["ApptCustomInfo"].ToString() : ""; AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (apt.HasReminder) { cbReminder.Value = apt.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } if (TimeZonesEnabled) { cbTimeZone.DataSource = TimeZoneInfo.GetSystemTimeZones(); cbTimeZone.ValueField = "Id"; cbTimeZone.TextField = "DisplayName"; cbTimeZone.DataBind(); cbTimeZone.Value = container.TimeZoneId; cbTimeZone.Enabled = apt.Type == AppointmentType.Normal || apt.Type == AppointmentType.Pattern; } //btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; JSProperties.Add("cpHasExceptions", apt.HasExceptions); //btnDelete.Enabled = !container.IsNewAppointment; }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; edtLabel.SelectedIndex = apt.LabelId; edtStatus.SelectedIndex = apt.StatusId; AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { cbReminder.Value = container.Appointment.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } IList resources = container.ResourceDataSource as IList; int count = this.rpResources.Items.Count; for (int i = 0; i < count; i++) { string resourceIdString = ((ListEditItem)resources[i]).Value.ToString(); string caption = ((ListEditItem)resources[i]).Text; if (resourceIdString == "null") { continue; } int resourceId = int.Parse(resourceIdString); RepeaterItem repeaterItem = this.rpResources.Items[i]; ASPxCheckBox chkBox = repeaterItem.FindControl("chkResource") as ASPxCheckBox; ASPxHiddenField hiddenField = repeaterItem.FindControl("hfResource") as ASPxHiddenField; chkBox.Text = caption; chkBox.Checked = apt.ResourceIds.Contains(resourceId); hiddenField.Set("resourceId", resourceId); } btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; }
protected void btnSave_Click(object sender, EventArgs e) { AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; if (cbPatients.SelectedItem != null || cbDoctors.SelectedItem != null || cbClinics.SelectedItem != null || cbStatus.SelectedItem != null) { if (container.IsNewAppointment) { AppointmentViewModelFull app = new AppointmentViewModelFull() { ClinicID = int.Parse(cbClinics.SelectedItem.Value.ToString()), DoctorID = int.Parse(cbDoctors.SelectedItem.Value.ToString()), PatientID = int.Parse(cbPatients.SelectedItem.Value.ToString()), start_date = edtStartDate.Date, end_date = edtEndDate.Date, Reason = string.Empty, Status = cbStatus.SelectedItem.Text, text = tbDescription.Text }; AppointmentRepository apprep = new AppointmentRepository(); apprep.AddNewAppointment(app); } else { AppointmentViewModelFull app = new AppointmentViewModelFull() { id = int.Parse(container.Appointment.Id.ToString()), ClinicID = int.Parse(cbClinics.SelectedItem.Value.ToString()), DoctorID = int.Parse(cbDoctors.SelectedItem.Value.ToString()), PatientID = int.Parse(cbPatients.SelectedItem.Value.ToString()), start_date = edtStartDate.Date, end_date = edtEndDate.Date, Reason = string.Empty, Status = cbStatus.SelectedItem.Text, text = tbDescription.Text }; AppointmentRepository apprep = new AppointmentRepository(); apprep.alterAppointment(app); } Response.Redirect("~/Appoiment/Appoiments.aspx"); } else { //warining } }
protected void PrepareChildControls() { AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; scheduler = container.Control; if (container.Appointment.Id != null) { HdnAppId.Value = container.Appointment.Id.ToString(); HdnType.Value = container.Appointment.Type.ToString(); } ddlVisit.Value = container.CustomFields[CustomFieldNames.VISIT_TYPE_ID]; ddlDoctor.Value = container.CustomFields[CustomFieldNames.SZ_DOCTOR_ID]; ddlPatient.Value = container.CustomFields[CustomFieldNames.SZ_PATIENT_ID]; //AppointmentRecurrenceForm1.EditorsInfo = new EditorsInfo(control, control.Styles.FormEditors, control.Images.FormEditors, control.Styles.Buttons); // base.PrepareChildControls(); }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; ASPxTextBoxSubject.Text = container.Subject; ASPxDateEditStart.Value = container.Start; ASPxDateEditEnd.Value = container.End; ASPxMemoDescription.Text = container.Appointment.Description; BindComboBoxes(); if (container.CustomFields["AppointmentCompany"] != null) { ASPxComboBoxCompany.Value = container.CustomFields["AppointmentCompany"]; FillContactComboBox(container.CustomFields["AppointmentCompany"].ToString()); } if (container.CustomFields["AppointmentContact"] != null) { ASPxComboBoxContact.Value = container.CustomFields["AppointmentContact"]; } PopulateResourceEditors(container.Appointment, container); AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { cbReminder.Value = container.Appointment.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } ASPxButtonOk.ClientSideEvents.Click = container.SaveHandler; ASPxButtonCancel.ClientSideEvents.Click = container.CancelHandler; ASPxButtonDelete.ClientSideEvents.Click = container.DeleteHandler; }
private void PopulateResourceEditors(Appointment apt, AppointmentFormTemplateContainer container) { if(ResourceSharing) { ASPxListBox edtMultiResource = ddResource.FindControl("edtMultiResource") as ASPxListBox; if(edtMultiResource == null) return; SetListBoxSelectedValues(edtMultiResource, apt.ResourceIds); List<String> multiResourceString = GetListBoxSeletedItemsText(edtMultiResource); string stringResourceNone = SchedulerLocalizer.GetString(SchedulerStringId.Caption_ResourceNone); ddResource.Value = stringResourceNone; if(multiResourceString.Count > 0) ddResource.Value = String.Join(", ", multiResourceString.ToArray()); ddResource.JSProperties.Add("cp_Caption_ResourceNone", stringResourceNone); } else { if(!Object.Equals(apt.ResourceId, Resource.Empty.Id)) edtResource.Value = apt.ResourceId.ToString(); else edtResource.Value = SchedulerIdHelper.EmptyResourceId; } }
private void PopulateResourceEditors(DevExpress.XtraScheduler.Appointment apt, AppointmentFormTemplateContainer container) { }