Beispiel #1
0
        private void ViewNote(string noteGuid)
        {
            string noteText;
            string noteTimeStamp;

            try
            {
                OkButton.Visible = false;
                NotesTextBox.Clear();
                using (var results = DBFactory.GetDatabase().DataTableFromQueryString(Queries.SelectNoteByGuid(noteGuid)))
                {
                    noteText      = results.Rows[0][SibiNotesCols.Note].ToString();
                    noteTimeStamp = results.Rows[0][SibiNotesCols.DateStamp].ToString();
                }
                this.Text += " - " + noteTimeStamp;
                NotesTextBox.TextOrRtf(noteText);
                NotesTextBox.ReadOnly  = true;
                NotesTextBox.BackColor = Color.White;
                Show();
                Activate();
            }
            catch (Exception ex)
            {
                ErrorHandling.ErrHandle(ex, System.Reflection.MethodBase.GetCurrentMethod());
            }
        }
        private void newWorkerSubmit_Click(object sender, EventArgs e)
        {
            string newUserBannerId    = BannerTextBox.Text;
            string newUserFirstName   = FirstNameTextBox.Text;
            string newUserLastName    = LastNameTextBox.Text;
            string newUserPhoneNumber = PhoneNumberTextBox.Text;
            string newUserEmail       = EmailTextBox.Text;
            string newUserUserType    = UserTypeTextBox.Text;
            string newUserNotes       = NotesTextBox.Text;
            string newUserStatus      = StatusTextBox.Text;

            User newUser = new User(newUserBannerId, newUserFirstName, newUserLastName, newUserPhoneNumber, newUserEmail, newUserUserType, newUserNotes, newUserStatus);

            newUser.insert();

            BannerTextBox.Clear();
            FirstNameTextBox.Clear();
            LastNameTextBox.Clear();
            PhoneNumberTextBox.Clear();
            EmailTextBox.Clear();
            UserTypeTextBox.Clear();
            NotesTextBox.Clear();
            StatusTextBox.Clear();

            NewWorkerNotificationLabel.Text = "User added to database";
        }
