示例#1
0
        public List <IVacancy> VacancyWithNULLRecruitmentRequestID() //
        {                                                            //used for creating RecruitmentRequests
            //ADO.NET program for searching vacancies with recruitmentRequestID as null

            SqlConnection conn = DBUtility.GetConnection();

            vacancyList.Clear();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "sp_vacancyWithNULLRecruitmentRequestID_667015";
            //cmd.Parameters.AddWithValue("@recruitmentRequestID", recruitmentRequestID);

            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                int      vacancyID     = reader.GetInt32(0);
                int      noOfPositions = reader.GetInt32(1);
                string   skills        = reader.GetString(2);
                string   domain        = reader.GetString(3);
                int      experience    = reader.GetInt32(4);
                DateTime requiredDate  = reader.GetDateTime(5);
                string   location      = reader.GetString(6);
                int      status        = reader.GetInt32(7);
                //retrieving all vacancies associated to the recruitmentrequestID given
                vacancy = VacancyFactory.CreateVacancy(vacancyID, noOfPositions, skills, domain, experience, requiredDate, location, status);
                vacancyList.Add(vacancy);
            }
            conn.Close();
            return(vacancyList);
        }
        //FUNCTION FOR DISPLAYING VACANCY
        public List <IVacancy> SelectVacancy(int employeeID)
        {
            SqlConnection conn = DBUtility.GetConnection();


            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "sp_selectVacancy_667015";
            cmd.Parameters.AddWithValue("@employeeId", employeeID);
            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                int      vacancyID     = reader.GetInt32(0);
                int      noOfPositions = reader.GetInt32(1);
                string   skills        = reader.GetString(2);
                string   domain        = reader.GetString(3);
                int      experience    = reader.GetInt32(4);
                DateTime requiredDate  = reader.GetDateTime(5);
                string   location      = reader.GetString(6);
                int      status        = reader.GetInt32(7);


                //retirving all vacancies associated to the recruitmentrequestID given
                vacancy = VacancyFactory.CreateVacancy(vacancyID, noOfPositions, skills, domain, experience, requiredDate, location, status);
                vacancyList.Add(vacancy);
            }
            conn.Close();


            return(vacancyList);
        }
 public void SetLinkValue <T>(T obj)
 {
     if (obj is IStudent)
     {
         LinkStudent = obj as IStudent;
     }
     if (obj is IVacancy)
     {
         LinkVacancy = obj as IVacancy;
     }
 }
        // Нажатие на элемент управления "Очистить". Обработка события.
        private void linkClear_Click(object sender, EventArgs e)
        {
            var link = sender as Label;

            if (link.Name == "linkStudent" || link.Name == "linkStudentClear")
            {
                LinkStudent = null;
            }
            else
            {
                LinkVacancy = null;
            }
        }
