private void AddBrrwrBtn_Click(object sender, EventArgs e)
        {
            string Name    = NameTxt.Text;
            string SSN     = SSNTxt.Text;
            string Address = AddressTxt.Text;
            string Phone   = PhoneTxt.Text;
            string Email   = EmailTxt.Text;

            bool SSN_Unique = Check_SSN(SSN);

            if (!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(SSN) && !string.IsNullOrEmpty(Address))
            {
                SSN = Format_SSN(SSN);

                if (SSN_Unique == true)
                {
                    Execute_Add_Borrower(Name, SSN, Address, Phone, Email);
                }
                else
                {
                    MessageBox.Show("The SSN number provided is already in use.  Please enter another SSN or update the existing record.");
                }
            }
            else
            {
                MessageBox.Show("The values for Name, SSN, and Address must be filled in.");
            }

            NameTxt.Clear();
            SSNTxt.Clear();
            AddressTxt.Clear();
            PhoneTxt.Clear();
            EmailTxt.Clear();
            Load_Borrower_View();
        }
        /// <summary>
        /// Called when the form is about to close. If user pressed OK, we save
        /// the content of plugin here.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event arguments.</param>
        private void AdvancedPipelinePluginForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            // If user chose to press OK or switch to Simple Mode, save plugin info.
            if (DialogResult == DialogResult.OK || DialogResult == DialogResult.Retry)
            {
                // Make sure user has entered a name (unless we're switching to Simple Mode).
                if (!string.IsNullOrEmpty(NameTxt.Text) || DialogResult == DialogResult.Retry)
                {
                    // Update plugin info so that we have a pipeline.
                    UpdatePluginInfo();

                    // If pipeline is too complex, user might lose customization by switching
                    // to simple mode. Warn in this case.
                    Debug.Assert(newPipeline != null);
                    if (DialogResult == DialogResult.Retry && !PipelinePluginEditor.IsPipelineSimple(newPipeline))
                    {
                        DialogResult subDialogRes = MessageBox.Show(Resources.PipelinePluginForm_PipelineTooComplexForSimpleMode,
                                                                    Resources.PipelinePluginForm_MsgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                        if (subDialogRes == DialogResult.No)
                        {
                            e.Cancel = true;
                        }
                    }
                }
                else
                {
                    // Warn user that we need a non-empty name.
                    MessageBox.Show(Resources.PipelinePluginForm_EmptyName, Resources.PipelinePluginForm_MsgTitle,
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    NameTxt.Focus();
                    e.Cancel = true;
                }
            }
        }
        private void Refresh()
        {
            StudentRegTxt.Clear();
            NameTxt.Clear();
            SurnameTxt.Clear();
            GenderCmb.ResetText();
            CellNTxt.Clear();
            EmailTxt.Clear();
            Postaltxt.ResetText();
            CourseCmb.ResetText();
            Statuscmb.ResetText();
            SemesterCmb.ResetText();
            dataGridView1.DataSource = DataAccess.GetStudents();

            dataGridView1.Columns["ID"].DisplayIndex            = 0;
            dataGridView1.Columns["Name"].DisplayIndex          = 1;
            dataGridView1.Columns["Surname"].DisplayIndex       = 2;
            dataGridView1.Columns["Gender"].DisplayIndex        = 3;
            dataGridView1.Columns["Cell"].DisplayIndex          = 4;
            dataGridView1.Columns["Email"].DisplayIndex         = 5;
            dataGridView1.Columns["PostalAddress"].DisplayIndex = 6;
            dataGridView1.Columns["CourseId"].DisplayIndex      = 7;
            dataGridView1.Columns["Semester"].DisplayIndex      = 8;
            dataGridView1.Columns["StatusId"].DisplayIndex      = 9;
        }
 private void NameTxt_Validating(object sender, CancelEventArgs e)
 {
     if (NameTxt.Text.Length > 50)
     {
         MessageBox.Show("Text should be less than 50 char");
     }
     NameTxt.Focus();
 }
Beispiel #5
0
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     SurnameTxt.Clear();
     NameTxt.Clear();
     PatronymicTxt.Clear();
     ProfCmbBox.Text = "";
     OrgCmbBox.Text  = "";
 }
 private void CancelBtn_Click(object sender, EventArgs e)
 {
     NameTxt.Clear();
     SSNTxt.Clear();
     AddressTxt.Clear();
     PhoneTxt.Clear();
     EmailTxt.Clear();
 }
 public void SaveJobAndVerify(string title)
 {
     Jobbtn.Click();
     NameTxt.SendKeys(title);
     PhoneTxt.Click();
     Savebtn.Click();
     System.Threading.Thread.Sleep(6000);
     Homebtn.Click();
     Assert.IsTrue(PropertiesCollection.Validatemessage("test", "/html/body/div[2]/div[2]/span[2]/a"));
 }