Beispiel #3
0
        private void LogDateTimePicker_ValueChanged(object sender, EventArgs e)
        {
            //fill in notes
            string[]     lglines;
            LogXDataBase lgdb = new LogXDataBase();

            char[] splt  = { '*' };
            string lgstr = lgdb.GetNote(LogDateTimePicker.Value.ToShortDateString());

            if (lgstr != null)
            {
                lglines = lgstr.Split(splt, StringSplitOptions.RemoveEmptyEntries);
                foreach (string lg in lglines)
                {
                    NotesTextBox.AppendText("*" + lg + "\r\n");
                }
                return;
            }
            return;
        }
        private void SubmitButton_Click(object sender, EventArgs e)
        {
            myUserToModify.SetFirstName(FirstNameTextBox.Text);
            myUserToModify.SetLastName(LastNameTextBox.Text);
            myUserToModify.SetPhoneNumber(PhoneNumberTextBox.Text);
            myUserToModify.SetEmailAddress(EmailTextBox.Text);
            myUserToModify.SetUserType(UserTypeTextBox.Text);
            myUserToModify.SetNotes(NotesTextBox.Text);
            myUserToModify.SetStatus(StatusTextBox.Text);

            myUserToModify.update();

            FirstNameTextBox.Clear();
            LastNameTextBox.Clear();
            PhoneNumberTextBox.Clear();
            EmailTextBox.Clear();
            UserTypeTextBox.Clear();
            NotesTextBox.Clear();
            StatusTextBox.Clear();

            NewWorkerNotificationLabel.Text = "User updated";
        }
        private void OpenProject()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Filter = "Syngrafeas Project (*.syfs)|*.syfs"
            };

            if (openFileDialog.ShowDialog() == true)
            {
                project = new ProjectFile(openFileDialog.FileName);
                project.LoadProject();
                mainWindow.Title = "Syngrafeas - " + project.ProjectName;
                NotesTextBox.Clear();
                for (int i = 0; i < project.notes.Count; i++)
                {
                    NotesTextBox.Text += project.notes[i] + Environment.NewLine;
                }

                RefreshTables();

                for (int i = 0; i < project.parts.Count; i++)
                {
                    TreeViewItem tvItem = new TreeViewItem
                    {
                        Header = project.parts[i].Name
                    };
                    for (int j = 0; j < project.parts[i].chapters.Count; j++)
                    {
                        TreeViewItem subtvItem = new TreeViewItem
                        {
                            Header = project.parts[i].chapters[j].Name
                        };
                        tvItem.Items.Add(subtvItem);
                    }
                    tvItem.IsExpanded = true;
                    ProjectTreeView.Items.Add(tvItem);
                }
            }
        }
 //TODO: Iterate through properties and dynamically generate controls at runtime.
 private void InitDBControls()
 {
     EntryTimeTextBox.SetDBInfo(HistoricalDevicesCols.ActionDateTime, ParseType.DisplayOnly, false);
     ActionUserTextBox.SetDBInfo(HistoricalDevicesCols.ActionUser, ParseType.DisplayOnly, false);
     ChangeTypeTextBox.SetDBInfo(HistoricalDevicesCols.ChangeType, Attributes.DeviceAttributes.ChangeType, ParseType.DisplayOnly, false);
     DescriptionTextBox.SetDBInfo(HistoricalDevicesCols.Description, ParseType.DisplayOnly, false);
     GuidTextBox.SetDBInfo(HistoricalDevicesCols.DeviceGuid, ParseType.DisplayOnly, false);
     CurrentUserTextBox.SetDBInfo(HistoricalDevicesCols.CurrentUser, ParseType.DisplayOnly, false);
     LocationTextBox.SetDBInfo(HistoricalDevicesCols.Location, Attributes.DeviceAttributes.Locations, ParseType.DisplayOnly, false);
     PONumberTextBox.SetDBInfo(HistoricalDevicesCols.PO, ParseType.DisplayOnly, false);
     AssetTagTextBox.SetDBInfo(HistoricalDevicesCols.AssetTag, ParseType.DisplayOnly, false);
     PurchaseDateTextBox.SetDBInfo(HistoricalDevicesCols.PurchaseDate, ParseType.DisplayOnly, false);
     OSVersionTextBox.SetDBInfo(HistoricalDevicesCols.OSVersion, Attributes.DeviceAttributes.OSType, ParseType.DisplayOnly, false);
     SerialTextBox.SetDBInfo(HistoricalDevicesCols.Serial, ParseType.DisplayOnly, false);
     ReplaceYearTextBox.SetDBInfo(HistoricalDevicesCols.ReplacementYear, ParseType.DisplayOnly, false);
     EQTypeTextBox.SetDBInfo(HistoricalDevicesCols.EQType, Attributes.DeviceAttributes.EquipType, ParseType.DisplayOnly, false);
     NotesTextBox.SetDBInfo(HistoricalDevicesCols.Notes, ParseType.DisplayOnly, false);
     StatusTextBox.SetDBInfo(HistoricalDevicesCols.Status, Attributes.DeviceAttributes.StatusType, ParseType.DisplayOnly, false);
     EntryGuidTextBox.SetDBInfo(HistoricalDevicesCols.HistoryEntryGuid, ParseType.DisplayOnly, false);
     chkTrackable.SetDBInfo(HistoricalDevicesCols.Trackable, ParseType.DisplayOnly, false);
     PhoneNumberTextBox.SetDBInfo(HistoricalDevicesCols.PhoneNumber, ParseType.DisplayOnly, false);
     HostnameTextBox.SetDBInfo(HistoricalDevicesCols.HostName, ParseType.DisplayOnly, false);
     iCloudTextBox.SetDBInfo(HistoricalDevicesCols.iCloudAccount, ParseType.DisplayOnly, false);
 }
