Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
 private void AddFormula(SimpleFormulaModel fmodel)
 {
     _formulas.Add(fmodel);
     elementContainerControl1.AddElement(fmodel.Name);
 }