Ejemplo n.º 1
0
        protected void btnSave_ServerClick(object sender, System.EventArgs e)
        {
            SwitchValidators();

            Page.Validate();
            if (!Page.IsValid)
            {
                return;
            }

            if (EventId != 0)
            {
                int iEndAfter = 0;
                if (rbEndAfter.Checked)
                {
                    iEndAfter = int.Parse(tbEndAfter.Text);
                }
                // TODO: вместо Security.CurrentUser.TimeOffset использовать значение, выбранное из списка!
                CalendarEntry.AddRecurrence(EventId, TimeStart, TimeEnd, Pattern,
                                            SubPattern, Frequency, Weekdays, MonthDay,
                                            WeekNumber, MonthNumber, iEndAfter, dtcDateStart.SelectedDate,
                                            dtcDateEnd.SelectedDate, int.Parse(lstTimeZone.SelectedItem.Value));
                String slink = String.Empty;
                if (SharedID > 0)
                {
                    slink = "&SharedId=" + SharedID;
                }

                Response.Redirect("../Events/EventView.aspx?EventId=" + EventId + slink);
            }
        }