Beispiel #7
0
        //Submit button inserts Bicycle
        private void SubmitButton_Click(object sender, RoutedEventArgs e)
        {
            string  bikeMakeText          = BikeMakeTextBox.Text;
            string  modelNumberText       = ModelNumberTextBox.Text;
            string  serialNumberText      = SerialNumberTextBox.Text;
            string  colorText             = ColorTextBox.Text;
            string  descriptionText       = DescriptionTextBox.Text;
            string  locationText          = LocationTextBox.Text;
            string  physicalConditionText = PhysicalConditionTextBox.Text;
            string  notesText             = NotesTextBox.Text;
            Vehicle newVehicle            = new Vehicle(bikeMakeText, modelNumberText, serialNumberText, colorText,
                                                        descriptionText, locationText, physicalConditionText, notesText);

            newVehicle.insert();
            BikeMakeTextBox.Clear();
            ModelNumberTextBox.Clear();
            SerialNumberTextBox.Clear();
            ColorTextBox.Clear();
            DescriptionTextBox.Clear();
            NotesTextBox.Clear();
            MessageBox.Show("Vehicle inserted successfully!");
            this.Hide();
            myCaller.Show();
        }
        private void IsItemSelected(bool selected, ListViewItem item = null)
        {
            CurrentlySelectedItem = item;

            RequiresButton.Enabled          = selected;
            EditButton.Enabled              = selected;
            ChangelogCompilerButton.Enabled = selected;
            RemoveButton.Enabled            = selected;
            LinkLinkLabel.Enabled           = selected;

            if (item == null)
            {
                UpdatedTextBox.Clear();
                UpdateModeTextBox.Clear();
                SizeTextBox.Clear();
                SideTextBox.Clear();
                LinkTextBox.Clear();
                MD5TextBox.Clear();
                MinecraftVersionTextbox.Clear();
                RequiresTextBox.Clear();
                NotesTextBox.Clear();
            }
            else
            {
                Mod selectedMod = (Mod)CurrentlySelectedItem.Tag;
                UpdatedTextBox.Text          = selectedMod.Date.ToLocalTime().ToString();
                UpdateModeTextBox.Text       = selectedMod.UpdateMode.ToString();
                SizeTextBox.Text             = selectedMod.Size;
                SideTextBox.Text             = selectedMod.Side.ToString();
                LinkTextBox.Text             = selectedMod.Link;
                MD5TextBox.Text              = selectedMod.MD5;
                MinecraftVersionTextbox.Text = selectedMod.MinecraftVersionToString();
                RequiresTextBox.Text         = selectedMod.RequiresToString();
                NotesTextBox.Text            = selectedMod.Notes;
            }
        }
Beispiel #9
0
 public void WriteTextLog(string logString)
 {
     //Writes the specified logString to the log text box, prepending the current time
     NotesTextBox.AppendText("* " + DateTime.Now.ToShortTimeString() + ": " + logString + "\r\n");
 }
Beispiel #10
0
 public void ClearQueControl()
 {
     this.QueName   = ""; this.TrimFactor = 0; QueNameTextBox.Clear(); NotesTextBox.Clear(); AxisQuantityTextBox.Clear();  this.IsActive = false; this.IsAxis = false;
     this.AxisIndex = -1; this.QueNotes = "CLEAR";
 }
