protected void rsAppointments_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            string status = e.Appointment.Attributes["Status"];
            //string status = Convert.ToString(DataBinder.Eval(e.Appointment.DataItem, "Status"));
            DropDownList ddlStatus = (DropDownList)e.Container.FindControl("ddlStatus");

            ddlStatus = JG_Prospect.Utilits.FullDropDown.FillUserStatus(ddlStatus, "", "", false);
            LinkButton lbtnReSchedule = (LinkButton)e.Container.FindControl("lbtnReSchedule");

            if (ddlStatus != null && !string.IsNullOrEmpty(status) && ddlStatus.Items.FindByValue(status) != null)
            {
                ddlStatus.SelectedValue = status;

                //if (ddlStatus.SelectedValue == "InterviewDate")
                if (ddlStatus.SelectedValue == Convert.ToInt16(JGConstant.InstallUserStatus.InterviewDate).ToString())
                {
                    lbtnReSchedule.Visible = true;
                }
                else
                {
                    lbtnReSchedule.Visible = false;
                }
            }

            e.Appointment.Subject = e.Appointment.Attributes["EventName"];
            if (!string.IsNullOrEmpty(e.Appointment.Attributes["AssignedUserFristNames"]))
            {
                e.Appointment.Subject = string.Concat(e.Appointment.Subject, " ", e.Appointment.Attributes["AssignedUserFristNames"]).Trim();
            }
        }
예제 #2
0
        protected void scdTaskSchedule_OnCreated(object sender, AppointmentCreatedEventArgs e)
        {
            try
            {
                if (SessionManager.IsUserAgentType("ipad,iphone"))
                {
                    ImageButton btn = (ImageButton)e.Container.FindControl("btnTaskDetails");
                    btn.Visible = true;
                }

                if (hfScheduleScope.Value == false.ToString().ToLower() || string.IsNullOrEmpty(e.Appointment.ID.ToString()))       // only enable task link if schedule scope is by USER  (i.e. disable if PLANT view)
                {
                    //Control div = (Control)e.Container.FindControl("divInactive");
                    //div.Visible = true;
                    LinkButton lnk = (LinkButton)e.Container.FindControl("lnkScheduleItem");
                    lnk.Enabled = false;
                    //lnk.Visible = false;
                    lnk = (LinkButton)e.Container.FindControl("lnkScheduleItem2");
                    //lnk.Visible = false;
                    lnk.Enabled = false;
                }
            }
            catch
            {
                ;
            }
        }
예제 #3
0
        protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            sp_Availablity_DM cAvail = new sp_Availablity_DM();

            string strVolID = "6CD40064-CF05-4B55-93C0-6E4D7F9CCE34";
            Guid VolID = new Guid(strVolID);
            cAvail.VolID = VolID;
            cAvail.AddrID = 1;
        }
예제 #4
0
        private void AddAppointmentClick(object args)
        {
            AppointmentCreatedEventArgs appCreatedEventArgs = (AppointmentCreatedEventArgs)args;

            _appointmentService.AddAppointment(appCreatedEventArgs.CreatedAppointment.Subject,
                                               appCreatedEventArgs.CreatedAppointment.Start,
                                               appCreatedEventArgs.CreatedAppointment.End,
                                               "405");
        }
 /// <summary>
 /// Handles the <see cref="RadScheduler.AppointmentCreated"/> event of the <see cref="AppointmentCalendar"/> control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Telerik.Web.UI.AppointmentCreatedEventArgs"/> instance containing the event data.</param>
 private void AppointmentsCalendar_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
 {
     if (e.Appointment.Visible && !this.IsAppointmentRegisteredForTooltip(e.Appointment))
     {
         foreach (AppointmentControl appointmentControl in e.Appointment.AppointmentControls)
         {
             this.AppointmentToolTipManager.TargetControls.Add(appointmentControl.ClientID, ((int)e.Appointment.ID).ToString(CultureInfo.InvariantCulture), true);
         }
     }
 }
 /// <summary>
 /// Handles the <see cref="RadScheduler.AppointmentCreated"/> event of the <see cref="AppointmentCalendar"/> control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Telerik.Web.UI.AppointmentCreatedEventArgs"/> instance containing the event data.</param>
 private void AppointmentsCalendar_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
 {
     if (e.Appointment.Visible && !this.IsAppointmentRegisteredForTooltip(e.Appointment))
     {
         foreach (AppointmentControl appointmentControl in e.Appointment.AppointmentControls)
         {
             this.AppointmentToolTipManager.TargetControls.Add(appointmentControl.ClientID, ((int)e.Appointment.ID).ToString(CultureInfo.InvariantCulture), true);
         }
     }
 }
        protected void rsAppointments_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            string status = e.Appointment.Attributes["Status"];

            DropDownList ddlStatus = (DropDownList)e.Container.FindControl("ddlStatus");

            if (ddlStatus != null)
            {
                ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(status.ToString()));
            }
        }
