Exemplo n.º 1
0
        public DevExpress.Web.MenuItem daneDoManuKontrolek(string identyfikatorUzytkownika)
        {
            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów meny kontrolek");
            DevExpress.Web.MenuItem mm1 = new DevExpress.Web.MenuItem("Kontrolka");

            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu kontrolka");

            DataTable parametry = makeParameterTable();

            parametry.Rows.Add("@identyfikatorUzytkownika", identyfikatorUzytkownika);
            string kwerenda = "SELECT ident, opis, wartosc FROM konfig  WHERE(klucz = 'kontrolka') order by opis";               // admin

            // czy admin
            if (getQuerryValue("select admin from uzytkownik where ident =@identyfikatorUzytkownika", con_str, parametry) != "1")
            {
                kwerenda = "SELECT DISTINCT konfig.ident, konfig.opis, konfig.wartosc, konfig.klucz FROM uprawnienia INNER JOIN konfig ON uprawnienia.id_wydzialu  = konfig.ident WHERE        (uprawnienia.id_uzytkownika = @identyfikatorUzytkownika) AND (uprawnienia.rodzaj =3 )  AND (rtrim(konfig.klucz) = 'kontrolka') order by konfig.opis";
            }
            DataTable dTable = getDataTable(kwerenda, con_str, parametry, "naglowek");

            foreach (DataRow dRow in dTable.Rows)
            {
                DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem(dRow[1].ToString().Trim(), dRow[0].ToString().Trim(), "", "nowa.aspx?id=" + dRow[0].ToString().Trim(), "_self");
                //mm2.ItemStyle.Width = 300;
                mm2.ItemStyle.Paddings.PaddingLeft = 30;
                mm1.Items.Add(mm2);
            }

            //log.Info("Header: zakonczenie procedury tworzenia elementów menu kontrolek");

            return(mm1);
        }
Exemplo n.º 2
0
 private DevExpress.Web.MenuItem CreateMenuItem(DataRow row, string strColumnaEtiqueta)
 {
     DevExpress.Web.MenuItem ret = new DevExpress.Web.MenuItem();
     ret.Name = "mnu" + row[strColumnaEtiqueta].ToString();
     ret.Text = row[strColumnaEtiqueta].ToString();
     return(ret);
 }
Exemplo n.º 3
0
        private void Scheduler_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            #region Set Context Menu
            foreach (DevExpress.Web.MenuItem items in e.Menu.Items)
            {
                items.Visible = false;
            }

            DevExpress.Web.MenuItem item = e.Menu.Items.FindByName("StatusSubMenu");

            if (item != null)
            {
                item.Visible = true;
                item.Text    = "Priority";
            }

            item = e.Menu.Items.FindByName("Xaf_Edit");

            if (item != null)
            {
                item.Visible = true;
                item.Text    = "Edit";
            }

            item = e.Menu.Items.FindByName("LabelSubMenu");

            if (item != null)
            {
                item.Visible = true;
                item.Text    = "Status";
            }
            #endregion
        }
