Example #1
0
 protected override void Nested_PrepareForCreation()
 {
     _current = null;
     layoutControl1.Visible = true;
     //commandBar1.CustomGUI_SetInterfaceState(WIN.SCHEDULING_APP.GUI.Utility.GUIState.Creazione);
     //commandBar1.Custom_SetFunctionName("Creazione nuova causale");
     commandBar1.Custom_SetIdentifier("");
 }
Example #2
0
        private void DoRowDoubleClick(GridView view, Point pt)
        {
            GridHitInfo info = view.CalcHitInfo(pt);

            if (info.InRowCell)
            {
                WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource label = view.GetRow(view.FocusedRowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource;
                SetSelectedId(label);
            }
        }
Example #3
0
        //protected override void Nested_PostLoadingActions()
        //{
        //    commandBar1.Custom_SetFunctionName(string.Format("Visualizzazione causale: {0}", _current.Descrizione));
        //    commandBar1.CustomGUI_SetInterfaceState(GUIState.Visualizzazione);

        //}
        #endregion

        #region Salvataggio

        public override void Nested_InsertData()
        {
            _current               = new WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource();
            _current.CreatoDa      = SecurityManager.Instance.CurrentUser.Username;
            _current.DataCreazione = DateTime.Now;

            SaveOrUpdate();

            m_IdShowedObject = _current.Id;
        }
Example #4
0
        protected override void Nested_LoadDataFromDataSource()
        {
            ResourceHandler h = new ResourceHandler();

            _current = h.GetElementById(m_IdShowedObject.ToString()) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource;;

            if (_current == null)
            {
                throw new Exception("Elemento non trovato");
            }
        }
Example #5
0
        private void cmdOk_Click(object sender, EventArgs e)
        {
            _id = -1;

            if (gridView1.SelectedRowsCount != 1)
            {
                XtraMessageBox.Show("Selezionare almeno una risorsa!", "Informazione", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource label = gridView1.GetRow(gridView1.FocusedRowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource;
            SetSelectedId(label);
        }
Example #6
0
 private void SetSelectedId(WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource label)
 {
     if (label != null)
     {
         _id = label.Id;
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     else
     {
         XtraMessageBox.Show("Selezionare una risorsa!", "Informazione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Example #7
0
        private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            if (e.RowHandle < 0)
            {
                return;
            }

            GridView View = sender as GridView;

            if (e.Column.FieldName == "Descrizione")
            {
                WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource label = View.GetRow(e.RowHandle) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource;

                int color = label.Color;

                e.Appearance.BackColor = Color.FromArgb(color);
            }
        }
Example #8
0
        private void schedulerStorage1_AppointmentsChanged(object sender, PersistentObjectsEventArgs e)
        {
            try
            {
                Nested_CheckSecurityForChanging();
            }
            catch (Exception ex)
            {
                ErrorHandler.Show(ex);
                return;
            }


            foreach (DevExpress.XtraScheduler.Appointment app in e.Objects)
            {
                // DevExpress.XtraScheduler.Appointment app = e.Objects[0] as DevExpress.XtraScheduler.Appointment;
                //imposto per sicurezza il campo allday a false;
                app.AllDay = false;

                MyAppointment a = app.GetSourceObject(schedulerStorage1) as MyAppointment;

                //se ho cambiato risorsa dal calendario e non dal form
                //(il form tiene i valori sincronizzati) recupero la risorsa e la setto
                if (a.ResourceId != a.Resource.Id)
                {
                    ResourceHandler h1 = new ResourceHandler();
                    WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource res = h1.GetElementById(a.ResourceId.ToString()) as WIN.SCHEDULING_APPLICATION.DOMAIN.ComboElements.Resource;
                    a.Resource = res;
                    app.SetValue(schedulerStorage1, "Resource", res);
                }
                ////i save on my db
                AppointmentHandler h = new AppointmentHandler();

                try
                {
                    h.SaveOrUpdate(a);
                }
                catch (Exception ex)
                {
                    WIN.SCHEDULING_APP.GUI.Utility.ErrorHandler.Show(ex);
                }
            }
        }