Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (txtajEmpName.TextLength != 0 && txtajEmpSurname.TextLength != 0)
            {
                WorkRequest submitRequest = new WorkRequest();

                submitRequest.Name            = txtajEmpName.Text;
                submitRequest.Surname         = txtajEmpSurname.Text;
                submitRequest.WorkDuration    = workDuration;
                submitRequest.WorkRequirement = workRequest;
                if (submitRequest.SubmitRequest() == true)
                {
                    Message += new Display.myDelegate(Display.Success);
                    Message.Invoke();
                }
                else
                {
                    Message += new Display.myDelegate(Display.Failure);
                    Message.Invoke();
                }
            }
            else
            {
                Message += new Display.myDelegate(Display.Error);
                Message.Invoke();
            }
        }
Exemplo n.º 2
0
        private void btnEnd_Click(object sender, EventArgs e)
        {
            call.EndTime    = DateTime.Now;
            call.EmpName    = ename;
            call.EmpSurname = esurname;
            call.Reason     = cmbReason.Text;

            call.ClientType = cmbClientType.Text;

            if (txtWorkRequirement.Text != string.Empty || cmbReason.Text != string.Empty)
            {
                submitRequest.WorkRequirement = txtWorkRequirement.Text;
                submitRequest.WorkDuration    = "Pending";
                submitRequest.Name            = ename;
                submitRequest.Surname         = esurname;
            }
            if (cmbClientType.Text == "Individual")
            {
                call.CustomerName    = txtFirstName.Text;
                call.CustomerSurname = txtLastName_Business.Text;
                call.BusinessName    = txtLastName_Business.Text;
            }
            else
            {
                call.CustomerName    = txtLastName_Business.Text;
                call.CustomerSurname = txtLastName_Business.Text;
                call.BusinessName    = txtLastName_Business.Text;
                call.EmpName         = ename;
                call.EmpSurname      = esurname;
                call.BusinessName    = txtLastName_Business.Text;
            }

            if (call.InitiateCall() == true && submitRequest.SubmitRequest() == true)
            {
                timer1.Stop();
                lblTimer.Visible = false;
                Message         += new Display.myDelegate(Display.Success);
                Message.Invoke();
                ClearTextBoxes();
                btnEnd.Visible      = false;
                panel1.Visible      = false;
                panel2.Visible      = false;
                btnReport.Visible   = false;
                pictureBox1.Visible = false;
                pictureBox2.Visible = false;
            }
            else
            {
                Message += new Display.myDelegate(Display.Failure);
                Message.Invoke();
            }
        }