예제 #8
0
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        if (e.Appointment.Visible && !IsAppointmentRegisteredForTooltip(e.Appointment))
        {
            string id = e.Appointment.ID.ToString();

            foreach (string domElementID in e.Appointment.DomElements)
            {
                RadToolTipManager1.TargetControls.Add(domElementID, id, true);
            }
        }
    }
예제 #9
0
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        if (e.Appointment.Visible && !IsAppointmentRegisteredForTooltip(e.Appointment))
        {
            string id = e.Appointment.ID.ToString();

            foreach (string domElementID in e.Appointment.DomElements)
            {
                RadToolTipManager1.TargetControls.Add(domElementID, id, true);
            }
        }
    }
예제 #10
0
    protected void EventScheduler_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        if (!e.Appointment.Visible || IsAppointmentRegisteredForTooltip(e.Appointment))
        {
            return;
        }

        var id = e.Appointment.ID.ToString();

        foreach (var domElementID in e.Appointment.DomElements)
        {
            EventToolTipManager.TargetControls.Add(domElementID, id, true);
        }
    }
예제 #11
0
        /// <summary>
        /// Handles the AppointmentCreated event of the EventsCalendarDisplay control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.AppointmentCreatedEventArgs"/> instance containing the event data.</param>
        private void EventsCalendarDisplay_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            if (!e.Appointment.Visible || this.IsAppointmentRegisteredForToolTip(e.Appointment))
            {
                return;
            }

            var appointmentId = e.Appointment.ID.ToString();

            foreach (var domElementId in e.Appointment.DomElements)
            {
                this.EventsCalendarToolTipManager.TargetControls.Add(domElementId, appointmentId, true);
            }
        }
예제 #12
0
        protected void VaaScheduler_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            try
            {
                List <string> users = new List <string>();
                foreach (Resource user in e.Appointment.Resources.GetResourcesByType("User"))
                {
                    users.Add(user.Key.ToString());
                }
                var schedule = _scheduleManagement.GetScheduleById(Convert.ToInt16(e.Appointment.ID));

                if (schedule != null)
                {
                    Label assignedTo = (Label)e.Container.FindControl("AssignedTo");

                    var userIds = schedule.UserID;

                    if (userIds != null)
                    {
                        var usersArray = userIds.Split(new char[] { ',' });

                        var firstnames = "";

                        for (int i = 0; i < usersArray.Length; i++)
                        {
                            var user = _accountManagement.GetUserById(Convert.ToInt32(usersArray[i].Trim()));

                            firstnames += user.FirstName + ",";
                        }

                        if (firstnames.Contains(","))
                        {
                            firstnames = firstnames.Substring(0, firstnames.Length - 1);
                        }

                        assignedTo.Text = firstnames;
                    }
                    else
                    {
                        assignedTo.Text = "NONE";
                    }
                }
            }
            catch (Exception ex)
            {
                //write to Elma
                ErrorSignal.FromCurrentContext().Raise(ex);
            }
        }
예제 #13
0
 protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
 {
     if (e.Appointment.RecurrenceState == RecurrenceState.Master || e.Appointment.RecurrenceState == RecurrenceState.Occurrence)
     {
         System.Web.UI.WebControls.Panel recurrenceStateDiv = new System.Web.UI.WebControls.Panel();
         recurrenceStateDiv.CssClass = "rsAptRecurrence";
         e.Container.Controls.AddAt(0, recurrenceStateDiv);
     }
     if (e.Appointment.RecurrenceState == RecurrenceState.Exception)
     {
         System.Web.UI.WebControls.Panel recurrenceStateDiv = new System.Web.UI.WebControls.Panel();
         recurrenceStateDiv.CssClass = "rsAptRecurrenceException";
         e.Container.Controls.AddAt(0, recurrenceStateDiv);
     }
     Label1.Text = "";
 }
