Example #1
0
 public int Insert(CV_QuaTrinhHocVanDTO record)
 {
     SqlConnection connect = new SqlConnection(SqlDataAccess.ConnectionString);
     connect.Open();
     try
     {
         string strcmd = "insert into CV_QUA_TRINH_HOC_VAN(TenTruong,ChuyenNganh,BangCap,NamTotNghiep) values(@TenTruong,@ChuyenNganh,@BangCap,@NamTotNghiep) SET @IDR = SCOPE_IDENTITY()";
         SqlCommand cmd = new SqlCommand(strcmd, connect);
         SqlParameter truongParam = new SqlParameter("@TenTruong", SqlDbType.NVarChar, 50);
         truongParam.Value = record.TenTruong;
         SqlParameter chuyennganhParam = new SqlParameter("@ChuyenNganh", SqlDbType.NVarChar, 50);
         chuyennganhParam.Value = record.ChuyenNganh;
         SqlParameter bangcapParam = new SqlParameter("@BangCap", SqlDbType.NVarChar,50);
         bangcapParam.Value = record.BangCap;
         SqlParameter namtotnghiepParam = new SqlParameter("@NamTotNghiep", SqlDbType.Int);
         namtotnghiepParam.Value = record.NamTotNghiep;
         SqlParameter IDParam = new SqlParameter("@IDR", SqlDbType.Int);
         IDParam.Direction = ParameterDirection.Output;
         //MoTaParam.Value = record.MoTa;
         cmd.Parameters.Add(truongParam);
         cmd.Parameters.Add(chuyennganhParam);
         cmd.Parameters.Add(bangcapParam);
         cmd.Parameters.Add(namtotnghiepParam);
         cmd.Parameters.Add(IDParam);
         cmd.ExecuteNonQuery();
         int id = (int)IDParam.Value;
         return id;
     }
     catch (System.Exception ex)
     {
         return -1;
         throw ex;
     }
     finally
     {
         connect.Close();
     }
 }