Beispiel #11
0
        //When a suspect is chosen from the textbox list, parse the line for galaxy name and date
        //  then have TSX open the difference image, the reference image and the current image
        //  then have TSX set the FOV to the size of the galaxy, set the center of the chart to the
        //  coordinates of the suspect and place the target circle over the coordinates.
        //
        //Then...
        //
        private void SuspectListbox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ///If nothing selected then exit
            ///
            ///Parse the selected line for the galaxy name and image time.
            ///Load up the suspect data
            ///Lay in the clearer follow up image and prep to blink the two latest images
            ///

            //Set the cursor to wait
            UseWaitCursor = true;
            Show();
            FormCrunchingNotice cForm = new FormCrunchingNotice();

            cForm.Show();
            BlinkButton.BackColor = Color.LightSalmon;
            //pull the selected suspect entry from the suspect list box
            string susitem;

            try { susitem = SuspectListbox.Items[SuspectListbox.SelectedIndex].ToString(); }
            catch (Exception ex) { return; }
            //Clear the blink list
            BlinkList = null;
            //Parse the selected entry for relavent info and create a suspect object to work with
            int    galLen  = susitem.IndexOf("\t");
            string galname = susitem.Substring(0, galLen - 1);

            galname = galname.TrimEnd();
            int      dateLen  = susitem.IndexOf(":") - galLen + 2;
            string   galevent = susitem.Substring(galLen + 1, dateLen);
            DateTime galdate  = Convert.ToDateTime(galevent);

            CurrentSuspect = new Suspect();
            //Check to see if the stored suspect info loads ok, if so then
            //  have TSX upload the image files and target the RA/Dec
            bool susLoad = CurrentSuspect.Load(galname, galdate);

            if (susLoad)
            {
                CurrentDrillDown = new DrillDown(CurrentSuspect.Event);

                CurrentDrillDown.Display(galname, CurrentSuspect.SuspectRA, CurrentSuspect.SuspectDec);

                sky6StarChart         tsx_sc = new sky6StarChart();
                sky6ObjectInformation tsx_oi = new sky6ObjectInformation();
                //Get the galaxy major axis
                tsx_sc.Find(galname);
                tsx_oi.Index = 0;
                tsx_oi.Property(Sk6ObjectInformationProperty.sk6ObjInfoProp_MAJ_AXIS_MINS);
                double galaxis = tsx_oi.ObjInfoPropOut;
                //Set the FOV size to  the galaxy size
                tsx_sc.FieldOfView = galaxis / 60;
                //Set the center of view to the suspect//s RA/Dec and light up the target icon
                //tsx_sc.Find(suspect.SuspectRA.ToString() + ", " + suspect.SuspectDec.ToString());
                tsx_sc.RightAscension = CurrentSuspect.SuspectRA;
                tsx_sc.Declination    = CurrentSuspect.SuspectDec;
                //Check TNS for supernova reports for 60 arc seconds around this location for the last 10 days
                TNSReader     tnsReport = new TNSReader();
                List <string> snList    = tnsReport.RunLocaleQuery(CurrentSuspect.SuspectRA, CurrentSuspect.SuspectDec, 60, 10);
                if (snList != null)
                {
                    NotesTextBox.AppendText("Supernova reported for " + snList[0] + " at this location\r\n");
                }
                else
                {
                    NotesTextBox.AppendText("No supernova report for this location\r\n");
                }
                //Give the user an opportunity to clear the suspect by updating its status to cleared -- or not.
                Clipboard.Clear();
                try { Clipboard.SetText(CurrentSuspect.SuspectRA.ToString() + ", " + CurrentSuspect.SuspectDec.ToString()); }
                catch (Exception ex)
                {
                    NotesTextBox.AppendText(ex.Message);
                    return;
                }
                //Display the suspect position information
                NotesTextBox.AppendText("Suspect RA and Dec written to clipboard\r\n");
                LocationTextBox.Text = CurrentSuspect.SuspectRA.ToString() + ", " + CurrentSuspect.SuspectDec.ToString();
                Show();
                System.Windows.Forms.Application.DoEvents();
                //Show followup Image in picture box
                CurrentFollowUpImage     = CurrentDrillDown.GetFollowUpImage(ImageZoom);
                ImagePictureBox.SizeMode = PictureBoxSizeMode.CenterImage;
                ImagePictureBox.Image    = CurrentFollowUpImage;
                BlinkButton.BackColor    = Color.LightGreen;
                ClearButton.BackColor    = Color.LightGreen;
                UseWaitCursor            = false;
            }
            cForm.Close();
            Show();
            return;
        }