Ejemplo n.º 1
0
        private void btnAppointmentList_Click(object sender, EventArgs e)
        {
            frmAppointmentList frmList = new frmAppointmentList();

            frmList.Condition = "APPOINTMENTDATE = '" + objVisitorGP.GateDate.ToString("yyyy-MM-dd") + "'";
            frmList.IsList    = true;
            frmList.ShowDialog();

            if (!frmList.IsListCancel)
            {
                Appointment objApp = new Appointment();
                objApp = AppointmentManager.GetItem(frmList.DBID);

                // Fetch Appointment Detail
                objVisitorGP.AppointmentNo = objApp.AppointmentNo;
                objVisitorGP.VisitorID     = objApp.VisitorID;
                objVisitorGP.VisitorName   = objApp.Name;
                objVisitorGP.CompanyName   = objApp.Company;
                objVisitorGP.ContactNo     = objApp.ContactNo;

                //Fetch VIsitor Detail
                Employee objEmp = new Employee();
                objEmp = EmployeeManager.GetItem(objApp.EmployeeID);
                objVisitorGP.EmployeeID = objEmp.DBID;
                objVisitorGP.ToMeet     = objEmp.Initials;
                objVisitorGP.EmpDept    = objEmp.DeptName;
                objVisitorGP.EmpMobile  = objEmp.MobileNo;

                // Display Detail on Form
                lblAppointmentNo.Text = objVisitorGP.AppointmentNo;
                lblVisitorName.Text   = objApp.Name;
                lblCompany.Text       = objApp.Company;
                lblContactNo.Text     = objApp.ContactNo;

                lblToMeet.Text     = objVisitorGP.ToMeet;
                lblEmpDept.Text    = objVisitorGP.EmpDept;
                lblEmpContact.Text = objVisitorGP.EmpMobile;

                // Fetch Here Last Image of visitor
                byte[] vImage = VisitorGatePassManager.GetVisitorImage(objApp.VisitorID);
                if (vImage != null)
                {
                    MemoryStream mem = new MemoryStream(vImage);

                    picVisitorImg.Image       = Image.FromStream(mem);
                    objVisitorGP.VisitorImage = vImage;
                    picVideo.Visible          = false;
                    picVisitorImg.Visible     = true;
                }
                btnVisitorList.Enabled = false;
                btnEmpList.Enabled     = false;

                SendKeys.Send("{TAB}");
            }
            frmList.Dispose();
        }
Ejemplo n.º 2
0
 private void appointmentMasterToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         //frmAppointmentList objFrmList = new frmAppointmentList();
         frmAppointmentList objFrmList = new frmAppointmentList(CurrentCompany, CurrentUser);
         objFrmList.MdiParent = this;
         objFrmList.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }