示例#1
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);
     }
 }
示例#2
0
        public ScheduleJobControl(MetroBillCommands commands)
        {
            InitializeComponent();
            Commands = commands;

            var schedulas = ProfilesManager.CurrentProfile.GetSheduleTimes();

            foreach (var item in schedulas)
            {
                AddSchedule(item);
            }
        }
示例#3
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;
     }
 }
示例#4
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;
     }
 }
示例#5
0
        public FormMain()
        {
            SuspendLayout();

            InitializeComponent();
            _commands = new MetroBillCommands();

            _commands.StartControlCommands.Logon.Executed += StartControl_LogonClick;
            _commands.StartControlCommands.Exit.Executed += StartControl_ExitClick;

            _commands.CustomFormulaControlCommands.Save.Executed += CustomFormulaControl_SaveClisk;
            _commands.CustomFormulaControlCommands.Cancel.Executed += CustomFormulaControl_CancelClisk;

            _commands.ScheduleJobControlCommands.Save.Executed += ScheduleJobControl_SaveClisk;
            _commands.ScheduleJobControlCommands.Cancel.Executed += ScheduleJobControl_CancelClisk;

            _startControl = new StartControl(_commands);
            //_addUserControl = new AddUserControl {Commands = _commands, Tag = 0};

            Controls.Add(_startControl);
            _startControl.BringToFront();
            _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right;
            ResumeLayout(false);
        }
示例#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_save.Command = newValue.CustomFormulaControlCommands.Save;
         ui_buttonX_cancel.Command = newValue.CustomFormulaControlCommands.Cancel;
     }
     else
     {
         // ui_buttonX_save.Command = null;
         ui_buttonX_cancel.Command = null;
     }
 }
示例#7
0
 public StartControl(MetroBillCommands commands)
 {
     InitializeComponent();
     Commands = commands;
 }