Beispiel #8
0
 public void ClearTextBox()
 {
     //Limpia los TXTBOX y Limpia la seleccion del listbox
     AgeTxt.Clear();
     LastNametTxt.Clear();
     NameTxt.Clear();
     PaymentHTxt.Clear();
     TotalHoursTxt.Clear();
     listBox1.ClearSelected();
 }
Beispiel #9
0
 public void ClearTextBox()
 {
     //Limpia los TXTBOX y Limpia la seleccion del listbox
     AgeTxt.Clear();
     LastNametTxt.Clear();
     NameTxt.Clear();
     PaymentHTxt.Clear();
     TotalHoursTxt.Clear();
     listBox1.ClearSelected();
     pictureBox1.Image      = null;
     TotalHoursTxt.ReadOnly = false;
 }
Beispiel #10
0
 private void AddBtn_Click(object sender, EventArgs e)
 {
     EmployeeList.SelectedItem = null;
     NameTxt.BackColor         = Color.White;
     UniqueIdTxt.BackColor     = Color.White;
     _adding           = true;
     EditGroup.Visible = true;
     NameTxt.Text      = "";
     PasswordTxt.Text  = "";
     EmailTxt.Text     = "";
     UniqueIdTxt.Text  = "";
     Save.Visible      = true;
     Delete.Visible    = false;
     NameTxt.Focus();
 }
Beispiel #11
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            try
            {
                String name    = NameTxt.Text; /*storing text from textbox into variable to designated datatypes*/
                String address = AddressTxt.Text;
                Int64  contact = Convert.ToInt64(ContactTxt.Text);
                int    age     = Convert.ToInt32(AgeTxt.Text);
                String gender  = comboGender.Text;
                String blood   = BloodTxt.Text;
                String any     = PreProblemTxt.Text;
                int    pid     = Convert.ToInt32(PaitionIdTxt.Text);

                System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection();
                con.ConnectionString = "data source = DESKTOP-G7R371A\\SQLEXPRESS; database = Hospital; integrated security = True";
                System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
                cmd.Connection = con; /*connecting database*/

                cmd.CommandText = "insert into AddPatient values ('" + name + "', '" + address + "'," + contact + "," + age + ",'" + gender + "','" + blood + "','" + any + "'," + pid + ")";

                System.Data.SqlClient.SqlDataAdapter DA = new System.Data.SqlClient.SqlDataAdapter(cmd);
                DataSet DS = new DataSet(); /*Data set to fill boxes*/
                DA.Fill(DS);
                MessageBox.Show("Data Saved!");
            }
            catch (Exception)
            {
                MessageBox.Show("Please fill up all boxes");
            }

            /*Clearing all boxes*/

            NameTxt.Clear();
            AddressTxt.Clear();
            ContactTxt.Clear();
            AgeTxt.Clear();
            BloodTxt.Clear();
            PreProblemTxt.Clear();
            PaitionIdTxt.Clear();
            comboGender.ResetText();
        }