예제 #14
0
        private static void OnAppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            scheduleView = sender as RadScheduleView;
            var createdApp = e.CreatedAppointment as Appointment;

            var timeMarker = createdApp.TimeMarker as TimeMarker;
            var resourcers = createdApp.Resources;

            var currentMarkerResource = scheduleView.ResourceTypesSource.Cast <ResourceType>()
                                        .Select(a => a.Resources).Where(a => a.ResourceType == "TimeMarkers").FirstOrDefault();

            if (timeMarker != null)
            {
                var markers = new ObservableCollection <TimeMarker>(scheduleView.TimeMarkersSource.Cast <TimeMarker>().ToList());

                if (!createdApp.Resources.Any(a => a.ResourceType == currentMarkerResource.ResourceType))
                {
                    var newResource = currentMarkerResource.Where(a => a.DisplayName == timeMarker.TimeMarkerName).FirstOrDefault();

                    EditAppointment(createdApp, null, newResource);
                }
                else
                {
                    var oldMarker         = markers.Where(a => a.TimeMarkerName.Equals(createdApp.Resources.Select(b => b.ResourceName).FirstOrDefault())).First();
                    var currTimeMarkerRes = createdApp.Resources.Where(a => a.ResourceName.Equals(oldMarker.TimeMarkerName)).First();
                    var newResource       = currentMarkerResource.Where(a => a.DisplayName == timeMarker.TimeMarkerName).FirstOrDefault();

                    EditAppointment(createdApp, currTimeMarkerRes, newResource);
                }
            }
            else
            {
                var markers = new ObservableCollection <TimeMarker>(scheduleView.TimeMarkersSource.Cast <TimeMarker>().ToList());

                if (createdApp.Resources.Any(a => a.ResourceType == currentMarkerResource.ResourceType))
                {
                    var currentMarker = markers.Where(a => a.TimeMarkerName.Equals(createdApp.Resources.Select(b => b.ResourceName).FirstOrDefault())).First();
                    createdApp.TimeMarker = currentMarker;
                }
            }

            if (IsAppointmentChangedThroughDialog)
            {
                IsAppointmentChangedThroughDialog = false;
            }
        }
예제 #15
0
        protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            string    UserName     = Global.UserInfo.UserName;
            int       CalendarID   = int.Parse(e.Appointment.ID.ToString());
            BCalendar BobjCalendar = new BCalendar();
            OCalendar objCalendar  = new OCalendar();

            objCalendar = BobjCalendar.Get(CalendarID).First();
            if (objCalendar.UserCreate == UserName)
            {
                e.Appointment.AllowEdit   = true;
                e.Appointment.AllowDelete = true;
            }
            else
            {
                e.Appointment.AllowEdit   = false;
                e.Appointment.AllowDelete = false;
            }
        }
