Пример #1
0
        /* private void CargarCalendario(DateTime dt)
        {

            this.ciProv = new List<CalendarItem>();
            CalendarItem citemp;
            var eventos = General.GetListOf<ProveedorEventoCalendario>();
            foreach (var evento in eventos)
            {
                var proveedor = General.GetEntity<Proveedor>(c => c.ProveedorID == evento.ProveedorID && c.Estatus);
                DateTime dtTemp = (DateTime)evento.Fecha;
                citemp = new CalendarItem(this.calProveedor, dtTemp, dtTemp.AddMinutes(30)
                                    , string.Format("{0}\n{1}\n{2}", Proveedor.NombreProveedor, evento.Fecha, evento.Evento));
                this.ciProv.Add(citemp);
            }
        }

        private void CargarItemsACalendario(DateTime dt, DateTime dt2)
        {
            calProveedor.Items.Clear();
            calProveedor.SetViewRange(dt, dt2);
            foreach (var calendarItem in this.ciProv)
            {
                if (calProveedor.ViewIntersects(calendarItem))
                {
                    calProveedor.Items.Add(calendarItem);

                }
            }
        }
        */
        private void calProveedor_DoubleClick(object sender, EventArgs e)
        {
            var frmAgregar = new AgregarEventoCalendario(Proveedor, calProveedor.SelectedElementStart.Date);
            frmAgregar.ShowDialog(Principal.Instance);

            if (frmAgregar.DialogResult == DialogResult.OK)
            {
                this.CargarEventosCalendario();
            }
        }
Пример #2
0
        private void calendar1_DoubleClick(object sender, EventArgs e)
        {
            if (UtilLocal.ValidarPermiso("Administracion.Clientes.Calendario.Agregar", true))
            {
                if (Cliente != null)
                {
                    var frmAgregar = new AgregarEventoCalendario(Cliente, calendar1.SelectedElementStart.Date);
                    frmAgregar.ShowDialog(Principal.Instance);

                    if (frmAgregar.DialogResult == DialogResult.OK)
                    {
                        this.CargarCliente(Cliente.ClienteID);
                        this.CargarEventosCalendario();
                    }
                }
                else
                {
                    Util.MensajeError("Para agendar elija un Cliente primero.", GlobalClass.NombreApp);
                }
            }
        }