public PollsMainForm(User _user)
        {
            InitializeComponent();
            //_anketsUser=new User();
            //_anketsUser.Login = "******";
            //_anketsUser.CodMfo = 964;
            //_anketsUser.CodObl = 8;
            //_anketsUser.CodRKC = 0;
            //_anketsUser.PrivilegesCodMfo = 0;
            //_anketsUser.PrivilegesCodObl = 6;
            //_anketsUser.PrivilegesCodRKC = 0;
            //_anketsUser.
            _anketsUser = _user;
            _deposPollsTable = new DeposPollsTableForm(_anketsUser);
            splitContainer1.Panel2.Controls.Add(_deposPollsTable);
            _deposPollsTable.Dock = DockStyle.Fill;
            settings = global::Poll.Properties.Settings.Default;
            //Console.WriteLine(settings.Test);
            //settings.Test = "проверка";
            //Console.WriteLine(settings.Test);
            //MessageBox.Show(settings.Test);
            OrderedDictionary ttt = new OrderedDictionary();
            foreach (DataColumn t in _deposPollsTable.pollsDataSet.POLL_DEPOS.Columns)
            {
                ttt.Add(t.ColumnName, "");
                //settings.DeposTableColumnsText.Add(t.ColumnName,"");
            }
            settings.DeposTableColumnsText = ttt;
            settings.Save();

            //_deposPollsTable.buttonAddPoll.
            //Refresh();
            Update();
        }
        //private FILIALTableAdapter filialTableAdapter;
        //private BindingSource filialBindingSource;
        //private RKCViewTableAdapter rkcTableAdapter;
        //private BindingSource rkcBindingSource;
        public AddPollForm(User user, Int32 num_module, MainPollsForm owner)
        {
            _user = user;
            Owner = owner;
            _num_module = num_module;
            _owner = owner;

            InitializeComponent();
            _qTexts = new List<string>()
                          {
                              "Совершенно удовлетворен",
                              "Скорее удовлетворен",
                              "В целом меня все устраивает",
                              "Скорее не удовлетворен",
                              "Совершенно не удовлетворен"
                          };

            _iTexts = new List<string>()
                          {
                              "Очень важно",
                              "Скорее важно",
                              "Имеет нейтральное значение",
                              "Скорее неважно",
                              "Совершенно неважно"
                          };

            LoadControls();
            //componentsComboBoxRegion.label.Text = "Область:";
        }
 //private Criterion _criterion;
 public DeposAnketAddForm(User user)
 {
     InitializeComponent();
     _user = user;
     InitializeForm();
     _isChanges = false;
     acceptChangesButton.Text = "Добавить";
     //acceptChangesButton.DialogResult = DialogResult.OK;
     acceptChangesButton.Enabled = false;
     rejectChangesButton.Text = "Закрыть";
 }
        public DeposAnketAddForm(User user, PollsDataSet.POLL_DEPOSRow inputRow)
        {
            InitializeComponent();
            _user = user;
            _oldRowDepos = inputRow;

            InitializeForm();
            SetDefault();
            _isChanges = true;
            acceptChangesButton.Text = "Изменить";
            acceptChangesButton.DialogResult = DialogResult.OK;
            acceptChangesButton.Enabled = true;
            rejectChangesButton.Text = "Закрыть";
        }
        public MainPollsForm(User user, Int32 num_module, String pathDLL, Form form)
        {
            //_user = new User
            //            {
            //                Login = "******",
            //                CodMfo = 964,
            //                CodObl = 8,
            //                CodRKC = 0,
            //                PrivilegesCodMfo = 0,
            //                PrivilegesCodObl = 6,
            //                PrivilegesCodRKC = 0

            //            };
            //_polls2GridCommonDataTable=new PollsDataSet.Polls2GridCommonDataTable();

            // Проверка наличия конекта и БД

            _user = user;
            _num_module = num_module;
            InitializeComponent();

            var testConnection = new POLLSCOMMONTableAdapter();
            try
            {
                testConnection.Connection.Open();
            }
            catch (System.InvalidOperationException)
            {
                MessageBox.Show(this, "Невозможно подключиться к БД");
                Close();

            }
            catch (System.Data.OracleClient.OracleException)
            {
                MessageBox.Show(this, "Ошибка подключения к БД");
                Close();
            }
            catch(Exception)
            {
                MessageBox.Show(this, "Непредвиденная ошибка. Обратитесь к разработчику");
                Close();
            }

            _selectionAnketControl = new SelectionAnketControl {Owner = this,Dock = DockStyle.Fill};
            panel1.Controls.Add(_selectionAnketControl);
            InitializePollsGridView();
        }
 public void Start(User user, Int32 num_module, String pathDLL, Form form)
 {
     MainPollsForm frmPolls = new MainPollsForm(user, num_module, pathDLL, form);
     frmPolls.MdiParent = form;
     frmPolls.Show();
 }
        //public BindingSource FilialBindingSource;
        //public BindingSource StructUnitBindingSource;
        //public BindingSource RKCBindingSource;
        //public BindingSource SexBindingSource;
        public DeposPollsTableForm(User user)
        {
            _user = user;
            //Pol
            //InitializeComponent();
            //pollsDataSet=
            //pollsDataSet1.POLL_DEPOS.DATE_POLL_DEPOSColumn.Caption = "Дата анкетирования";

            //polL_DEPOSTableAdapter1.FillBy(pollsDataSet1.POLL_DEPOS,0, 461);
            //polL_DEPOSTableAdapter1.FillBy(pollsDataSet1.POLL_DEPOS,0, 964);

            //polL_DEPOSTableAdapter1.Fill(pollsDataSet1.POLL_DEPOS);
            polL_DEPOSTableAdapter.FillByFil(pollsDataSet.POLL_DEPOS,(decimal) _user.PrivilegesCodObl);
            pollsBindingSource.DataSource = pollsDataSet.POLL_DEPOS;

            pollsDataSet.Sex.Clear();
            pollsDataSet.Sex.AddSexRow('m', "Мужской");
            pollsDataSet.Sex.AddSexRow('f', "Женский");
            //_filialTableAdapter=new FILIALTableAdapter();
            //_structUnitTableAdapter = new STRUCT_UNITTableAdapter();
            //if(_user.PrivilegesCodObl != 0)
            //{
            //    _filialTableAdapter.FillByFil(pollsDataSet.FILIAL,System.DateTime.Now, System.DateTime.Now,_user.PrivilegesCodObl);
            //    _filialTableAdapter.
            //}
            //else
            //{
            //    _filialTableAdapter.Fill(pollsDataSet.FILIAL, System.DateTime.Now, System.DateTime.Now);
            //    _structUnitTableAdapter.FillFull(pollsDataSet.STRUCT_UNIT, System.DateTime.Now, System.DateTime.Now);
            //}

            //_rkcTableAdapter=new RKCTableAdapter();
            //_rkcTableAdapter.ClearBeforeFill = false;
            //pollsDataSet.RKC.AddRKCRow("<Отделение>", 0);
            //_rkcTableAdapter.FillByFilial(pollsDataSet.RKC, System.DateTime.Now, System.DateTime.Now,
            //                     (decimal)_user.PrivilegesCodObl);

            //FilialBindingSource = new BindingSource(pollsDataSet,pollsDataSet.FILIAL.TableName);
            //if (_user.PrivilegesCodObl != 0)
            ////Заполняем поле область в зависимости от предоставленых прав доступа
            ////Если это ЦА то CodObl=0 - доступ к анкетам всех подразделений
            ////Иначе - доступ к анкетам в пределах одной области
            //{
            //    FilialBindingSource.DataSource =
            //        _filialTableAdapter.GetData(System.DateTime.Now, System.DateTime.Now).Where(
            //            c => c.COD_FIL == (decimal)_user.PrivilegesCodObl).AsDataView();

            //}
            //else
            //{
            //    FilialBindingSource.DataSource =
            //        _filialTableAdapter.GetData(System.DateTime.Now, System.DateTime.Now);

            //}
            //_structUnitTableAdapter=new STRUCT_UNITTableAdapter();
            //StructUnitBindingSource=new BindingSource(pollsDataSet,pollsDataSet.STRUCT_UNIT.TableName);
            //StructUnitBindingSource.DataSource = _structUnitTableAdapter.GetData(System.DateTime.Now,
            //                                                                     System.DateTime.Now,
            //                                                                     (decimal)_user.PrivilegesCodObl);
            //_rkcTableAdapter=new RKCTableAdapter();
            //_rkcTableAdapter.ClearBeforeFill = false;
            //pollsDataSet.RKC.AddRKCRow("<Отделение>", 0);
            //_rkcTableAdapter.Fill(pollsDataSet.RKC, System.DateTime.Now, System.DateTime.Now,
            //                     (decimal));
            //PollsDataSetTableAdapters.POLL_DEPOSTableAdapter
            //PollsDataSetTableAdapters.POLL_DEPOSTableAdapter
            //pollsBindingSource.ResetBindings(true);
            //PollsDataGridView.
            //pollsBindingSource.
            PollsDataGridView.DataSource = pollsBindingSource;
            //showFormAdd();
            foreach (DataGridViewColumn tmpColumn in PollsDataGridView.Columns)
            {
                tmpColumn.HeaderText = pollsDataSet.POLL_DEPOS.Columns[tmpColumn.Name].Caption;

            }

            //PollsDataGridView.Columns[]
        }