Пример #1
0
 //Creates a new notes window with an id and the openining window reference
 public Notes(string note, int id, secondWindow openiningWindow)
 {
     InitializeComponent();
     notes.Text = note;
     idOfRow    = id;
     window     = openiningWindow;
 }
Пример #2
0
        public Settings(secondWindow window)
        {
            InitializeComponent();
            secondWin = window;
            try
            {
                //Open the settings file if it exsists
                FileStream settings = new FileStream(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Contracts\\settings.txt"), FileMode.Open);
                using (var streamReader = new StreamReader(settings, Encoding.UTF8))
                {
                    string line;
                    int    i = 0;
                    //Read the settings and set the text boxes
                    while ((line = streamReader.ReadLine()) != null)
                    {
                        switch (i)
                        {
                        case 0:
                            IP.Text = line;
                            i++;
                            break;

                        case 1:
                            port.Text = line;
                            i++;
                            break;

                        case 2:
                            defaultEmailText.Text = line;
                            i++;
                            break;

                        case 3:
                            database.Text = line;
                            i++;
                            break;
                        }
                    }
                }
                settings.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                return;
            };
        }
Пример #3
0
        public newContract(secondWindow window)
        {
            InitializeComponent();

            //Set the text color to a partially transparent grey
            Color           test  = Color.FromArgb(190, 190, 198, 212);
            SolidColorBrush color = new SolidColorBrush(test);

            nameOfContract.Foreground = color;
            extraNotes.Foreground     = color;
            attorneys.Foreground      = color;

            //Set the member variable to the window sent in when this is created
            openiningWindow = window;


            Thread combo = new Thread(fillCombo);

            combo.Start();
        }
        /// <summary>
        /// Open a contract from a data row view
        /// </summary>
        /// <param name="contractToOpen">The contract that is being opened</param>
        /// <param name="openiningWindow"></param>
        public openContract(DataRowView contractToOpen, secondWindow openiningWindow)
        {
            InitializeComponent();
            this.openiningWindow = openiningWindow;
            DataRowView rowView = contractToOpen;

            //Get all values one by one
            nameOfContract = rowView.Row[0].ToString();
            dateRecieved   = rowView.Row[1].ToString();
            dateCompleted  = rowView.Row[2].ToString();
            attorney       = rowView.Row[3].ToString();
            notes          = rowView.Row[6].ToString();
            contractExt    = rowView.Row[8].ToString();
            tribalExt      = rowView.Row[9].ToString();

            //For casting try all of them
            try
            {
                id = (int)rowView.Row[10];
            } catch
            {
                this.Close();
            }

            //Not always going to have an uploadedDocument
            try
            {
                uploadedDocument = (byte[])rowView.Row[4];
            } catch
            {
                uploadedDocument = null;
            }

            try
            {
                tribalCoverSheet = (byte[])rowView.Row[5];
            } catch
            {
                tribalCoverSheet = null;
            }
            try
            {
                certificateOfInsurance = (bool)rowView.Row[7];
            } catch { certificateOfInsurance = false; }



            createDateCompleted();

            nameOfContractTextBox.Text = nameOfContract;
            dateRecievedTextBox.Text   = dateRecieved;
            noteTextBox.Text           = notes;
            //Fill the attorney combo box
            ThreadStart starter = fillCombo;

            starter += () =>
            {
                this.Dispatcher.BeginInvoke(new Action(() => attorneys.SelectedItem = attorney));
            };
            update = new Thread(starter)
            {
                IsBackground = true
            };
            update.Start();

            COI.IsChecked = certificateOfInsurance;
        }