예제 #16
0
        private static void OnAppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            scheduleView = sender as RadScheduleView;
            var createdApp = e.CreatedAppointment as Appointment;

            var timeMarker = createdApp.TimeMarker as TimeMarker;
            var resourcers = createdApp.Resources;

            var currentMarkerResource = scheduleView.ResourceTypesSource.Cast<ResourceType>()
                .Select(a => a.Resources).Where(a => a.ResourceType == "TimeMarkers").FirstOrDefault();

            if (timeMarker != null)
            {
                var markers = new ObservableCollection<TimeMarker>(scheduleView.TimeMarkersSource.Cast<TimeMarker>().ToList());

                if (!createdApp.Resources.Any(a => a.ResourceType == currentMarkerResource.ResourceType))
                {
                    var newResource = currentMarkerResource.Where(a => a.DisplayName == timeMarker.TimeMarkerName).FirstOrDefault();
                    createdApp.Resources.Add(newResource);
                }
                else
                {
                    var oldMarker = markers.Where(a => a.TimeMarkerName.Equals(createdApp.Resources.Select(b => b.ResourceName).FirstOrDefault())).First();
                    var currTimeMarkerRes = createdApp.Resources.Where(a => a.ResourceName.Equals(oldMarker.TimeMarkerName)).First();
                    var newResource = currentMarkerResource.Where(a => a.DisplayName == timeMarker.TimeMarkerName).FirstOrDefault();

                    EditAppointment(createdApp, currTimeMarkerRes, newResource);
                }
            }
            else
            {
                var markers = new ObservableCollection<TimeMarker>(scheduleView.TimeMarkersSource.Cast<TimeMarker>().ToList());

                if (createdApp.Resources.Any(a => a.ResourceType == currentMarkerResource.ResourceType))
                {
                    var currentMarker = markers.Where(a => a.TimeMarkerName.Equals(createdApp.Resources.Select(b => b.ResourceName).FirstOrDefault())).First();
                    createdApp.TimeMarker = currentMarker;
                }
            }

            if (IsAppointmentChangedThroughDialog)
            {
                IsAppointmentChangedThroughDialog = false;
            }
        }
    //protected void UpdatePanel2_Load(object sender, EventArgs e)
    //{
    //    HttpCookie cookie = Request.Cookies["BrowserDate"];
    //    Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
    //    RadScheduler2.DataSource = dat.GetData("SELECT A.Header, AC.AdID, AC.DateTimeStart AS Start, AC.DateTimeEnd AS [End] FROM Ads A, Ad_Calendar AC WHERE A.Ad_ID=AC.AdID AND A.User_ID=" + Session["User"].ToString());
    //    RadScheduler2.DataBind();
    //    UpdatePanel2.Update();
    //}
    protected void RadScheduler2_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        DataSet ds = dat.GetData("SELECT A.Header, AC.AdID, AC.DateTimeStart AS Start, A.Featured, AC.DateTimeEnd AS [End] FROM Ads A, Ad_Calendar AC WHERE A.Ad_ID=AC.AdID AND A.User_ID=" + Session["UserToUse"].ToString());
        DataView dv = new DataView(ds.Tables[0], "AdID=" + e.Appointment.ID, "", DataViewRowState.CurrentRows);

        if (dv.Count > 0)
        {
            e.Appointment.ToolTip = "";
            RadToolTip newToolTip = new RadToolTip();
            newToolTip.Text = "<div style=\"padding: 10px;display: block; width: 200px;\" id=\"div" + e.Appointment.ID + "\"><a href=\"" + dat.MakeNiceName(e.Appointment.Subject) + "_" +
                e.Appointment.ID.ToString() + "_Ad\" class=\"AddLink\">" +
                e.Appointment.Subject + "</a>" +
                "<br/><br/>Start: " + dv[0]["Start"].ToString() +
                "<br/>End: " + dv[0]["End"].ToString() +
                "<br/><br/><br/><a href=\"javascript:OpenAdMsg('" +
                e.Appointment.ID + "');\"><img title=\"Send info to friends\" alt=\"Send info to friends\" style=\"padding-right: 5px;border: none;\" " +
                "src=\"NewImages/Envelope.png\" /></a><a href=\"javascript:OpenRadDeleteAd('div" + e.Appointment.ID + "', '" +
                e.Appointment.ID + "');\"\"><img style=\"border: none;\" title=\"Turn ad off.\" alt=\"Turn ad off.\" src=\"NewImages/DeleteCircle.png\" /></a></div>";

            if (bool.Parse(dv[0]["Featured"].ToString()))
            {
                e.Appointment.BorderColor = System.Drawing.Color.DarkOrange;
                e.Appointment.BorderStyle = BorderStyle.Solid;
            }

            newToolTip.TargetControlID = e.Appointment.ClientID;
            newToolTip.IsClientID = true;
            newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
            newToolTip.Animation = ToolTipAnimation.None;
            newToolTip.Position = ToolTipPosition.MiddleRight;
            newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
            newToolTip.Skin = "Sunset";
            ToolTipPanel2.Controls.Add(newToolTip);
        }
    }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        char[] delim = { ';' };
        string[] tokens = e.Appointment.ID.ToString().Split(delim);

        string aptmntID = tokens[0];
        string reOcurrID = tokens[1];
        string switchOn = tokens[2];

        DataView dv = new DataView();

        switch (switchOn)
        {
            case "1":
                dv = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
                "[End], E.Header, E.ID, E.Address, V.Name FROM Venues V, User_Calendar UC, Events E, " +
                "Event_Occurance EO WHERE E.Venue=V.ID AND EO.EventID=E.ID AND UC.EventID=E.ID AND UC.UserID=" +
                Session["UserToUse"].ToString() + " AND E.ID=" + aptmntID + " AND EO.ID=" + reOcurrID);
                break;
            case "2":
                dv = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
                "[End], E.Name, E.ID, EO.City + ' ' +EO.State + ' '+EO.Zip AS Address, E.Content FROM GroupEvent_Members UC, GroupEvents E, " +
                "GroupEvent_Occurance EO WHERE EO.GroupEventID=E.ID AND UC.GroupEventID=E.ID AND UC.UserID=" +
                Session["UserToUse"].ToString() + " AND E.ID=" + aptmntID + " AND EO.ID=" + reOcurrID);
                break;
            case "3":
                dv = dat.GetDataDV("SELECT EO.DateTimeStart AS Start, EO.DateTimeEnd AS " +
                "[End], E.Name, E.ID, EO.City + ' ' +EO.State + ' '+EO.Zip AS Address, E.Content FROM User_GroupEvent_Calendar UC, GroupEvents E, " +
                "GroupEvent_Occurance EO WHERE EO.GroupEventID=E.ID AND UC.GroupEventID=E.ID AND UC.UserID=" +
                Session["UserToUse"].ToString() + " AND E.ID=" + aptmntID + " AND EO.ID=" + reOcurrID);
                break;
            default: break;
        }

        if (dv.Count > 0)
        {
            e.Appointment.ToolTip = "";
            RadToolTip newToolTip = new RadToolTip();

            string addThis = "";
            string content = "";
            if (Session["UserToUse"].ToString() == Session["User"].ToString() && switchOn == "1")
            {
                addThis = "<a href=\"javascript:OpenRad('div" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', 'na');\"><img title=\"Send info to friends\" alt=\"Send info to friends\" style=\"border: none;padding-right: 5px;\" " +
                "src=\"NewImages/Envelope.png\" /></a><a href=\"javascript:OpenCommunication('div" + aptmntID + "', '" +
                aptmntID + "');\"><img style=\"border: none;padding-right: 5px;\" title=\"Set communication on/off for this event.\" alt=\"Set communication on/off for this event.\" src=\"NewImages/EventComment.png\" /></a>" +
                "<a href=\"javascript:OpenRadDelete('div" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', 'na');\"><img style=\"border: none;padding-right: 5px;\" title=\"Delete event from your calendar\" alt=\"Delete event from your calendar\" " +
                "src=\"NewImages/DeleteCircle.png\" /></a><a href=\"javascript:OpenAlarm('div" + aptmntID + "', '" +
                aptmntID + "', '" + reOcurrID + "');\"><img style=\"border: none;\" title=\"Set Reminder for this event\" alt=\"Set Reminder for this event\" " +
                "src=\"NewImages/Alarm.png\" /></a>";
            }

            if (Session["UserToUse"].ToString() == Session["User"].ToString() && switchOn != "1")
            {
                addThis = "<a href=\"javascript:OpenRad('divG" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', '" + reOcurrID + "');\"><img title=\"Send info to friends\" " +
                "alt=\"Send info to friends\" style=\"border: none;padding-right: 5px;\" " +
                "src=\"NewImages/Envelope.png\" /></a>" +
                "<a href=\"javascript:OpenRadDelete('divG" + aptmntID + "', '" +
                aptmntID + "', '" + switchOn + "', '" + reOcurrID + "');\"><img style=\"border: none;\" title=\"Delete " +
                "event from your calendar\" alt=\"Delete event from your calendar\" " +
                "src=\"NewImages/DeleteCircle.png\" /></a>";
            }

            if (switchOn == "1")
            {
                newToolTip.Text = "<div style=\"padding: 10px;display: block; width: 200px;\" id=\"div" + aptmntID +
                    "\"><a href=\"" + dat.MakeNiceName(dv[0]["Header"].ToString()) + "_" +
                    aptmntID + "_Event\" class=\"AddLink\">" +
                    dat.BreakUpString(dv[0]["Header"].ToString(), 20) + "</a>" +
                    "<br/><br/>" + dv[0]["Name"].ToString() +
                    "<br/>" + e.Appointment.Start.ToShortTimeString() +
                    "<br/>" + dv[0]["Address"].ToString() +
                    "<br/><br/><br/>" + addThis + "</div>";
            }

            newToolTip.TargetControlID = e.Appointment.ClientID;
            newToolTip.IsClientID = true;
            newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
            newToolTip.Animation = ToolTipAnimation.None;
            newToolTip.Position = ToolTipPosition.MiddleRight;
            newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
            newToolTip.Skin = "Sunset";
            ToolTipPanel.Controls.Add(newToolTip);
        }
    }