Exemplo n.º 4
0
        public DevExpress.Web.MenuItem daneDoManuMSS(string identyfikatorUzytkownika)
        {
            //czy admin
            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu statystyk MS-S");

            DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem("MS-S");

            DataTable parametry = makeParameterTable();

            parametry.Rows.Add("@identyfikatorUzytkownika", identyfikatorUzytkownika);
            string kwerenda = string.Empty;

            // czy admin
            if (getQuerryValue("select admin from uzytkownik where ident =@identyfikatorUzytkownika", con_str, parametry) == "1")
            {
                kwerenda = "SELECT DISTINCT wydzialy_mss.ident, wydzialy_mss.nazwa, wydzialy_mss.plik FROM wydzialy_mss INNER JOIN uprawnienia ON wydzialy_mss.ident = uprawnienia.id_wydzialu WHERE(uprawnienia.rodzaj = 2)  order by wydzialy_mss.nazwa";                                 // admin
            }
            else
            {
                kwerenda = "SELECT DISTINCT wydzialy_mss.ident, wydzialy_mss.nazwa, wydzialy_mss.plik FROM wydzialy_mss INNER JOIN uprawnienia ON wydzialy_mss.ident = uprawnienia.id_wydzialu WHERE(uprawnienia.rodzaj = 2) AND(uprawnienia.id_uzytkownika = @identyfikatorUzytkownika) order by wydzialy_mss.nazwa";
                //SELECT DISTINCT wydzialy_mss.ident as id_wydzialu, wydzialy_mss.nazwa, wydzialy_mss.plik FROM  uprawnienia LEFT OUTER JOIN wydzialy_mss ON uprawnienia.id_wydzialu = wydzialy_mss.ident + 200 WHERE        (uprawnienia.id_uzytkownika = 8) AND (uprawnienia.id_wydzialu >= 200) AND (wydzialy_mss.ident IS NOT NULL)
            }
            DataTable dTable = getDataTable(kwerenda, con_str, parametry, "Naglowki");

            foreach (DataRow dRow in dTable.Rows)
            {
                DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem(dRow[1].ToString().Trim(), dRow[0].ToString().Trim(), "", dRow[2].ToString().Trim() + "?w=" + dRow[0].ToString().Trim(), "_self");
                mm2.ItemStyle.Paddings.PaddingLeft = 30;
                item.Items.Add(mm2);
            }
            return(item);
        }
Exemplo n.º 5
0
        public void CrearMenuSuperior(DevExpress.Web.ASPxMenu menu, DataTable dtbMenu, string strColumnaCodigo, string strColumnaPadre, string strColumnaEtiqueta)
        {
            try
            {
                // Build Menu Items
                Dictionary <string, DevExpress.Web.MenuItem> menuItems =
                    new Dictionary <string, DevExpress.Web.MenuItem>();

                foreach (DataRow dtr in dtbMenu.Rows)
                {
                    DevExpress.Web.MenuItem item = CreateMenuItem(dtr, strColumnaEtiqueta);
                    string itemID   = dtr[strColumnaCodigo].ToString();
                    string parentID = dtr[strColumnaPadre].ToString();

                    if (menuItems.ContainsKey(parentID))
                    {
                        menuItems[parentID].Items.Add(item);
                    }
                    else
                    {
                        if (parentID == "0") // It's Root Item
                        {
                            menu.Items.Add(item);
                        }
                    }
                    menuItems.Add(itemID, item);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 6
0
        protected void ASPxScheduler1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)
        {
            ASPxSchedulerPopupMenu menu = e.Menu;

            if (menu.MenuId.Equals(SchedulerMenuItemId.DefaultMenu))
            {
                DevExpress.Web.MenuItem defaultSubMenu = menu.Items.FindByName("SwitchViewMenu");
                DevExpress.Web.MenuItem subMenuItem    = new DevExpress.Web.MenuItem("Agenda View", "AgendaView");
                defaultSubMenu.Items.Add(subMenuItem);
                menu.ClientSideEvents.ItemClick = "DefaultViewMenuHandler";
            }
        }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        mainMenu.DataBind();
        if (mainMenu.SelectedItem != null && mainMenu.SelectedItem.Parent != mainMenu.RootItem)
        {
            mainMenu.SelectedItem.Parent.Text = string.Format("{0}: {1}", mainMenu.SelectedItem.Parent, mainMenu.SelectedItem.Text);
        }

        MenuItem helpMenuItem = mainMenu.Items.Add("?", "helpMenuItem");

        helpMenuItem.ItemStyle.CssClass = "helpMenuItem";
    }
Exemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.ASPxMenu1.Items.Clear();
     if (Menu != null)
     {
         foreach (var item in Menu.FlowChartSettings.Nodes.Where(x => x.QuickLocate))
         {
             var mi = new DevExpress.Web.MenuItem();
             mi.Text      = item.Caption;
             mi.Image.Url = item.GetSmallImageUrl();
             mi.Name      = item.Oid.ToString();
             ASPxMenu1.Items.Add(mi);
         }
     }
 }
