示例#1
0
        protected void GridActionWaitingList(object sender, GridViewCommandEventArgs e)
        {
            int         tripId     = Convert.ToInt32(Request.QueryString["tripId"]);
            GridViewRow row        = GridViewRegistered.SelectedRow;
            string      RegisterID = e.CommandArgument.ToString();
            int         staffId    = Convert.ToInt32(Session["StaffId"]);

            if (e.CommandName == "Shortlist")
            {
                TripDAO TripDAO  = new TripDAO();
                Trip    TripList = new Trip();
                int     TRIPPYLIST;
                TRIPPYLIST = TripDAO.updateShortlisted(RegisterID, tripId);
                InterviewDAO intDao      = new InterviewDAO();
                string       adminNo     = intDao.exchangeRegIdForAdminNo(RegisterID);
                int          updateStuds = intDao.selectForInterview(adminNo, staffId, tripId);
                Response.Redirect(Request.RawUrl);
            }
            else if (e.CommandName == "Move to pending")
            {
                TripDAO TripDAO  = new TripDAO();
                Trip    TripList = new Trip();
                int     TRIPPYLIST;
                TRIPPYLIST = TripDAO.updateRegistered(RegisterID, tripId);
                Response.Redirect(Request.RawUrl);
            }
        }
示例#2
0
        public static string emailStudent(string emailDate, string emailTime, string intId)
        {
            System.Diagnostics.Debug.WriteLine(emailDate + " this is tripId@@@ ");
            System.Diagnostics.Debug.WriteLine(emailTime + " this is adminNo@@@ ");
            InterviewDAO interviewDao = new InterviewDAO();

            interviewDao.insertDateTime(intId, emailDate, emailTime);
            string     adminNo = interviewDao.exchangeIntIdForAdminNo(intId);
            SmtpClient client  = new SmtpClient();

            client.Port                  = 25;
            client.Host                  = "smtp-mail.outlook.com";
            client.EnableSsl             = true;
            client.Timeout               = 10000;
            client.UseDefaultCredentials = false;
            client.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "msJasmine1");
            //string recipient = adminNo + "@mymail.nyp.edu.sg";
            MailMessage mail = new MailMessage("*****@*****.**", "*****@*****.**");

            mail.Subject = "You are scheduled for an interview!";
            mail.Body    = "The interview will be on " + emailDate + ", " + emailTime;
            client.Send(mail);

            return(emailDate + emailTime);
        }
示例#3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            sessionId = Request.QueryString["sessionId"];
            token     = Request.QueryString["token"];
            string       remarks = remarksTb.Text;
            InterviewDAO intDao  = new InterviewDAO();

            intDao.submitRemarks(token, sessionId, remarks);
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Adminno"] == null)
     {
         Response.Redirect("./loginStudent.aspx");
     }
     else
     {
         string       adminNo      = Session["AdminNo"].ToString();
         InterviewDAO interviewDao = new InterviewDAO();
         intSessions = interviewDao.fetchSession(adminNo);
     }
 }
示例#5
0
        public bool PostInterview(InterviewDAO interview)
        {
            InterviewServiceClient client = new InterviewServiceClient();

            try
            {
                bool result = client.CreateInterview(interview);
                return result;
            }
            catch (FaultException<KaskServiceException> e)
            {
                throw new HttpException(e.Message);
            }
        }
示例#6
0
        public static string createSession(int intId)
        {
            int    apiKey    = 46243942;
            string apiSecret = "f12c7bc2592d9b613b3e2fadae2cbbf0bc32cb2d";

            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
            var          OpenTok      = new OpenTok(apiKey, apiSecret);
            var          session      = OpenTok.CreateSession();
            string       sessionId    = session.Id;
            string       token        = session.GenerateToken();
            InterviewDAO interviewDao = new InterviewDAO();

            interviewDao.createSession(sessionId, token, intId);

            return(token + "__________" + sessionId);
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
            if (Session["role"] == null)
            {
                Response.Redirect("loginStudent.aspx");
            }
            sessionId = Request.QueryString["sessionId"];
            token     = Request.QueryString["token"];
            if (sessionId == null || token == null)
            {
                Response.Redirect("loginStudent.aspx");
            }
            InterviewDAO intDao  = new InterviewDAO();
            string       adminNo = intDao.checkSession(sessionId, token);

            if (Session["role"].ToString() != "Incharge")
            {
                if (adminNo != Session["adminNo"].ToString())
                {
                    Response.Redirect("./Oops.aspx");
                }
            }
        }
示例#8
0
        public async Task<ActionResult> Create(FormCollection collection)
        {
            try
            {
                if (Request.Form["acknowledgeAccurateDataCheckbox"] != null)
                {
                    // save application form data back to database through service
                    using (HttpClient httpClient = new HttpClient())
                    {
                        httpClient.BaseAddress = new Uri("http://localhost:51309");
                        httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        HttpResponseMessage result = new HttpResponseMessage();
                        string resultContent = "";

                        // find applicant id from the previously submitted Application form, if available
                        int applicantID = 0;
                        if (Convert.ToInt32(Request.Form["applicantID"]) > 0)
                        {
                            applicantID = Convert.ToInt32(Request.Form["applicantID"]);
                        }
                        // otherwise, get last applicant id from database
                        else
                        {
                            var applieds = await ServerResponse<List<AppliedDAO>>.GetResponseAsync(ServiceURIs.ServiceAppliedUri);
                            applicantID = applieds.Last().ApplicantID;
                        }

                        // and save the short answer responses (both to SAResponses and to Interview tables)

                        // TODO: change the hardcoded "50" into some sort of variable
                        // (i.e. the length of all possible SA responses from form)
                        for (int i = 0; i < 50; i++)
                        {
                            try
                            {
                                if (Request.Form["SAResponse_" + i] != null)
                                {
                                    // save short answer response to SAResponses, first
                                    // so gather up response info:
                                    SAResponseDAO saResponse = new SAResponseDAO();
                                    saResponse.SAResponseDescription = Request.Form["SAResponse_" + i];

                                    // post (save) short answer response data to SAResponses
                                    result = httpClient.PostAsJsonAsync(ServiceURIs.ServiceSAResponseUri, saResponse).Result;
                                    resultContent = result.Content.ReadAsStringAsync().Result;

                                    // then get last inserted short answer response ID for the Interview table later
                                    var saResponses = await ServerResponse<List<SAResponseDAO>>.GetResponseAsync(ServiceURIs.ServiceSAResponseUri);
                                    int lastInsertedSaResponseId = saResponses.Last().SAResponseID;

                                    // gather short answer response data
                                    InterviewDAO interview = new InterviewDAO();
                                    interview.ApplicantID = applicantID;
                                    interview.SAQuestionID = i;
                                    interview.SAResponseID = lastInsertedSaResponseId;
                                    //interview.UserID = applicantID; // this might be overlapping... we might just need applicantID for later matchups...

                                    // post (save) short answer response data to Interview table
                                    result = httpClient.PostAsJsonAsync(ServiceURIs.ServiceInterviewUri, interview).Result;
                                    resultContent = result.Content.ReadAsStringAsync().Result;
                                }
                            }
                            catch { }
                        }
                    }

                    // allow applicant to either create new account or log in
                    return RedirectToAction("Register", "Account");
                }
                else
                {
                    // TODO: validation later on...
                    return RedirectToAction("Create");
                }
            }
            catch
            {
                // TODO: validation later on...
                return RedirectToAction("Create");
            }
            
        }