示例#1
0
        public bool VerifyAppointment(int verifyUserID, string verifyUserPassword, int nAppointmentID)
        {
            TblEmployee verifyUser = new TblEmployee();

            verifyUser.NEmployeeID = verifyUserID;

            verifyUser.SelectOne();

            if (verifyUser.StrPassword.IsNull)
            {
                throw new Exception("Invalid User ID or Password");
            }

            if (verifyUser.StrPassword.Value != verifyUserPassword)
            {
                throw new Exception("Invalid User ID or Password");
            }

            TblAppointment myAppointment = new TblAppointment();

            myAppointment.NAppointmentId = nAppointmentID;
            myAppointment.SelectOne();

            if (!myAppointment.NVerifiedBy.IsNull)
            {
                throw new Exception("This appointment have been verified by other staff with the employee ID : " + myAppointment.NVerifiedBy.Value.ToString());
            }

            myAppointment.NVerifiedBy = verifyUserID;
            //myAppointment.NStatus = 1;
            myAppointment.Update();
            return(true);
        }
示例#2
0
        public bool CloseAppointment(int nAppointmentID)
        {
            TblAppointment myAppointment = new TblAppointment();

            myAppointment.NAppointmentId = nAppointmentID;
            myAppointment.SelectOne();
            myAppointment.NStatus = 2;
            myAppointment.Update();

            TblContacts myContact = new TblContacts();

            myContact.UpdateLeadStatus(Convert.ToInt32(myAppointment.NContactId.Value), 0);
            return(true);
        }