Пример #1
0
        public FormMain()
        {
            InitializeComponent();

            ToastNotification.ToastBackColor       = Color.SteelBlue;
            ToastNotification.DefaultToastPosition = eToastPosition.BottomCenter;

            SuspendLayout();

            _commands = new MetroBillCommands
            {
                StartControlCommands = { Logon = new Command(), Exit = new Command() },
            };

            _commands.StartControlCommands.Logon.Executed += StartControlLogonClick;
            _commands.StartControlCommands.Exit.Executed  += startControl_ExitClick;

            _startControl = new StartControl {
                Commands = _commands
            };

            Controls.Add(_startControl);
            _startControl.BringToFront();
            _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
            FormClosing            += StopProcess;
        }
Пример #2
0
 public CustomFormulaControl(MetroBillCommands commands, int userId, bool isSnapShot,
                             IEnumerable <SimpleFormulaModel> formulas, IEnumerable <string> checkedColumns)
 {
     InitializeComponent();
     Commands    = commands;
     _userId     = userId;
     _isSnapShot = isSnapShot;
     _formulas   = new List <SimpleFormulaModel>();
     foreach (var simpleFormulaModel in formulas)
     {
         var nModel = new SimpleFormulaModel
         {
             Name        = simpleFormulaModel.Name,
             Elements    = simpleFormulaModel.Elements.ToList(),
             Formula     = simpleFormulaModel.Formula,
             FormulaId   = simpleFormulaModel.FormulaId,
             FormulaType = simpleFormulaModel.FormulaType,
             IsSnapShot  = simpleFormulaModel.IsSnapShot,
             UsedColumns = simpleFormulaModel.UsedColumns.ToList(),
             UserId      = simpleFormulaModel.UserId
         };
         AddFormula(nModel);
     }
     ui_comboBoxEx_useColumn.Items.Clear();
     foreach (var checkedColumn in checkedColumns)
     {
         ui_comboBoxEx_useColumn.Items.Add(checkedColumn);
     }
 }
Пример #3
0
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         btn_cancelar.Command = newValue.UsuarioCommands.Cancel;
     }
     else
     {
         btn_cancelar.Command = null;
     }
 }
Пример #4
0
        public ScheduleJobControl(MetroBillCommands commands)
        {
            InitializeComponent();
            Commands = commands;

            var schedulas = ProfilesManager.CurrentProfile.GetSheduleTimes();

            foreach (var item in schedulas)
            {
                AddSchedule(item);
            }
        }
Пример #5
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         saveButton.Command   = newValue.NewListCommands.Add;
         cancelButton.Command = newValue.NewListCommands.Cancel;
     }
     else
     {
         saveButton.Command   = null;
         cancelButton.Command = null;
     }
 }
Пример #6
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         ui_buttonX_logon.Command = newValue.StartControlCommands.Logon;
         ui_buttonX_exit.Command  = newValue.StartControlCommands.Exit;
     }
     else
     {
         ui_buttonX_logon.Command = null;
         ui_buttonX_exit.Command  = null;
     }
 }
Пример #7
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         ui_buttonX_save.Command   = newValue.ScheduleJobControlCommands.Save;
         ui_buttonX_cancel.Command = newValue.ScheduleJobControlCommands.Cancel;
     }
     else
     {
         ui_buttonX_save.Command   = null;
         ui_buttonX_cancel.Command = null;
     }
 }
Пример #8
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         ui_buttonX_add.Command    = newValue.AddUserControlCommands.Add;
         ui_buttonX_cancel.Command = newValue.AddUserControlCommands.Cancel;
     }
     else
     {
         ui_buttonX_add.Command    = null;
         ui_buttonX_cancel.Command = null;
     }
 }
Пример #9
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         //ui_buttonX_save.Command = newValue.CustomFormulaControlCommands.Save;
         ui_buttonX_cancel.Command = newValue.CustomFormulaControlCommands.Cancel;
     }
     else
     {
         // ui_buttonX_save.Command = null;
         ui_buttonX_cancel.Command = null;
     }
 }
Пример #10
0
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         ui_buttonX_Save.Command   = newValue.EditUserControlCommands.SaveChanges;
         ui_buttonX_cancel.Command = newValue.EditUserControlCommands.Cancel;
     }
     else
     {
         ui_buttonX_Save.Command   = null;
         ui_buttonX_cancel.Command = null;
     }
 }
Пример #11
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         //saveButton.Command = newValue.NewSymbolCommands.Add;
         ui_buttonX_newGroup.Command  = newValue.NewSymbolCommands.NewGroup;
         ui_buttonX_editGroup.Command = newValue.NewSymbolCommands.EditGroup;
         ui_ButtonX_cancel.Command    = newValue.NewSymbolCommands.Cancel;
     }
     else
     {
         ui_ButtonX_add.Command    = null;
         ui_ButtonX_cancel.Command = null;
     }
 }
Пример #12
0
 /// <summary>
 /// Called when Commands property has changed.
 /// </summary>
 /// <param name="oldValue">Old property value</param>
 /// <param name="newValue">New property value</param>
 protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue)
 {
     if (newValue != null)
     {
         if (Datos.Rows[0]["tipo"].ToString() == "Administrador")
         {
             codigoItem.Command     = newValue.CodigoCommands.New;
             empresaItem.Command    = newValue.EmpresaCommands.New;
             clienteItem.Command    = newValue.ClienteCommands.New;
             listaventaItem.Command = newValue.ListaVentaCommands.New;
             producto.Command       = newValue.ProductoCommands.New;
             ventasItem.Command     = newValue.VentaCommands.New;
             facturaItem.Command    = newValue.FacturaCommands.New;
             usuarioItem.Command    = newValue.UsuarioCommands.New;
             reporteItem.Command    = newValue.ReporteCommands.New;
         }
         else
         {
             codigoItem.Command     = newValue.NotImplemented;
             empresaItem.Command    = newValue.NotImplemented;
             clienteItem.Command    = newValue.ClienteCommands.New;
             listaventaItem.Command = newValue.ListaVentaCommands.New;
             producto.Command       = newValue.ProductoCommands.New;
             ventasItem.Command     = newValue.VentaCommands.New;
             facturaItem.Command    = newValue.NotImplemented;
             usuarioItem.Command    = newValue.NotImplemented;
             reporteItem.Command    = newValue.ReporteCommands.New;
         }
     }
     else
     {
         codigoItem.Command     = null;
         empresaItem.Command    = null;
         clienteItem.Command    = null;
         listaventaItem.Command = null;
         producto.Command       = null;
         ventasItem.Command     = null;
         facturaItem.Command    = null;
         usuarioItem.Command    = null;
         reporteItem.Command    = null;
     }
 }
Пример #13
0
 public StartControl(MetroBillCommands commands)
 {
     InitializeComponent();
     Commands = commands;
 }