protected void btnUV_Luu_Click(object sender, EventArgs e)
 {
     try
     {
         CurrentID = (int)Session["IDUngVien"];
         CV_UngVienDTO cv = new CV_UngVienDTO();
         cv.TieuDe        = txtUV_TieuDe.Text;
         cv.ID_NganhNghe  = Convert.ToInt32(ddlUV_NganhNghe.SelectedValue.ToString());
         cv.KyNang        = txtUV_KyNang.Text;
         cv.ID_ViTri      = Convert.ToInt32(ddlUV_ViTri.SelectedValue.ToString());
         cv.ID_TrinhDo    = Convert.ToInt32(ddlUV_TrinhDo.SelectedValue.ToString());
         cv.ID_KinhNghiem = Convert.ToInt32(ddlUV_KinhNghiem.SelectedValue.ToString());
         cv.NgoaiNgu      = txtUV_NgoaiNgu.Text;
         cv.MucLuong      = ddlUV_MucLuong.SelectedItem.ToString();
         cv.BangCap       = txtUV_BangCap.Text;
         cv.TrangThai     = 0;
         cvungvienbll.LuuCVUngVien(cv, CurrentID);
         //cv.LuuCVUngVien(CurrentID, txtUV_TieuDe.Text, Convert.ToInt32(ddlUV_NganhNghe.SelectedValue.ToString()), txtUV_KyNang.Text, Convert.ToInt32(ddlUV_ViTri.SelectedValue.ToString()),
         //                Convert.ToInt32(ddlUV_TrinhDo.SelectedValue.ToString()), Convert.ToInt32(ddlUV_KinhNghiem.SelectedValue.ToString()), txtUV_NgoaiNgu.Text,
         //                ddlUV_MucLuong.SelectedItem.ToString(), txtUV_BangCap.Text, false);
         Response.Write("<script> alert('Lưu thành công.')</script>");
         ClearTextBox();
     }
     catch (Exception)
     {
         Response.Write("<script> alert('Lưu không công.')</script>");
     }
 }
示例#2
0
    public CV_UngVienDTO Get_CVUngVien(int id_UngVien)
    {
        CV_UngVienDTO cv = new CV_UngVienDTO();

        try
        {
            string    kq      = "Select * From CV_UngVien Where ID_UngVien = '" + id_UngVien + "' ";
            DataTable mytable = new DataTable();
            //UngVienDTO uv = new UngVienDTO();
            cv.ID_CV         = Convert.ToInt32(data.GetTable(kq).Rows[0][0]);
            cv.TieuDe        = data.GetTable(kq).Rows[0][2].ToString();
            cv.ID_NganhNghe  = Convert.ToInt32(data.GetTable(kq).Rows[0][3]);
            cv.KyNang        = data.GetTable(kq).Rows[0][4].ToString();
            cv.ID_ViTri      = Convert.ToInt32(data.GetTable(kq).Rows[0][5]);
            cv.ID_TrinhDo    = Convert.ToInt32(data.GetTable(kq).Rows[0][6]);
            cv.ID_KinhNghiem = Convert.ToInt32(data.GetTable(kq).Rows[0][7]);
            cv.NgoaiNgu      = data.GetTable(kq).Rows[0][8].ToString();
            cv.MucLuong      = data.GetTable(kq).Rows[0][9].ToString();
            cv.BangCap       = data.GetTable(kq).Rows[0][10].ToString();
            cv.TrangThai     = Convert.ToInt32(data.GetTable(kq).Rows[0][11]);

            return(cv);
        }
        catch
        {
            return(cv);
        }
    }
示例#3
0
    public void LuuCVUngVien(CV_UngVienDTO cv, int id_ungvien)
    {
        string sql = "INSERT INTO CV_UngVien (ID_UngVien, TieuDe, ID_NganhNghe, KyNang, ID_ViTri, ID_TrinhDo, ID_Kinhnghiem, NgoaiNgu, MucLuong, BangCap, TrangThai) "
                     + "VALUES ('" + id_ungvien + "', '" + cv.TieuDe + "', N'" + cv.ID_NganhNghe + "', '" + cv.KyNang + "', N'" + cv.ID_ViTri + "', '" + cv.ID_TrinhDo + "', '" + cv.ID_KinhNghiem + "', '" + cv.NgoaiNgu + "', '" + cv.MucLuong + "', '" + cv.BangCap + "', '" + cv.TrangThai + "')";

        data.NowR(sql);
    }
 protected void btnUV_XemCV_Click(object sender, EventArgs e)
 {
     UV_HoSoUngVien.Visible = true;
     try
     {
         CurrentID = (int)Session["IDUngVien"];
         CV_UngVienDTO cv = new CV_UngVienDTO();
         cv = cvungvienbll.Get_CVUngVien(CurrentID);
         if (cv != null)
         {
             if (cv.TrangThai == 1)
             {
                 lblThongBao.Text               = "Đã kích hoạt";
                 lblID_CVUngVien.Text           = cv.ID_CV.ToString();
                 txtUV_TieuDe.Text              = cv.TieuDe;
                 ddlUV_NganhNghe.SelectedValue  = cv.ID_NganhNghe.ToString();
                 ddlUV_ViTri.SelectedValue      = cv.ID_ViTri.ToString();
                 ddlUV_TrinhDo.SelectedValue    = cv.ID_TrinhDo.ToString();
                 ddlUV_KinhNghiem.SelectedValue = cv.ID_KinhNghiem.ToString();
                 txtUV_KyNang.Text              = cv.KyNang;
                 txtUV_NgoaiNgu.Text            = cv.NgoaiNgu;
                 ddlUV_MucLuong.SelectedValue   = cv.MucLuong;
                 txtUV_BangCap.Text             = cv.BangCap;
                 btnUV_Luu.Visible              = false;
             }
             else
             {
                 lblThongBao.Text  = "Chưa kích hoạt";
                 btnUV_Luu.Visible = true;
             }
         }
         else
         {
             ClearTextBox();
             btnUV_Luu.Visible = true;
         }
     }
     catch
     {
         Response.Redirect("~/TrangChu.aspx");
         Response.Write("<script> alert('Bạn chưa đăng nhập')</script>");
     }
 }