Esempio n. 1
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != String.Empty && textBox2.Text != String.Empty)
     {
         try
         {
             PfsHandler.ReadReplaceRequest("PfsVerifyUserInput", Properties.Resources.PfsVerifyUserInput, new string[] { textBox1.Text, textBox2.Text }, new string[] { "USER_ID", "PASSWORD" });
             if (PfsHandler.ResponseOK())
             {
                 textBox1.Enabled    = false;
                 textBox2.Enabled    = false;
                 buttonLogin.Enabled = false;
                 MessageBox.Show("Logged in.");
             }
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.StackTrace);
         }
     }
     else
     {
         MessageBox.Show("Make sure both fields are not empty.");
     }
 }
Esempio n. 2
0
        private void DataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (e.ColumnIndex == 0 && e.RowIndex >= 0)
            {
                string statusLabelTemp = statusLabel.Text;
                var    item            = senderGrid.Rows[e.RowIndex].Cells[0].Value.ToString();

                try
                {
                    statusLabel.Text = "Processing request...";
                    if (!String.IsNullOrWhiteSpace(item))
                    {
                        statusLabel.Text = String.Format("{0} : {1}", "Saving request using code", item);
                        PfsHandler.ReadReplaceRequest("PfsSendSignOff", Properties.Resources.PfsSendSignOff, item, Requests.SerialNumber);
                        if (PfsHandler.ResponseOK())
                        {
                            bool ok = true;
                        }
                    }
                    else
                    {
                        MessageBox.Show("The request could not be empty.");
                    }
                }
                catch (Exception s)
                {
                    Console.WriteLine(s.StackTrace);
                    statusLabel.Text = "Error while saving.";
                }
                finally
                {
                    statusLabel.Text = "Done.";
                    MessageBox.Show("Transfer file saved.");
                }
                statusLabel.Text = statusLabelTemp;
            }
        }