示例#5
0
        public List <IVacancy> SearchRecruitmentRequest(int recruitmentRequestID)
        {                                                                          //used for displays the vacancies wrt to given recruitmentRequest
            //ADO.NET program for searching recruitmentRequest

            //SqlConnection myConnection = DBUtility.getConnection();

            //using (myConnection)
            //{
            //    SqlCommand myCommand = new SqlCommand("sp_searchRecruitmentRequest_667961", myConnection);
            //    myCommand.CommandType = CommandType.StoredProcedure;
            //    myCommand.Parameters.AddWithValue("@RecruitmentRequestID", recruitmentRequestID);
            //    myConnection.Open();
            //    myCommand.ExecuteNonQuery();
            //    myConnection.Close();
            //}
            //ADO.NET program for searching recruitmentrequest
            SqlConnection conn = DBUtility.GetConnection();

            vacancyList.Clear();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "sp_searchRecruitmentRequest_667015";
            cmd.Parameters.AddWithValue("@recruitmentRequestID", recruitmentRequestID);

            conn.Open();
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                int      vacancyID     = reader.GetInt32(0);
                int      noOfPositions = reader.GetInt32(1);
                string   skills        = reader.GetString(2);
                string   domain        = reader.GetString(3);
                int      experience    = reader.GetInt32(4);
                DateTime requiredDate  = reader.GetDateTime(5);
                string   location      = reader.GetString(6);
                int      status        = reader.GetInt32(7);

                //retirving all vacancies associated to the recruitmentrequestID given
                vacancy = VacancyFactory.CreateVacancy(vacancyID, noOfPositions, skills, domain, experience, requiredDate, location, status);
                vacancyList.Add(vacancy);
            }
            conn.Close();
            return(vacancyList);
        }
        // To retrieve all the vacancies
        public List <IVacancy> GetVacancy()
        {
            List <IVacancy> lstVacancy = new List <IVacancy>();
            SqlCommand      objMyCommand;
            SqlConnection   objMyConnection = DBUtility.getConnection();

            try
            {
                using (objMyConnection)
                {
                    objMyCommand             = new SqlCommand("sp_getVacancy", objMyConnection);
                    objMyCommand.CommandType = CommandType.StoredProcedure;
                    objMyConnection.Open();
                    SqlDataReader objSqlDataReader = objMyCommand.ExecuteReader();
                    while (objSqlDataReader.Read())
                    {
                        int      VacancyID            = Int32.Parse(objSqlDataReader["VacancyID"].ToString());
                        int      NoOfPositions        = Int32.Parse(objSqlDataReader["NoOfPositions"].ToString());
                        String   Skills               = objSqlDataReader["Skills"].ToString();
                        int      Experience           = Int32.Parse(objSqlDataReader["Experience"].ToString());
                        String   Location             = objSqlDataReader["Location"].ToString();
                        String   BusinessDomain       = objSqlDataReader["BusinessDomain"].ToString();
                        DateTime RequiredByDate       = DateTime.Parse(objSqlDataReader["RequiredByDate"].ToString());
                        int      Status               = Int32.Parse(objSqlDataReader["Status"].ToString());
                        int      VacancyRequestID     = Int32.Parse(objSqlDataReader["VacancyRequestID"].ToString());
                        int      RecruitmentRequestID = Int32.Parse(objSqlDataReader["RecruitmentRequestID"].ToString());

                        IVacancy v = VacancyFactory.Create_Vacancy(VacancyID, NoOfPositions, Skills, Experience, Location, BusinessDomain, RequiredByDate, Status, VacancyRequestID, RecruitmentRequestID);
                        lstVacancy.Add(v);
                    }
                    objSqlDataReader.Close();
                }
                return(lstVacancy);
            }
            catch (Exception EE)
            {
                Console.WriteLine(EE);
                Console.Read();
                return(null);
            }
            finally
            {
                objMyConnection.Close();
            }
        }
        //FUNCTION FOR DISPALYING UNAPPROVED VACANCY
        public List <IVacancy> ViewUnapprovedVacancies(int employeeID)
        {
            vacancyList.Clear();
            //ADO.NET program for displaying unapproved vacancies
            SqlConnection myConnection = DBUtility.GetConnection();      //make the connection object
            SqlCommand    myCommand    = new SqlCommand();               //make sqlcommand object

            myCommand.Connection  = myConnection;                        //give connection with the command object
            myCommand.CommandType = CommandType.StoredProcedure;         //bind with CommandType
            myCommand.CommandText = "sp_viewUnapprovedVacancies_545444"; //bind with CommandText
            myCommand.Parameters.AddWithValue("@employeeId", employeeID);


            myConnection.Open();                                                  //Open the connection
            DataTable unapprovedTable = new DataTable();                          //make DataTable

            SqlDataReader unapprovedDataReader = myCommand.ExecuteReader();       //Make DataReader

            unapprovedTable.Load(unapprovedDataReader);                           //Put all values from DataReader to DataTable

            for (int index = 0; index < unapprovedTable.Rows.Count; index++)      //Use for loop to count the rows of the table
            {
                int    vacancyID     = (int)unapprovedTable.Rows[index][0];       //get the value from the 1st column of the table
                int    noOfPositions = (int)unapprovedTable.Rows[index][1];       //get the value from the 2nd column of the table
                string skills        = (string)unapprovedTable.Rows[index][2];    //get the value from the 3rd column of the table
                string domain        = (string)unapprovedTable.Rows[index][3];
                int    experience    = (int)unapprovedTable.Rows[index][4];       //get the value from the 4th column of the table

                DateTime requiredDate = (DateTime)unapprovedTable.Rows[index][5]; //get the value from the 5th column of the table
                string   location     = (string)unapprovedTable.Rows[index][6];
                int      status       = (int)unapprovedTable.Rows[index][7];      //get the value from the 6th column of the table

                vacancy = VacancyFactory.CreateVacancy(vacancyID, noOfPositions, skills, domain, experience, requiredDate, location, status);
                vacancyList.Add(vacancy);
            }


            myConnection.Close(); //Close the connection

            return(vacancyList);  //Return the Vacancy type list
        }
        private void cbUnivercityEmployment_CheckedChanged(object sender, EventArgs e)
        {
            vacancyPanel.Enabled            = cbUnivercityEmployment.Checked;
            tbCompany.Enabled               = !cbUnivercityEmployment.Checked;
            tbPost.Enabled                  = !cbUnivercityEmployment.Checked;
            tbSalary.Enabled                = !cbUnivercityEmployment.Checked;
            tbNameOfStateDepartment.Enabled = !cbUnivercityEmployment.Checked;

            if (!cbUnivercityEmployment.Checked)
            {
                LinkVacancy = null;
                tbCompany.Focus();
                errorProvider.SetError(linkVacancy, "");
            }
            else
            {
                linkVacancy.Focus();
                errorProvider.SetError(tbCompany, "");
                errorProvider.SetError(tbPost, "");
            }
        }
示例#9
0
 public VacancyForm(MainMDIForm mainForm, IVacancy entity) : base(mainForm, entity)
 {
     InitializeComponent();
 }
示例#10
0
 public VacancyForm(ActionType type, IVacancy entity, IDataListView <IVacancy> viewContext) : base(type, entity, viewContext)
 {
     InitializeComponent();
 }
示例#11
0
 public VacancyForm(ActionType type, IVacancy entity = null) : base(type, entity)
 {
     InitializeComponent();
 }
示例#12
0
 public VacancyController(IVacancy vacancyrepository)
 {
     _vacancyrepository = vacancyrepository;
 }   // GET: /<controller>/
示例#13
0
 public static IVacancy CreateVacancy(int vacancyID, int noOfPositions, string skills, string domain, int experience, DateTime requiredDate, string location, int status)
 {
     vacancy = new Vacancy(vacancyID, noOfPositions, skills, domain, experience, requiredDate, location, status);
     return(vacancy);
 }
 public static IVacancy Create_Vacancy(int VacancyID, int NoOfPositions, String Skills, int Experience, String Location, String BusinessDomain, DateTime RequiredByDate, int Status, int VacancyRequestID, int RecruitmentRequestID)
 {
     objVacancy = new Vacancy(VacancyID, NoOfPositions, Skills, Experience, Location, BusinessDomain, RequiredByDate, Status, VacancyRequestID, RecruitmentRequestID);
     return(objVacancy);
 }
 public StudentCompanyForm(IStudentCompany entity, IVacancy vacancy) : base(ActionType.Add, entity)
 {
     InitializeComponent();
     LinkVacancy         = vacancy;
     linkVacancy.Enabled = linkVacancyClear.Visible = false;
 }