Example #2
0
        protected void butCV_Click(object sender, EventArgs e)
        {
            CV_KinhNghiemLamViecBUS busKNLV = new CV_KinhNghiemLamViecBUS();
            CV_NewBUS busCV = new CV_NewBUS();
            CV_QuaTrinhHocVanBUS busQTHV = new CV_QuaTrinhHocVanBUS();
            CV_ThongTinBoSungBUS busTTBS = new CV_ThongTinBoSungBUS();
            CV_ThongTinUngDungBUS busTTUD = new CV_ThongTinUngDungBUS();
            CV_ViecLamMongMuonBUS busVLMM = new CV_ViecLamMongMuonBUS();

            int idNTV = CurrentUser.ID;

            CV_ThongTinUngDungDTO dtoTTUD = new CV_ThongTinUngDungDTO();
            dtoTTUD.KinhNghiem = cbxTTUngDung_KinhNghiem.Value;
            dtoTTUD.BangCap = cbxTTUngDung_BangCap.Value;
            dtoTTUD.CapBac = cbxTTUngDung_CapBac.Value;
            dtoTTUD.NgoaiNgu = cbxTTUngDung_LoaiNgoaiNgu.Value;
            if (rbTTUngDung_ChuyenCho_Option.Checked)
            {
                dtoTTUD.ChuyenChoO = "Tùy trường hợp";
            }
            else if (rbTTUngDung_ChuyenCho_Yes.Checked)
            {
                dtoTTUD.ChuyenChoO = "Có";
            }
            else if (rdTTUngDung_ChuyenCho_No.Checked)
            {
                dtoTTUD.ChuyenChoO = "Không";
            }

            if (rdTTUngDung_CongTac_No.Checked)
            {
                dtoTTUD.DiCongtac = "Không";
            }
            else if (rdTTUngDung_CongTac_Yes.Checked)
            {
                dtoTTUD.DiCongtac = "Có";
            }
            else if (rdTTUngDung_CongTac_Option.Checked)
            {
                dtoTTUD.DiCongtac = "Tùy trường hợp";
            }

            if (rdTTUngDung_LamNgoaiGio_No.Checked)
            {
                dtoTTUD.LamNgoaiGio = "Không";
            }
            else if (rdTTUngDung_LamNgoaigio_Yes.Checked)
            {
                dtoTTUD.LamNgoaiGio = "Có";
            }
            else if (rdTTUngDung_LamNgoaiGio_Option.Checked)
            {
                dtoTTUD.LamNgoaiGio = "Tùy trường hợp";
            }
            int idTTUD = busTTUD.Insert(dtoTTUD);

            CV_ViecLamMongMuonDTO dtoVLMM = new CV_ViecLamMongMuonDTO();
            dtoVLMM.MucLuong = cbxVLMongMuon_MucLuongDeNghi.Value;
            dtoVLMM.NoiLamViec = cbxVLMongMuon_NoiLamViec.Value;
            dtoVLMM.NganhNgheMongMuon = cbxVLMongMuon_NganhNghe.Value;
            dtoVLMM.ViTriMongMuon = tbxVLMongMuon_ViTri.Value;
            if (cbVLMongMuon_HinhThucCongViec_ChinhThuc.Checked)
            {
                dtoVLMM.HinhThucLamViec = "Nhân viên chính thức";
            }
            else if (cbVLMongMuon_HinhThucCongViec_TuDo.Checked)
            {
                dtoVLMM.HinhThucLamViec = "Tự do";
            }
            else if (cbVLMongMuon_HinhThucCongViec_ThoiVu.Checked)
            {
                dtoVLMM.HinhThucLamViec = "Nhân viên thời vụ";
            }

            if (cbVLMongMuon_LaiCongViec_Parttime.Checked)
            {
                dtoVLMM.LoaiHinhCongViec = "Part-time";
            }
            else if (cbVLMongMuon_LoaiCongViec_Fulltime.Checked)
            {
                dtoVLMM.LoaiHinhCongViec = "Full-time";
            }
            int idVLMM = busVLMM.Insert(dtoVLMM);

            CV_QuaTrinhHocVanDTO dtoQTHV = new CV_QuaTrinhHocVanDTO();
            dtoQTHV.TenTruong = tbxQuaTrinhHocTap_TenTruong.Value;
            dtoQTHV.ChuyenNganh = tbxQuaTrinhHocTap_ChuyenNganh.Value;
            dtoQTHV.BangCap = cbxQuaTrinhHocTap_BangCap.Value;
            dtoQTHV.NamTotNghiep = DateTime.Parse(tbxNgayTotNghiep.Text).Year;
            int idQTHV = busQTHV.Insert(dtoQTHV);

            CV_KinhNghiemLamViecDTO dtoKNLV = new CV_KinhNghiemLamViecDTO();
            dtoKNLV.MoTa = tbxKNLV_MoTa.Value;
            dtoKNLV.TenCongTy = tbxKNLV_TenCongTy.Value;
            dtoKNLV.TinhTP = cbxKNLV_TinhTP.Value;
            dtoKNLV.ViTri = tbxKNLV_ViTriCongViec.Value;
            dtoKNLV.ThoiGianBatDau = new DateTime(int.Parse(cbxKNLV_Begin_Year.Value), int.Parse(cbxKNLV_Begin_Month.Value), 1);
            dtoKNLV.ThoiGianKetThuc = new DateTime(int.Parse(cbxKNLV_End_Year.Value), int.Parse(cbxKNLV_End_Month.Value), 1);
            int idKNLV = busKNLV.Insert(dtoKNLV);

            CV_ThongTinBoSungDTO dtoTTBS = new CV_ThongTinBoSungDTO();
            dtoTTBS.KyNang = tbxKynang.Value;
            dtoTTBS.MucTieuNgheNghiep = tbxMucTieu.Value;
            dtoTTBS.NangKhieuSoThich = tbxNangKhieuSoThich.Value;
            dtoTTBS.UuDiemKhuyetDiem = tbxUuDiemNhuocDiem.Value;
            int idTTBS = busTTBS.Insert(dtoTTBS);

            CV_NewDTO newCV = new CV_NewDTO();
            newCV.IDKinhNghiem = idKNLV;
            newCV.IDNguoiTimViec = CurrentUser.ID;
            newCV.IDQuaTrinhHocTap = idQTHV;
            newCV.IDThongTinBoSung = idTTBS;
            newCV.IDThongTinUngDung = idTTUD;
            newCV.IDViecLamMongMuon = idVLMM;
            int kq = busCV.Insert(newCV);
        }
Example #3
0
 public int Insert(CV_QuaTrinhHocVanDTO record)
 {
     CV_QuaTrinhHocVanDAO dao = new CV_QuaTrinhHocVanDAO();
     return dao.Insert(record);
 }