Exemplo n.º 9
0
        public DevExpress.Web.MenuItem wyloguj()
        {
            //czy admin
            log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu wyloguj");

            DevExpress.Web.MenuItem mm1 = new DevExpress.Web.MenuItem("Wylogowanie");
            DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem();

            mm2 = new DevExpress.Web.MenuItem("Wyloguj", "", "", "default.aspx?logout=true", "_self");
            mm2.ItemStyle.Width = 300;
            mm2.ItemStyle.Paddings.PaddingLeft = 30;

            mm1.Items.Add(mm2);
            return(mm1);
        }
Exemplo n.º 10
0
        public DevExpress.Web.MenuItem daneDoManuAdmin()
        {
            //czy admin
            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu statystyk MS-S");

            DevExpress.Web.MenuItem mm1 = new DevExpress.Web.MenuItem("Administracja");
            DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem();

            mm2 = new DevExpress.Web.MenuItem("Panel Administracyjny", "", "", "adm.aspx", "_self");
            mm2.ItemStyle.Width = 300;
            mm2.ItemStyle.Paddings.PaddingLeft = 30;
            mm1.Items.Add(mm2);

            return(mm1);
        }
Exemplo n.º 11
0
        public DevExpress.Web.MenuItem Administracja(string identyfikatorUzytkownika)
        {
            //czy admin
            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu statystyk miesięcznych dla użytkownika: " + identyfikatorUzytkownika);

            DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem("Administracja");

            string    admin     = string.Empty;
            DataTable parametry = makeParameterTable();

            parametry.Rows.Add("@identyfikatorUzytkownika", identyfikatorUzytkownika);
            //log.Info("Header: Sprawdz czy użytkownik " + identyfikatorUzytkownika + " ma parawa administratora" );
            admin = "0";

            try
            {
                admin = getQuerryValue("select admin from uzytkownik where ident =@identyfikatorUzytkownika", con_str, parametry);
                //log.Info("Header: Użytkownik ma prawa administracyjne");
            }
            catch
            { }
            string kwerenda = "SELECT DISTINCT wydzialy.ident, wydzialy.nazwa, wydzialy.plik FROM wydzialy INNER JOIN uprawnienia ON wydzialy.ident = uprawnienia.id_wydzialu WHERE(uprawnienia.rodzaj = 1) AND(uprawnienia.id_uzytkownika = @identyfikatorUzytkownika) order by wydzialy.nazwa";

            if (admin == "1")
            {
                // admin
                kwerenda = "SELECT DISTINCT wydzialy.ident, wydzialy.nazwa, wydzialy.plik FROM wydzialy INNER JOIN uprawnienia ON wydzialy.ident = uprawnienia.id_wydzialu WHERE(uprawnienia.rodzaj = 1) order by wydzialy.nazwa";
            }

            //log.Info("Header: odczyt działów przypisanych do uzytkownika id= "+ identyfikatorUzytkownika);

            //log.Info("Header: Uzytkownika id= " + identyfikatorUzytkownika+ " ma prawa do "+dTable.Rows.Count.ToString () +" wydziałów");
            string[] listaSekcjiAdministracjiTekst = new string[] { "Stanowiska", "Pracownicy", "Użytkownicy", "Uprawnienia do Raportów" };
            string[] listaSekcjiAdministracjiNazwa = new string[] { "Stanowiska", "Pracownicy", "Użytkownicy", "Uprawnienia do Raportów" };
            string[] listaSekcjiAdministracjiUrl   = new string[] { "Stanowiska.aspx", "Pracownicy.aspx", "Uzytkownicy.aspx", "UprawnieniaDoRaportow.aspx" };
            for (int i = 0; i < listaSekcjiAdministracjiTekst.Length - 1; i++)
            {
                DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem(listaSekcjiAdministracjiNazwa[i].ToString().Trim(), listaSekcjiAdministracjiTekst[i].ToString().Trim(), "", listaSekcjiAdministracjiUrl[i].ToString().Trim() + "?w=" + listaSekcjiAdministracjiTekst[i].ToString().Trim(), "_self");
                //mm2.ItemStyle.Width = 300;
                mm2.ItemStyle.Paddings.PaddingLeft = 30;
                item.Items.Add(mm2);
            }

            return(item);
        }