예제 #19
0
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {

    }
예제 #20
0
 protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
 {
 }
예제 #21
0
    protected void rsScheduler_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        LinkButton btnNavigate = (LinkButton)e.Container.FindControl("btnNavigate");

        btnNavigate.CommandArgument = e.Appointment.ID.ToString();
    }
예제 #22
0
 public void Save(AppointmentCreatedEventArgs e)
 {
     using (var db = new AppointmentContext())
     {
         var appointment = (Appointment)(e.CreatedAppointment);
         var newAppointment = new AppointmentModel()
         {
             Id = appointment.UniqueId,
             StartTime = appointment.Start,
             EndTime = appointment.End,
             Subject = appointment.Subject,
             Body = appointment.Body
         };
         db.AppointmentModels.Add(newAppointment);
         db.SaveChanges();
     }
 }
예제 #23
0
 /// <summary>
 ///     增加付款计划行
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void PaymentScheduleView_OnAppointmentCreated(object sender, AppointmentCreatedEventArgs e)
 {
     var scheduleView = sender as RadScheduleView;
     if (scheduleView != null)
     {
         var appointment = e.CreatedAppointment as PaymentAppointment;
         if (appointment == null)
         {
             return;
         }
         var convertToPaymentLines = new List<PaymentAppointment>();
         //是否循环,如果循环,则批量增加
         if (appointment.RecurrenceRule != null)
         {
             var occurrenceAppointment = appointment.RecurrenceRule.Pattern.GetOccurrences(appointment.Start);
             //循环时间集合
             var occurrenceDateTiems = occurrenceAppointment as DateTime[] ?? occurrenceAppointment.ToArray();
             var allPaymentAppointments = AppointmentConvertHelper.GetOccurrences(appointment,
                 occurrenceDateTiems); //所有循环的Appointment,包括当前Appointment
             _paymentAppointmentCollection.AddRange(allPaymentAppointments);
             convertToPaymentLines.AddRange(allPaymentAppointments);
             _paymentAppointmentCollection.Remove(appointment);
         }
         else
         {
             appointment.UniqueId = RandomHelper.Next().ToString(CultureInfo.InvariantCulture);
             convertToPaymentLines.Add(appointment);
         }
         //Appointment转化DTO,同时添加到需要增加的集合中
         AppointmentToPaymentLineConvert(convertToPaymentLines);
         RaisePropertyChanged(() => PaymentAppointmentCollection);
     }
 }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        try
        {
            HttpCookie cookie = Request.Cookies["BrowserDate"];
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

            char[] delim = { ';' };
            string[] calendarKeys = e.Appointment.ID.ToString().Split(delim);
            bool isGroup = bool.Parse(calendarKeys[0]);
            string EID = calendarKeys[1];
            string reoccurrID = calendarKeys[2];
            bool isVenue = false;
            DataView dvE = new DataView();
            DataView dvV = new DataView();

            DataView dvCountry = new DataView();

            string theDate = "";
            string eventLink = "";
            string venueStr = "";
            string address = "";
            string country = "";

            string eventColumnTitle = "";

            if (isGroup)
            {
                eventColumnTitle = "Name";
                country = dat.GetDataDV("SELECT * FROM Countries C, GroupEvent_Occurance GEO WHERE GEO.ID=" +
                        reoccurrID + " AND C.country_id=GEO.Country ")[0]["country_2_code"].ToString();

                dvE = dat.GetDataDV("SELECT * FROM GroupEvents E, GroupEvent_Occurance EO WHERE EO.ID=" + reoccurrID +
                    " and EO.GroupEventID=E.ID AND E.ID=" + EID);

                if (dvE[0]["VenueID"] != null)
                {
                    if (dvE[0]["VenueID"].ToString() != "")
                    {
                        isVenue = true;
                        dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["VenueID"].ToString());
                        venueStr = "<span style=\"color: #98cb2a; " +
                                            "font-weight: bold;text-decoration: underline; " +
                                            " cursor: pointer;\" onclick=\"CloseWindow(\'" + "../" +
                                            dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
                                            dvV[0]["ID"].ToString() + "_Venue" + "\');\">" +
                                            dvV[0]["Name"].ToString().Replace("'",
                                            " ").Replace("(", " ").Replace(")", " ") + "</span><br/>";
                    }

                }
                eventLink = dat.MakeNiceName(dvE[0]["Name"].ToString()) + "_" + reoccurrID + "_" +
                                        dvE[0]["ID"].ToString() + "_GroupEvent";

                if (!isVenue)
                {
                    if (dvE[0]["Country"].ToString() == "223")
                    {
                        address = dvE[0]["StreetNumber"].ToString() + " " + dvE[0]["StreetName"].ToString() +
                            " " + dvE[0]["StreetDrop"].ToString();
                    }
                    else
                    {
                        address = dvE[0]["Location"].ToString();
                    }
                }
                else
                {
                    address = dat.GetAddress(dvV[0]["Address"].ToString(),
                                dvV[0]["Country"].ToString() != "223").Trim();
                }

                address = address.Trim() + " " + dvE[0]["City"].ToString() + " " + dvE[0]["State"].ToString() +
                    " " + dvE[0]["Zip"].ToString() + " " + country;
            }
            else
            {
                eventColumnTitle = "Header";
                dvE = dat.GetDataDV("SELECT * FROM Events E, Event_Occurance EO WHERE EO.ID=" + reoccurrID +
                    " and EO.EventID=E.ID AND E.ID=" + EID);
                dvV = dat.GetDataDV("SELECT * FROM Venues WHERE ID=" + dvE[0]["Venue"].ToString());

                dvCountry = dat.GetDataDV("SELECT * FROM countries WHERE country_id=" + dvE[0]["Country"].ToString());
                country = dvCountry[0]["country_2_code"].ToString();
                if (country.ToLower() == "us")
                {
                    try
                    {
                        address = dat.GetAddress(dvV[0]["Address"].ToString(), false);
                    }
                    catch (Exception ex1)
                    {
                        address = "";
                    }
                }
                else
                {
                    address = dat.GetAddress(dvV[0]["Address"].ToString(), true);
                }
                address = address.Trim().Replace("'", "''").Replace("(", " ").Replace(")", " ") + " " +
                                        dvV[0]["City"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
                                        dvV[0]["State"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
                                        dvV[0]["Zip"].ToString().Replace("'", " ").Replace("(", " ").Replace(")", " ") + " " +
                                        country.Replace("'", " ").Replace("(", " ").Replace(")", " ");
                eventLink = dat.MakeNiceName(dvE[0]["Header"].ToString()) + "_" +
                                        dvE[0]["ID"].ToString() + "_Event";
                venueStr = "<span style=\"color: #98cb2a; " +
                                        "font-weight: bold;text-decoration: underline; " +
                                        " cursor: pointer;\" onclick=\"CloseWindow(\'" + "../" +
                                        dat.MakeNiceName(dvV[0]["Name"].ToString()) + "_" +
                                        dvV[0]["ID"].ToString() + "_Venue" + "\');\">" +
                                        dvV[0]["Name"].ToString().Replace("'",
                                        " ").Replace("(", " ").Replace(")", " ") + "</span><br/>";
            }

            theDate = dvE[0]["DateTimeStart"].ToString();
            RadToolTip newToolTip = new RadToolTip();

            newToolTip.Text = "<div class='AddLink' style=\"width: 200px;color: #cccccc; font-weight: normal;\">" +
                "<div style=\"color: #1fb6e7; font-weight: bold; text-decoration: " +
                "underline; float: left; cursor: pointer;\" onclick=\"CloseWindow('" + "../" +
                                        eventLink + "');\">" +
                                        dvE[0][eventColumnTitle].ToString().Replace("'", " ").Replace("(",
                                        " ").Replace(")", " ") + "</div><br/>on "+theDate+"<br/>at " + venueStr + address + "</div>";

            newToolTip.TargetControlID = e.Appointment.ClientID;
            newToolTip.IsClientID = true;
            newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
            newToolTip.Animation = ToolTipAnimation.None;
            newToolTip.Position = ToolTipPosition.MiddleRight;
            newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
            newToolTip.Skin = "Black";
            newToolTip.ID = isGroup.ToString() + EID + reoccurrID;
            ToolTipPanel.Controls.Add(newToolTip);
            if (Session["SelectToolTip"] != null)
            {
                if (Session["SelectToolTip"].ToString() == isGroup.ToString() + EID + reoccurrID)
                {
                    newToolTip.Show();
                    Session["SelectToolTip"] = null;
                }
            }
        }
        catch (Exception ex)
        {
            ErrorLabel.Text = ex.ToString();
        }
    }