Beispiel #12
0
 /// <summary>
 /// Called when the form is about to close. If user pressed OK, we save
 /// the content of the plugin here.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">Event arguments.</param>
 private void PipelinePluginForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     // If user chose to press OK or switch to Expert Mode, save plugin info.
     if (this.DialogResult == DialogResult.OK || this.DialogResult == DialogResult.Retry)
     {
         // Make sure user has entered a name (unless we're switching to Expert Mode).
         if (!String.IsNullOrEmpty(NameTxt.Text) || this.DialogResult == DialogResult.Retry)
         {
             // Update plugin info in case it's out-of-date, so that EditPlugin can return it.
             UpdatePluginInfo();
         }
         else
         {
             // Warn user that we need a non-empty name.
             MessageBox.Show(Resources.PipelinePluginForm_EmptyName, Resources.PipelinePluginForm_MsgTitle,
                             MessageBoxButtons.OK, MessageBoxIcon.Warning);
             NameTxt.Focus();
             e.Cancel = true;
         }
     }
 }
Beispiel #13
0
        /// <summary>
        /// Called when the form is about to close. If user pressed OK, we save
        /// the content of the plugin here.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event arguments.</param>
        private void PipelinePluginForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            // If user chose to press OK, save plugin info.
            if (this.DialogResult == DialogResult.OK)
            {
                // Make sure user has entered a name.
                if (!String.IsNullOrEmpty(NameTxt.Text))
                {
                    // Create a pipeline based on form controls.
                    if (pipeline == null)
                    {
                        pipeline = new Pipeline();
                    }
                    else
                    {
                        pipeline.Clear();
                    }
                    if (CopyOnSameLineChk.Enabled)
                    {
                        if (CopyOnSameLineChk.Checked)
                        {
                            pipeline.Elements.Add(new PathsSeparatorPipelineElement(PATHS_SEPARATOR_ON_SAME_LINE));
                        }
                    }
                    else
                    {
                        // Copy non-standard value we had earlier
                        Debug.Assert(!String.IsNullOrEmpty(pathsSeparator));
                        pipeline.Elements.Add(new PathsSeparatorPipelineElement(pathsSeparator));
                    }
                    if (BasePluginLst.SelectedIndex != -1)
                    {
                        pipeline.Elements.Add(new ApplyPluginPipelineElement(
                                                  ((Plugin)BasePluginLst.SelectedItem).Id));
                    }
                    if (FindTxt.Text.Length > 0)
                    {
                        if (UseRegexChk.Checked)
                        {
                            pipeline.Elements.Add(new RegexPipelineElement(FindTxt.Text, ReplaceTxt.Text, IgnoreCaseChk.Checked));
                        }
                        else
                        {
                            pipeline.Elements.Add(new FindReplacePipelineElement(FindTxt.Text, ReplaceTxt.Text));
                        }
                    }
                    if (BackToForwardSlashesRadio.Checked)
                    {
                        pipeline.Elements.Add(new BackToForwardSlashesPipelineElement());
                    }
                    else if (ForwardToBackslashesRadio.Checked)
                    {
                        pipeline.Elements.Add(new ForwardToBackslashesPipelineElement());
                    }
                    if (QuotesChk.Checked)
                    {
                        pipeline.Elements.Add(new QuotesPipelineElement());
                    }
                    if (EmailLinksChk.Checked)
                    {
                        pipeline.Elements.Add(new EmailLinksPipelineElement());
                    }
                    if (EncodeURIWhitespaceChk.Checked)
                    {
                        if (EncodeURICharsChk.Enabled && EncodeURICharsChk.Checked)
                        {
                            pipeline.Elements.Add(new EncodeURICharsPipelineElement());
                        }
                        else
                        {
                            pipeline.Elements.Add(new EncodeURIWhitespacePipelineElement());
                        }
                    }

                    // Create plugin info if we don't already have one.
                    if (pluginInfo == null)
                    {
                        pluginInfo    = new PipelinePluginInfo();
                        pluginInfo.Id = Guid.NewGuid();
                    }

                    // Save info in plugin info wrapper.
                    pluginInfo.Description     = NameTxt.Text;
                    pluginInfo.EncodedElements = pipeline.Encode();
                    pluginInfo.RequiredVersion = pipeline.RequiredVersion;
                    Debug.Assert(!pluginInfo.Global);
                }
                else
                {
                    // Warn user that we need a non-empty name.
                    MessageBox.Show(Resources.PipelinePluginForm_EmptyName, Resources.PipelinePluginForm_MsgTitle,
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    NameTxt.Focus();
                    e.Cancel = true;
                }
            }
        }