Exemplo n.º 12
0
        public DevExpress.Web.MenuItem daneDoManuMiesieczne(string identyfikatorUzytkownika)
        {
            //czy admin
            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu statystyk miesięcznych dla użytkownika: " + identyfikatorUzytkownika);

            DevExpress.Web.MenuItem item = new DevExpress.Web.MenuItem("Statystyka");

            string    admin     = string.Empty;
            DataTable parametry = makeParameterTable();

            parametry.Rows.Add("@identyfikatorUzytkownika", identyfikatorUzytkownika);
            //log.Info("Header: Sprawdz czy użytkownik " + identyfikatorUzytkownika + " ma parawa administratora" );
            admin = "0";

            try
            {
                admin = getQuerryValue("select admin from uzytkownik where ident =@identyfikatorUzytkownika", con_str, parametry);
                //log.Info("Header: Użytkownik ma prawa administracyjne");
            }
            catch
            { }
            string kwerenda = "SELECT DISTINCT wydzialy.ident, wydzialy.nazwa, wydzialy.plik FROM wydzialy INNER JOIN uprawnienia ON wydzialy.ident = uprawnienia.id_wydzialu WHERE(uprawnienia.rodzaj = 1) AND(uprawnienia.id_uzytkownika = @identyfikatorUzytkownika) order by wydzialy.nazwa";

            if (admin == "1")
            {
                // admin
                kwerenda = "SELECT DISTINCT wydzialy.ident, wydzialy.nazwa, wydzialy.plik FROM wydzialy INNER JOIN uprawnienia ON wydzialy.ident = uprawnienia.id_wydzialu WHERE(uprawnienia.rodzaj = 1) order by wydzialy.nazwa";
            }

            //log.Info("Header: odczyt działów przypisanych do uzytkownika id= "+ identyfikatorUzytkownika);
            DataTable dTable = getDataTable(kwerenda, con_str, parametry, "");

            //log.Info("Header: Uzytkownika id= " + identyfikatorUzytkownika+ " ma prawa do "+dTable.Rows.Count.ToString () +" wydziałów");

            foreach (DataRow dRow in dTable.Rows)
            {
                DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem(dRow[1].ToString().Trim(), dRow[0].ToString().Trim(), "", dRow[2].ToString().Trim() + "?w=" + dRow[0].ToString().Trim(), "_self");
                //mm2.ItemStyle.Width = 300;
                mm2.ItemStyle.Paddings.PaddingLeft = 30;
                item.Items.Add(mm2);
                //log.Info("Header: dodano wydzial " + dRow[1].ToString().Trim() + " do menu ");
            }
            return(item);
        }
 protected void ASPxScheduler1_PopupMenuShowing(object sender, DevExpress.Web.ASPxScheduler.PopupMenuShowingEventArgs e)
 {
     if (e.Menu.MenuId == DevExpress.XtraScheduler.SchedulerMenuItemId.AppointmentMenu)
     {
         e.Menu.ClientSideEvents.PopUp = "OnClientPopupMenuShowing";
         DevExpress.Web.MenuItem newItem = new DevExpress.Web.MenuItem();
         newItem.Name = "CustomValues";
         newItem.Text = "Custom values";
         int i = 0;
         foreach (string customFieldValue in customFieldValues)
         {
             DevExpress.Web.MenuItem subMenuItem = new DevExpress.Web.MenuItem();
             subMenuItem.Name = "Custom Item " + i.ToString();
             i++;
             subMenuItem.GroupName     = "CustomValues";
             subMenuItem.Text          = customFieldValue;
             subMenuItem.ClientEnabled = true;
             newItem.Items.Add(subMenuItem);
         }
         e.Menu.Items.Add(newItem);
     }
 }
        protected void ASPxScheduler1_PopupMenuShowing(object sender, DevExpress.Web.ASPxScheduler.PopupMenuShowingEventArgs e)
        {
            e.Menu.ClientSideEvents.PopUp = "OnClientPopupMenuShowing";

            if (e.Menu.MenuId == DevExpress.XtraScheduler.SchedulerMenuItemId.AppointmentMenu)
            {
                DevExpress.Web.MenuItem newItemCopy = new DevExpress.Web.MenuItem();
                newItemCopy.Name = "CopyAppointment";
                newItemCopy.Text = "Copy";
                newItemCopy.ItemStyle.Font.Bold = true;
                e.Menu.Items.Add(newItemCopy);
                e.Menu.JSProperties["cpMenuName"] = "AppointmentMenu";
            }
            if (e.Menu.MenuId == DevExpress.XtraScheduler.SchedulerMenuItemId.DefaultMenu)
            {
                DevExpress.Web.MenuItem newItemPaste = new DevExpress.Web.MenuItem();
                newItemPaste.Name = "PasteAppointment";
                newItemPaste.Text = "Paste";
                newItemPaste.ItemStyle.Font.Bold = true;
                e.Menu.Items.Insert(0, newItemPaste);
                e.Menu.JSProperties["cpMenuName"] = "DefaultMenu";
            }
        }