예제 #25
0
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));

        DateTime timeEvent = DateTime.Parse(e.Appointment.ID.ToString());

        string dateStart = timeEvent.Month.ToString() + "/" + timeEvent.Day.ToString() + "/" + timeEvent.Year.ToString();

        DataView dv = dat.GetDataDV("SELECT *, GEO.ID AS GEOID FROM GroupEvents GE, GroupEvent_Occurance " +
            "GEO WHERE GE.ID=GEO.GroupEventID AND CONVERT(NVARCHAR,MONTH(GEO.DateTimeStart)) + '/' + " +
            "CONVERT(NVARCHAR,DAY(GEO.DateTimeStart)) + '/' +" +
            "CONVERT(NVARCHAR,YEAR(GEO.DateTimeStart)) = '" + dateStart + "' AND GE.GroupID=" + Request.QueryString["ID"].ToString());

        RadToolTip newToolTip = new RadToolTip();
        DateTime dt = new DateTime();
        string replaceIt = "";
        string content = "";
        newToolTip.Text = "<div style=\"display: block; width: 500px; color: #cccccc;\">";
        foreach (DataRowView row in dv)
        {
            dt = DateTime.Parse(row["DateTimeStart"].ToString());
            content = row["Content"].ToString();

            if (content.Length > 400)
            {
                content = content.Substring(0, 400) + "... <a href=\"" + dat.MakeNiceName(row["Name"].ToString()) +
                    "_" + row["GEOID"].ToString() + "_" +
                 row["GroupEventID"].ToString() + "_GroupEvent\" class=\"AddUnderLink\">Read More</a>";
            }

            replaceIt = dt.Month.ToString() + "/" + dt.Day.ToString() + "/" + dt.Year.ToString();
            newToolTip.Text += "<a href=\"" + dat.MakeNiceName(row["Name"].ToString()) + "_" +
                row["GEOID"].ToString() + "_" +
                 row["GroupEventID"].ToString() + "_GroupEvent\" class=\"AddUnderLink\" >" +
                dat.BreakUpString(row["Name"].ToString(), 50) + "</a>" +
                "<br/>" + row["DateTimeStart"].ToString().Replace(replaceIt, "") + " - " +
                row["DateTimeEnd"].ToString().Replace(replaceIt, "") + "<br/>" + content + "<br/><br/>";
        }
        newToolTip.Text += "</div>";
        newToolTip.TargetControlID = e.Appointment.ClientID;
        newToolTip.IsClientID = true;
        newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
        newToolTip.Animation = ToolTipAnimation.None;
        newToolTip.Position = ToolTipPosition.MiddleLeft;
        newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
        newToolTip.Skin = "Black";
        newToolTip.Width = 520;
        ToolTipPanel.Controls.Add(newToolTip);
    }
