Ejemplo n.º 1
0
        public FormAddEdit(FormStart fsClass, ActionParameters param)
        {
            InitializeComponent();
            this.fsClass = fsClass;
            this.param   = param;
            switch (param)
            {
            case ActionParameters.AddTree:
                IntiPositionIfTree(true);
                Text = "Добавить";
                Icon = Icon.FromHandle(Properties.Resources.plus.GetHicon());
                break;

            case ActionParameters.AddPlant:
                IntiPositionIfTree(false);
                Text = "Добавить";
                Icon = Icon.FromHandle(Properties.Resources.plus.GetHicon());
                break;

            case ActionParameters.EditTree:
                IntiPositionIfTree(true);
                Text = "Редактировать";
                Icon = Icon.FromHandle(Properties.Resources.edit.GetHicon());
                break;

            case ActionParameters.EditPlant:
                IntiPositionIfTree(false);
                Text = "Редактировать";
                Icon = Icon.FromHandle(Properties.Resources.edit.GetHicon());
                break;
            }
        }
Ejemplo n.º 2
0
        public FormAddEdit(FormStart fsClass, ActionParameters param, DataGridViewSelectedCellCollection selectedCells) : this(fsClass, param)
        {
            this.selectedCells = selectedCells;
            switch (param)
            {
            case ActionParameters.EditTree:
                TBName.Text   = selectedCells[1].Value.ToString();
                TBType.Text   = selectedCells[2].Value.ToString();
                TBFamily.Text = selectedCells[3].Value.ToString();
                TBRod.Text    = selectedCells[4].Value.ToString();
                break;

            case ActionParameters.EditPlant:
                TBName.Text = selectedCells[1].Value.ToString();
                TBType.Text = selectedCells[2].Value.ToString();
                break;
            }
        }