Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            _CheckColor = CheckText_in_Box();

            if (_CheckColor)
            {
                try
                {
                    CheckLengthTextBox();
                    DataBaseCommon.AddData(Grid_AddType, _BufferSex, DatePr.Text);
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                }
                finally
                {
                    DatePr.Text        = null;
                    BSMan.Background   = null;
                    BSWoman.Background = null;
                    _BufferSex         = null;
                    DatePr.IsEnabled   = false;
                    CheckB.IsChecked   = false;
                }
            }
        }
Exemplo n.º 2
0
        private void ShowFirstnameBox_KeyUp(object sender, KeyEventArgs e)
        {
            List <DTablePB> result = new List <DTablePB>();

            if (DataBaseCommon.FieldName.Contains("FirstName") == false)
            {
                DataBaseCommon.FieldName.Add("FirstName");
            }

            if (_FNameText)
            {
                if (_FName == 0)
                {
                    DataBaseCommon.FieldInfo.Add(ShowFirstnameBox.Text);
                    ++_FName;
                }
                _FNameText = false;
            }

            if (_IndxFName == -3)
            {
                if (ShowFirstnameBox.Text.Length > 0)
                {
                    if (DataBaseCommon.FieldInfo.Count == 1)
                    {
                        _IndxFName = 0;
                    }
                    else
                    {
                        _IndxFName = DataBaseCommon.FieldInfo.Count - 1;         //LOOK AT INDEX!!!
                    }
                    DataBaseCommon.FieldInfo[_IndxFName] = ShowFirstnameBox.Text;
                    _IndxFName = DataBaseCommon.FieldInfo.IndexOf(ShowFirstnameBox.Text);
                }
            }

            if (_IndxFName > -1)
            {
                DataBaseCommon.FieldInfo[_IndxFName] = ShowFirstnameBox.Text;
            }

            _IndxFName = DataBaseCommon.FieldInfo.IndexOf(ShowFirstnameBox.Text);

            if (ShowFirstnameBox.Text.Length == 0)
            {
                DataBaseCommon.FieldName.Remove("FirstName");
                _IndxFName = -3;
                _FNameText = true;
            }

            if (DataBaseCommon.FieldName.Count > 0)
            {
                DataGRID.IsReadOnly  = true;
                DataGRID.ItemsSource = DataBaseCommon.ShowData(result, ShowFirstnameBox.Text);
            }
        }
Exemplo n.º 3
0
        private void DataGRID_Loaded(object sender, RoutedEventArgs e)
        {
            List <DTablePB> result = new List <DTablePB>();

            DataGRID.ItemsSource = DataBaseCommon.AllDataSearch(result);
        }