Esempio n. 1
0
        public StudentCompanyInformation AddNotes(string id, int sid, string additionalNotes = null)
        {
            StudentCompanyInformation info = new StudentCompanyInformation();

            using (var cn = DbConnSingleton.getDbInstance().GetDBConnection())
            {
                var          query = "insert into student_company_info(student_id,company_id,interest,notes) values(@sid,@id, 1,@notes)";
                MySqlCommand cmd   = new MySqlCommand(query, cn);
                cmd.Parameters.AddWithValue("@notes", additionalNotes.ToString());
                cmd.Parameters.AddWithValue("@id", id);
                cmd.Parameters.AddWithValue("@sid", sid);
                cmd.ExecuteNonQuery();
            }


            info = getStudentCompanyDetails(id, sid);
            return(info);
        }
Esempio n. 2
0
        public StudentCompanyInformation getStudentCompanyDetails(string companyid = null, int studentID = 1, string id = null)
        {
            Job job;
            StudentCompanyInformation information = new StudentCompanyInformation();
            var company_id = "";

            using (var cn = DbConnSingleton.getDbInstance().GetDBConnection())
            {
                string query = null;
                if (companyid != null)
                {
                    query      = "select sc.notes,sc.interest, c.name from company c join student_company_info sc on c.id = sc.company_id join job j on c.id = j.company_id where student_id = @sid and c.id = " + companyid;
                    company_id = companyid;
                }
                else
                {
                    query      = "select sc.notes,sc.interest, c.name  from company c join student_company_info sc on c.id = sc.company_id join job j on c.id = j.company_id where student_id = @sid and c.id = " + id;
                    company_id = id;
                }


                MySqlCommand cmd = new MySqlCommand(query, cn);
                cmd.Parameters.AddWithValue("@sid", studentID);
                MySqlDataAdapter adap = new MySqlDataAdapter(cmd);
                DataTable        dt   = new DataTable();
                adap.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    // information = new StudentCompanyInformation();
                    // job = new Job();
                    information.notes        = dr["notes"].ToString();
                    information.isInterested = dr["interest"].ToString();
                    //job.seeking_degree = dr["seeking_degree"].ToString();
                    //job.type = dr["type"].ToString();
                    //job.visa_sponsorship = dr["visa_sponsorhip"].ToString();
                    //job.title = dr["title"].ToString();
                    information.companyName = dr["name"].ToString();
                    // information.jobs.Add(job);
                }
            }
            information.jobs = getJobs(company_id); // jobs posted by company (if any)
            return(information);
        }
Esempio n. 3
0
        public StudentCompanyInformation editBoothQueue(string id, int studentID, bool inQueue)
        {
            StudentCompanyInformation info = new StudentCompanyInformation();

            using (var cn = DbConnSingleton.getDbInstance().GetDBConnection())
            {
                if (inQueue)
                {
                    MySqlCommand cmd = new MySqlCommand("EditBoothQueue", cn);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@companyid", id);
                    // cmd.Parameters.AddWithValue("@queueval", inQueue);
                    cmd.Parameters.AddWithValue("@studentID", studentID);
                    MySqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                }
            }
            info = getStudentCompanyDetails(id, studentID);
            return(info);
        }
Esempio n. 4
0
        public StudentCompanyInformation UpdateNotes(string id, int sid, string notes = null, string isInterested = null, bool inQueue = false)
        {
            // StudentCompanyDetails compdetails = new StudentCompanyDetails();
            StudentCompanyInformation info = new StudentCompanyInformation();

            using (var cn = DbConnSingleton.getDbInstance().GetDBConnection())
            {
                //var query = "insert into student_company_info(student_id,company_id,interest,notes) values(1,?companyID, ?isInterested, ?notes)";

                var          query = "Update student_company_info set notes = @notes  where company_id = @id and student_id = @sid";
                MySqlCommand cmd   = new MySqlCommand(query, cn);
                cmd.Parameters.AddWithValue("@notes", notes);
                cmd.Parameters.AddWithValue("@id", id);
                cmd.Parameters.AddWithValue("@sid", sid);

                // cmd.Parameters.AddWithValue("?companyID", HttpUtility.ParseQueryString("id").ToString());
                // cmd.Parameters.AddWithValue("?isInterested", 1);
                // cmd.Parameters.AddWithValue("?notes", notes);
                cmd.ExecuteNonQuery();
            }

            info = getStudentCompanyDetails(id, sid);
            return(info);
        }