Exemplo n.º 15
0
        public DevExpress.Web.MenuItem daneDoManuInne(string identyfikatorUzytkownika)
        {
            //czy admin
            //log.Info("Header: Rozpoczęcie procedury tworzenia elementów menu statystyk MS-S");

            DevExpress.Web.MenuItem mm1 = new DevExpress.Web.MenuItem("Inne");
            DevExpress.Web.MenuItem mm2 = new DevExpress.Web.MenuItem();
            //sprawdzenie czy sa uprawnienia do oceny
            DataTable parametry = makeParameterTable();

            parametry.Rows.Add("@identyfikatorUzytkownika", identyfikatorUzytkownika);
            int iloscUprawnienOceny = int.Parse(getQuerryValue("SELECT COUNT(*) FROM  uprawnienia WHERE (rodzaj = 6) and id_uzytkownika=@identyfikatorUzytkownika", con_str, parametry, "Header - sprawdzanie oceny pracownika"));

            if (iloscUprawnienOceny > 0)
            {
                mm2 = new DevExpress.Web.MenuItem("Ocena pracownika Nowa", "", "", "ocenaPracownika.aspx", "_self");
                mm2.ItemStyle.Width = 300;
                mm2.ItemStyle.Paddings.PaddingLeft = 30;
                mm1.Items.Add(mm2);
            }
            int iloscUprawnienKOF = int.Parse(getQuerryValue("SELECT COUNT(*) FROM  uprawnienia WHERE (rodzaj = 4) and id_uzytkownika=@identyfikatorUzytkownika", con_str, parametry, "Header - sprawdzanie oceny pracownika"));

            if (iloscUprawnienKOF > 0)
            {
                mm2 = new DevExpress.Web.MenuItem("Kontrolka KOF", "", "", "kof.aspx", "_self");
                mm2.ItemStyle.Width = 300;
                mm2.ItemStyle.Paddings.PaddingLeft = 30;
                mm1.Items.Add(mm2);
            }

            mm2 = new DevExpress.Web.MenuItem("Wyszukiwarka Spraw", "", "", "wyszukiwarkaSpraw.aspx", "_self");
            mm2.ItemStyle.Width = 300;
            mm2.ItemStyle.Paddings.PaddingLeft = 30;
            mm1.Items.Add(mm2);

            return(mm1);
        }
        public static SchedulerSettings GetSchedulerSettings()
        {
            SchedulerSettings settings = new SchedulerSettings();

            settings.Name = "RouteScheduler";
            settings.CallbackRouteValues        = new { Controller = "MarketRouteSchedules", Action = "SchedulerPartial" };
            settings.EditAppointmentRouteValues = new { Controller = "MarketRouteSchedules", Action = "SchedulerPartialEditAppointment" };
            settings.CustomActionRouteValues    = new { Controller = "MarketRouteSchedules", Action = "CreateAppointment" };

            settings.OptionsBehavior.ShowFloatingActionButton = false;
            settings.Storage.Appointments.Assign(AppointmentStorage);
            settings.Storage.Resources.Assign(ResourceStorage);
            settings.Storage.EnableReminders = true;
            settings.GroupType = SchedulerGroupType.Resource;

            // event handler for Availabilities
            settings.HtmlTimeCellPrepared      += Scheduler_HtmlTimeCellPrepared;
            settings.Views.TimelineView.Enabled = false;
            settings.Views.WeekView.Enabled     = false;
            // Day View
            settings.Views.DayView.Styles.ScrollAreaHeight = 640;
            settings.Views.DayView.WorkTime.Start          = new TimeSpan(7, 0, 0);
            settings.Views.DayView.WorkTime.End            = new TimeSpan(20, 0, 0);
            settings.Views.DayView.ShowWorkTimeOnly        = true;
            settings.Views.DayView.ResourcesPerPage        = 5;
            // Work Days View
            settings.WorkDays.Add(WeekDays.Saturday);
            settings.Views.WorkWeekView.Styles.ScrollAreaHeight = 640;
            settings.Views.WorkWeekView.WorkTime.Start          = new TimeSpan(7, 0, 0);
            settings.Views.WorkWeekView.WorkTime.End            = new TimeSpan(20, 0, 0);
            settings.Views.WorkWeekView.ShowWorkTimeOnly        = true;
            settings.Views.WorkWeekView.ResourcesPerPage        = 1;
            // Month View
            settings.Views.MonthView.ResourcesPerPage     = 1;
            settings.Storage.Appointments.ResourceSharing = true;
            settings.OptionsCustomization.AllowAppointmentDragBetweenResources = UsedAppointmentType.None;
            settings.OptionsCustomization.AllowAppointmentDrag      = UsedAppointmentType.NonRecurring;
            settings.OptionsCustomization.AllowAppointmentDelete    = UsedAppointmentType.NonRecurring;
            settings.OptionsCustomization.AllowAppointmentConflicts = AppointmentConflictsMode.Forbidden;

            SchedulerCompatibility.Base64XmlObjectSerialization = false;
            settings.ClientSideEvents.AppointmentDeleting       = "OnAppointmentDeleting";
            settings.ClientSideEvents.EndCallback   = "OnAppointmentEndCallBack";
            settings.ClientSideEvents.BeginCallback = "OnAppointmentBeginCallback";
            settings.AppointmentFormShowing        += Scheduler_AppointmentFormShowing;

            settings.PopupMenuShowing = (sender, e) =>
            {
                if (e.Menu.MenuId == SchedulerMenuItemId.AppointmentMenu)
                {
                    DevExpress.Web.MenuItem item =
                        e.Menu.Items.FindByName("DeleteAppointment") as DevExpress.Web.MenuItem;
                    item.Text = "Cancel Route";

                    DevExpress.Web.MenuItem statusMenu =
                        e.Menu.Items.FindByName(SchedulerMenuItemId.StatusSubMenu.ToString());
                    if (statusMenu != null)
                    {
                        statusMenu.Visible = false;
                    }

                    DevExpress.Web.MenuItem labelMenu =
                        e.Menu.Items.FindByName(SchedulerMenuItemId.LabelSubMenu.ToString());
                    if (labelMenu != null)
                    {
                        labelMenu.Text = "Priority";
                    }

                    //Hide items temerary as delete button not working. Need to establish if its bug in DevExpress 17.1 release
                    if (item != null)
                    {
                        item.Visible = false;
                    }
                    if (labelMenu != null)
                    {
                        labelMenu.Visible = false;
                    }
                }

                else
                {
                    e.Menu.Items.Clear();
                }
            };

            settings.AppointmentFormShowing = (sender, e) =>
            {
                //Console.WriteLine(e.ToString());
            };

            return(settings);
        }