예제 #26
0
        public IEnumerable<IResult> SchedulerClosedDaysCreated(object sender, AppointmentCreatedEventArgs e)
        {
            AppClosedDay savingAppointment = ((AppClosedDay)e.CreatedAppointment);
            if (savingAppointment.IsNotNull()) {
                //SaveBuisnessClosedDay
                this.SchedulerIsBusy = true;

                // Workaround
                savingAppointment.Start = savingAppointment.IsAllDayEvent ? DateEx.GetStartOfDay(savingAppointment.Start) : savingAppointment.Start;
                savingAppointment.End = savingAppointment.IsAllDayEvent ? DateEx.GetEndOfDay(savingAppointment.End) : savingAppointment.End;

                var reqSave = new SaveBusinessClosedDayRequest(savingAppointment);
                yield return reqSave;
                if (reqSave.Error != null) {
                    yield return HandleExceptionResult.Display(reqSave.Error);
                    this.SchedulerIsBusy = false;
                    yield break;
                }
                savingAppointment.IsNew = false;
                this.SchedulerIsBusy = false;
                yield break;
            }
        }
    protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string venueID = Request.QueryString["ID"].ToString();

        char[] delim = { ';' };
        string[] tokens = e.Appointment.ID.ToString().Split(delim);

        string aptmntID = tokens[0];
        string reOcurrID = tokens[2];
        string switchOn = tokens[1];

        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        DateTime dateNow = DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":"));

        DataSet ds = dat.GetData("SELECT DATEADD(minute,450,EO.DateTimeStart)  AS Start, DATEADD(minute,450,EO.DateTimeEnd)  AS [End], E.Header, " +
            "E.ID, E.Address, V.Name FROM Venues V, Events E, Event_Occurance EO WHERE E.Venue=V.ID AND " +
            "EO.EventID=E.ID AND V.ID=" + venueID);
        DataView dv = new DataView(ds.Tables[0], "ID=" + aptmntID, "", DataViewRowState.CurrentRows);

        e.Appointment.ToolTip = "";
        RadToolTip newToolTip = new RadToolTip();
        string address = "";

        DateTime date = e.Appointment.Start;

        newToolTip.Text = "<div width=\"250px\" id=\"divE" + aptmntID + "\"><a href=\"" +
            dat.MakeNiceName(e.Appointment.Subject) + "_" +
                    aptmntID + "_Event\" class=\"NavyLink12\">" +
                    dat.BreakUpString(e.Appointment.Subject, 20) + "</a>" +
                    "<br/>" + date.ToShortTimeString();

        if (Session["User"] != null)
        {
            DataView dvUser = dat.GetDataDV("SELECT * FROM User_Calendar WHERE UserID=" +
                Session["User"].ToString() + " AND EventID=" + aptmntID);

            newToolTip.Text += "<br/><a href=\"javascript:OpenRad2('divE" + aptmntID + "','" +
                aptmntID + "', 'E', " + reOcurrID + ");\"><img title=\"Send info to friends\" alt=\"Send info to " +
                "friends\" style=\"border: none;\" " +
                "src=\"image/Envelope.png\" /></a>";
            string addText = "";
            if (dvUser.Count > 0)
            {
                e.Appointment.BackColor = System.Drawing.Color.Yellow;
                newToolTip.Text = "<span style=\"color: orange;\">Event is in your calendar</span>" +
                    newToolTip.Text + "</div>";
            }
            else
            {

                newToolTip.Text += "<a style=\"text-decoration: none;\" " +
                    "href=\"javascript:AddToCalendar('divE" + aptmntID + "','" +
                aptmntID + "', 'E');\"><img style=\"padding-bottom: 4px; border: 0;\" " +
                "title=\"Add to Calendar\" alt=\"Add to Calendar\" " +
                "src=\"image/CalendarIcon.png\" /></a></div>";
            }
        }
        else
            newToolTip.Text += "</div>";

        newToolTip.TargetControlID = e.Appointment.ClientID;
        newToolTip.IsClientID = true;
        newToolTip.ManualClose = true;
        newToolTip.HideEvent = ToolTipHideEvent.ManualClose;
        newToolTip.Animation = ToolTipAnimation.None;
        newToolTip.AutoCloseDelay = 100000000;
        newToolTip.HideDelay = 1000000;
        newToolTip.ShowEvent = ToolTipShowEvent.OnClick;
        newToolTip.Position = ToolTipPosition.MiddleRight;
        newToolTip.Width = 250;
        newToolTip.Skin = "Sunset";
        ToolTipPanel.Controls.Add(newToolTip);
    }
        protected void InstructionalPlanScheduler_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            var description = e.Appointment.Description;
            var previewLink = (HyperLink)e.Container.FindControl("previewLink");
            var previewImage = (Image)e.Container.FindControl("previewImage");
            previewLink.Visible = !String.IsNullOrEmpty(description);
            previewImage.Visible = !String.IsNullOrEmpty(description);

            if(!String.IsNullOrEmpty(description))
            {
                previewLink.NavigateUrl = ResolveUrl(description);
            }
        }
        /// <summary>
        /// Handles the AppointmentCreated event of the EventsCalendarDisplay control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.AppointmentCreatedEventArgs"/> instance containing the event data.</param>
        private void EventsCalendarDisplay_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)
        {
            if (!e.Appointment.Visible || this.IsAppointmentRegisteredForToolTip(e.Appointment))
            {
                return;
            }

            var appointmentId = e.Appointment.ID.ToString();
            foreach (var domElementId in e.Appointment.DomElements)
            {
                this.EventsCalendarToolTipManager.TargetControls.Add(domElementId, appointmentId, true);
            }
        }