Esempio n. 1
0
        public async Task <IActionResult> UpdateLoaiCongViec(int id, [FromBody] LoaiCongViecDTO loaiCongViecDTO)
        {
            var loaiCongViec = loaiCongViecDTO.ToEntity();
            await _loaiCongViecService.UpdateLoaiCongViec(loaiCongViec);

            return(Ok(loaiCongViec));
        }
Esempio n. 2
0
        public async Task <IActionResult> CreateLoaiCongViec(LoaiCongViecDTO loaiCongViecDTO)
        {
            var loaiCongViec = loaiCongViecDTO.ToEntity();
            await _loaiCongViecService.CreateLoaiCongViec(loaiCongViec);

            return(Ok(loaiCongViec));
        }
Esempio n. 3
0
        public async Task <IActionResult> GetLoaiCongViecById(int id)
        {
            var loaiCongViec = await _loaiCongViecService.GetLoaiCongViecById(id);

            var result = LoaiCongViecDTO.FromEntity(loaiCongViec);

            return(Ok(result));
        }
Esempio n. 4
0
        public int GetIDLoaiCV(LoaiCongViecDTO record)
        {
            DataTable dt = new DataTable();
            int result = 0;
            try
            {
                SqlConnection connect = new SqlConnection(SqlDataAccess.ConnectionString);
                connect.Open();
                try
                {
                    SqlCommand cmd = new SqlCommand("sp_GetIDLOAICV", connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlParameter TenLoaiCongViec_param = cmd.Parameters.Add("@TenLoaiCongViec", System.Data.SqlDbType.NVarChar);
                    SqlParameter MoTa_param = cmd.Parameters.Add("@MoTa", System.Data.SqlDbType.NVarChar);

                    TenLoaiCongViec_param.Direction = System.Data.ParameterDirection.Input;
                    MoTa_param.Direction = System.Data.ParameterDirection.Input;

                    TenLoaiCongViec_param.Value = record.TenCongViec;
                    MoTa_param.Value = record.MoTa;

                    SqlDataAdapter adapter = new SqlDataAdapter();
                    adapter.SelectCommand = cmd;
                    adapter.Fill(dt);
                }
                catch (System.Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    connect.Close();
                }

            }
            catch (Exception e)
            {
                throw e;
            }
            foreach (DataRow dr in dt.Rows)
            {
                return Int32.Parse(dr["ID"].ToString());
            }
            return result;
        }
Esempio n. 5
0
        public int Insert(LoaiCongViecDTO newrecord)
        {
            int result;
            try
            {
                SqlConnection connect = new SqlConnection(SqlDataAccess.ConnectionString);
                connect.Open();
                try
                {
                    SqlCommand cmd = new SqlCommand("sp_InsertLOAICONGVIEC", connect);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    SqlParameter TenLoaiCongViec_param = cmd.Parameters.Add("@TenLoaiCongViec", System.Data.SqlDbType.NVarChar);
                    SqlParameter mota_param = cmd.Parameters.Add("@MoTa", System.Data.SqlDbType.NVarChar);
                    SqlParameter trongso_param = cmd.Parameters.Add("@TrongSo", System.Data.SqlDbType.Int);

                    TenLoaiCongViec_param.Direction = System.Data.ParameterDirection.Input;
                    mota_param.Direction = System.Data.ParameterDirection.Input;
                    trongso_param.Direction = System.Data.ParameterDirection.Input;

                    TenLoaiCongViec_param.Value = newrecord.TenCongViec;
                    mota_param.Value = newrecord.MoTa;
                    trongso_param.Value = newrecord.TrongSo;

                    result = cmd.ExecuteNonQuery();
                }
                catch (System.Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    connect.Close();
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            return result;
        }
Esempio n. 6
0
 public int Insert(LoaiCongViecDTO newrecord)
 {
     LoaiCongViecDAO dao = new LoaiCongViecDAO();
     return dao.Insert(newrecord);
 }
Esempio n. 7
0
 public int GetIDLoaiCV(LoaiCongViecDTO record)
 {
     LoaiCongViecDAO dao = new LoaiCongViecDAO();
     return dao.GetIDLoaiCV(record);
 }
        protected void DongY_Click(object sender, EventArgs e)
        {
            MoTaCongViecDTO motacongviec = new MoTaCongViecDTO();
            motacongviec.KyNangCongViec = KyNangCongViec.Value.ToString();
            motacongviec.MoTaCongViec = MoTaCongViec.Value.ToString();
            motacongviec.ViTriTuyenDung = ViTriTuyenDung.Value.ToString();

            ThongTinViecLamDTO thongtinvieclam = new ThongTinViecLamDTO();
            thongtinvieclam.MaSoCongViec = MaSoCongViec.Value.ToString();
            thongtinvieclam.SoLuong = Int32.Parse(SoLuong.Value.ToString());
            thongtinvieclam.TuoiMin = Int32.Parse(TuoiMin.Value.ToString());
            thongtinvieclam.TuoiMax = Int32.Parse(TuoiMax.Value.ToString());
            thongtinvieclam.QuocGia = Int32.Parse(QuocGiaList.Value.ToString());
            thongtinvieclam.TinhThanh = Int32.Parse(TinhThanhList.Value.ToString());
            thongtinvieclam.MucLuong = Int32.Parse(MucLuong.Value.ToString());
            thongtinvieclam.PhuCapKhac = PhuCap.Value.ToString();
            thongtinvieclam.SoNamKinhNghiem = Int32.Parse(KinhNghiem.Value.ToString());
            //thongtinvieclam.HanNopSoSo = DateTime.Parse(HanNopHoSo.Value.ToString());
            thongtinvieclam.GioiTinh = Int32.Parse(GioiTinh.Value.ToString());

            LoaiCongViecDTO LoaiCongViec = new LoaiCongViecDTO();

            if (Checkbox1.Checked == true)
            {
                LoaiCongViec.TenCongViec = "Full-time";
            }
            if (Checkbox2.Checked == true)
            {
                LoaiCongViec.TenCongViec = "Part-time";
            }
            if (Checkbox3.Checked == true)
            {
                LoaiCongViec.MoTa = "Nhân viên chính thức";
            }
            if (Checkbox4.Checked == true)
            {
                LoaiCongViec.MoTa = "Thời vụ";
            }
            if (Checkbox5.Checked == true)
            {
                LoaiCongViec.MoTa = "Tự do";
            }
            LoaiCongViec.TrongSo = 1;
            LoaiCongViecBUS busLoaiCV = new LoaiCongViecBUS();

            thongtinvieclam.LoaiCongViec = busLoaiCV.GetIDLoaiCV(LoaiCongViec);

            ThongTinViecLamBUS busThongTin = new ThongTinViecLamBUS();
            busThongTin.Insert(thongtinvieclam);

            LoaiUngVienDTO LoaiUngVien = new LoaiUngVienDTO();
            LoaiUngVien.NganhNghe = NganhNghe.Value.ToString();
            LoaiUngVien.CapBac = CapBac.Value.ToString();
            LoaiUngVien.BangCap = BangCap.Value.ToString();

            LoaiUngVienBUS busLoaiUV = new LoaiUngVienBUS();
            busLoaiUV.insert(LoaiUngVien);

            NhaTuyenDungBUS busNhaTD = new NhaTuyenDungBUS();
            TinTuyenDungDTO TinTuyenDung = new TinTuyenDungDTO();
            String strEmail = Email.Value.ToString();
            TinTuyenDung.NhanTuyenDung = busNhaTD.GetIDNhaTuyenDung(strEmail);
            TinTuyenDung.LoaiUngVien = busLoaiUV.GetIDLoaiUV(LoaiUngVien);
            TinTuyenDung.MaSoCongViec = thongtinvieclam.MaSoCongViec;
            TinTuyenDung.ViTriTuyenDung = motacongviec.ViTriTuyenDung;
            TinTuyenDung.MoTaCongViec = motacongviec.MoTaCongViec;
            TinTuyenDung.KyNangCongViec = motacongviec.KyNangCongViec;

            TinTuyenDungBUS BusTTT = new TinTuyenDungBUS();
            BusTTT.Insert(TinTuyenDung);
        }