Exemplo n.º 17
0
        public static SchedulerSettings GetSchedulerSettings()
        {
            SchedulerSettings settings = new SchedulerSettings();

            settings.Name = "Scheduler";
            settings.CallbackRouteValues        = new { Controller = "ResourceRequests", Action = "SchedulerPartial" };
            settings.EditAppointmentRouteValues = new { Controller = "ResourceRequests", Action = "SchedulerPartialEditAppointment" };
            settings.ActiveViewType             = SchedulerViewType.Agenda;
            settings.Views.AgendaView.DayCount  = 7;

            settings.OptionsBehavior.ShowFloatingActionButton = false;
            settings.Storage.Appointments.Assign(AppointmentStorage);
            settings.Storage.Resources.Assign(ResourceStorage);
            settings.Storage.EnableReminders = true;

            settings.Views.DayView.Enabled      = false;
            settings.Views.WorkWeekView.Enabled = false;
            settings.Views.WeekView.Enabled     = true;
            settings.Views.MonthView.Enabled    = true;
            settings.Views.TimelineView.Enabled = false;

            settings.Views.AgendaView.Enabled = true;
            settings.Views.AgendaView.AppointmentDisplayOptions.ShowResource = true;

            settings.Views.DayView.Styles.ScrollAreaHeight = 610;
            settings.Views.DayView.WorkTime.Start          = new TimeSpan(7, 0, 0);
            settings.Views.DayView.WorkTime.End            = new TimeSpan(20, 0, 0);
            settings.Views.DayView.ShowWorkTimeOnly        = true;
            settings.Views.DayView.ResourcesPerPage        = 5;
            // Work Days View
            settings.WorkDays.Add(WeekDays.Saturday);
            settings.Views.WorkWeekView.Styles.ScrollAreaHeight = 610;
            settings.Views.WorkWeekView.WorkTime.Start          = new TimeSpan(7, 0, 0);
            settings.Views.WorkWeekView.WorkTime.End            = new TimeSpan(20, 0, 0);
            settings.Views.WorkWeekView.ShowWorkTimeOnly        = true;
            settings.Views.WorkWeekView.ResourcesPerPage        = 1;
            // Month View
            settings.Views.MonthView.ResourcesPerPage     = 1;
            settings.Storage.Appointments.ResourceSharing = false;
            //SchedulerCompatibility.Base64XmlObjectSerialization = false;
            //settings.ClientSideEvents.AppointmentDeleting = "OnAppointmentDeleting";
            //settings.ClientSideEvents.EndCallback = "OnAppointmentEndCallBack";
            //settings.ClientSideEvents.AppointmentClick = "function(s,e){ OnAppointmentEventsClick(s,e); }";
            //settings.ClientSideEvents.BeginCallback = "OnBeginCallback";
            settings.AppointmentFormShowing += Scheduler_AppointmentFormShowing;

            settings.PopupMenuShowing = (sender, e) =>
            {
                if (e.Menu.MenuId == SchedulerMenuItemId.AppointmentMenu)
                {
                    DevExpress.Web.MenuItem item =
                        e.Menu.Items.FindByName("DeleteAppointment") as DevExpress.Web.MenuItem;
                    item.Text = "Cancel Appointment";

                    DevExpress.Web.MenuItem statusMenu =
                        e.Menu.Items.FindByName(SchedulerMenuItemId.StatusSubMenu.ToString());
                    if (statusMenu != null)
                    {
                        statusMenu.Visible = false;
                    }

                    DevExpress.Web.MenuItem labelMenu =
                        e.Menu.Items.FindByName(SchedulerMenuItemId.LabelSubMenu.ToString());
                    if (labelMenu != null)
                    {
                        labelMenu.Text = "Priority";
                    }

                    //Hide items temerary as delete button not working. Need to establish if its bug in DevExpress 17.1 release
                    if (item != null)
                    {
                        item.Visible = false;
                    }
                    if (labelMenu != null)
                    {
                        labelMenu.Visible = false;
                    }
                }

                else
                {
                    e.Menu.Items.Clear();
                }
            };

            settings.AppointmentFormShowing = (sender, e) =>
            {
                //Console.WriteLine(e.ToString());
            };

            return(settings);
        }
        public static SchedulerSettings GetSchedulerSettings()
        {
            SchedulerSettings settings = new SchedulerSettings();

            settings.Name = "Scheduler";
            settings.CallbackRouteValues        = new { Controller = "MarketRouteSchedules", Action = "SchedulerPartial" };
            settings.EditAppointmentRouteValues = new { Controller = "MarketRouteSchedules", Action = "SchedulerPartialEditAppointment" };
            settings.CustomActionRouteValues    = new { Controller = "MarketRouteSchedules", Action = "CreateAppointment" };

            settings.Storage.Appointments.Assign(AppointmentStorage);
            settings.Storage.Resources.Assign(ResourceStorage);
            settings.Storage.EnableReminders = true;
            settings.GroupType = SchedulerGroupType.Resource;

            // event handler for Availabilities
            settings.HtmlTimeCellPrepared      += Scheduler_HtmlTimeCellPrepared;
            settings.Views.TimelineView.Enabled = false;
            settings.Views.WeekView.Enabled     = false;
            // Day View
            settings.Views.DayView.Styles.ScrollAreaHeight = 610;
            settings.Views.DayView.WorkTime.Start          = new TimeSpan(7, 0, 0);
            settings.Views.DayView.WorkTime.End            = new TimeSpan(20, 0, 0);
            settings.Views.DayView.ShowWorkTimeOnly        = true;
            settings.Views.DayView.ResourcesPerPage        = 5;
            // Work Days View
            settings.WorkDays.Add(WeekDays.Saturday);
            settings.Views.WorkWeekView.Styles.ScrollAreaHeight = 610;
            settings.Views.WorkWeekView.WorkTime.Start          = new TimeSpan(7, 0, 0);
            settings.Views.WorkWeekView.WorkTime.End            = new TimeSpan(20, 0, 0);
            settings.Views.WorkWeekView.ShowWorkTimeOnly        = true;
            settings.Views.WorkWeekView.ResourcesPerPage        = 1;
            // Month View
            settings.Views.MonthView.ResourcesPerPage           = 1;
            settings.Storage.Appointments.ResourceSharing       = true;
            SchedulerCompatibility.Base64XmlObjectSerialization = false;
            settings.ClientSideEvents.AppointmentDeleting       = "OnAppointmentDeleting";
            settings.ClientSideEvents.EndCallback      = "OnAppointmentEndCallBack";
            settings.ClientSideEvents.AppointmentClick = "function(s,e){ OnAppointmentEventsClick(s,e); }";
            settings.ClientSideEvents.BeginCallback    = "OnBeginCallback";
            settings.AppointmentFormShowing           += Scheduler_AppointmentFormShowing;

            settings.PopupMenuShowing = (sender, e) =>
            {
                if (e.Menu.MenuId == SchedulerMenuItemId.AppointmentMenu)
                {
                    DevExpress.Web.MenuItem item =
                        e.Menu.Items.FindByName("DeleteAppointment") as DevExpress.Web.MenuItem;
                    item.Text = "Cancel Appointment";

                    DevExpress.Web.MenuItem statusMenu =
                        e.Menu.Items.FindByName(SchedulerMenuItemId.StatusSubMenu.ToString());
                    if (statusMenu != null)
                    {
                        statusMenu.Visible = false;
                    }

                    DevExpress.Web.MenuItem labelMenu =
                        e.Menu.Items.FindByName(SchedulerMenuItemId.LabelSubMenu.ToString());
                    if (labelMenu != null)
                    {
                        labelMenu.Text = "Priority";
                    }

                    if (item != null)
                    {
                        item.Visible = false;
                    }
                    if (labelMenu != null)
                    {
                        labelMenu.Visible = false;
                    }
                }

                else
                {
                    e.Menu.Items.Clear();
                }
            };

            settings.AppointmentFormShowing = (sender, e) =>
            {
            };

            return(settings);
        }