protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ACCOUNT"] == null)
        {
            Response.Redirect("../Login.aspx");
        }
        //  Session["TITLE"] = "THÔNG TIN TUYỂN DỤNG";
        try
        {
            this.itemId = int.Parse(Request["did"].ToString());
        }
        catch
        {
            this.itemId = 0;
        }
        try
        {
            this.IdDonVi = int.Parse(Request.QueryString["did"].ToString());
        }
        catch
        {
            this.IdDonVi = 0;
        }
        try
        {
            this.tenDonVi = Request.QueryString["n"].ToString();
        }
        catch
        {
            this.tenDonVi = "";
        }

        if (!Page.IsPostBack)
        {
            DoanhNghiep objDoanhNghiep = new DoanhNghiep();

            DataTable objdata = objDoanhNghiep.getDataById(this.IdDonVi);
            if (objdata.Rows.Count > 0)
            {
                this.txtTenDonVi.Text = objdata.Rows[0]["TenDonVi"].ToString();
                nganhnghebuf          = objdata.Rows[0]["IDNganhNghe"].ToString();
            }
        }

        if (!Page.IsPostBack)
        {
            if (Session["TuyenDungMessage"] != null)
            {
                Session["TuyenDungMessage"] = null;
            }

            this.ddlNhomNganh.DataSource     = this.objNhomNganh.getDataCategoryToCombobox();
            this.ddlNhomNganh.DataTextField  = "NameNhomNganh";
            this.ddlNhomNganh.DataValueField = "IdNhomNganh";
            this.ddlNhomNganh.DataBind();
            this.ddlNhomNganh.SelectedValue = "0";

            ViTri objViTri = new ViTri();
            this.ddlIdVitri.DataSource     = objViTri.getDataCategoryToCombobox();
            this.ddlIdVitri.DataTextField  = "NameViTri";
            this.ddlIdVitri.DataValueField = "ID";
            this.ddlIdVitri.DataBind();
            this.ddlIdVitri.SelectedValue = "0";

            this.ddlIDChucVu.DataSource     = this.objChucVu.getDataCategoryToCombobox();
            this.ddlIDChucVu.DataTextField  = "NameChucVu";
            this.ddlIDChucVu.DataValueField = "IDChucVu";
            this.ddlIDChucVu.DataBind();
            this.ddlIDChucVu.SelectedValue = "0";

            this.ddlIDNganhNghe.DataSource     = this.objBusiness.getDataCategoryToCombobox();
            this.ddlIDNganhNghe.DataTextField  = "Name";
            this.ddlIDNganhNghe.DataValueField = "Id";
            this.ddlIDNganhNghe.DataBind();
            this.ddlIDNganhNghe.SelectedValue = nganhnghebuf;

            this.ddlIDDoTuoi.DataSource     = this.objDoTuoi.getDataCategoryToCombobox();
            this.ddlIDDoTuoi.DataTextField  = "NameDoTuoi";
            this.ddlIDDoTuoi.DataValueField = "IDDoTuoi";
            this.ddlIDDoTuoi.DataBind();
            this.ddlIDDoTuoi.SelectedValue = "0";

            this.ddlIDGioiTinh.DataSource     = this.objGioiTinh.getDataCategoryToCombobox("Nam/nữ");
            this.ddlIDGioiTinh.DataTextField  = "NameGioiTinh";
            this.ddlIDGioiTinh.DataValueField = "IDGioiTinh";
            this.ddlIDGioiTinh.DataBind();
            this.ddlIDGioiTinh.SelectedValue = "0";

            this.ddlIDTrinhDoChuyenMon.DataSource     = this.objTrinhDoChuyenMon.getDataCategoryToCombobox();
            this.ddlIDTrinhDoChuyenMon.DataTextField  = "NameTrinhDoChuyenMon";
            this.ddlIDTrinhDoChuyenMon.DataValueField = "IDTrinhDoChuyenMon";
            this.ddlIDTrinhDoChuyenMon.DataBind();
            this.ddlIDTrinhDoChuyenMon.SelectedValue = "0";

            this.ddlIDMucLuong.DataSource     = this.objMucluong.getDataCategoryToCombobox();
            this.ddlIDMucLuong.DataTextField  = "NameMucLuong";
            this.ddlIDMucLuong.DataValueField = "IDMucLuong";
            this.ddlIDMucLuong.DataBind();
            this.ddlIDMucLuong.SelectedValue = "0";

            NgoaiNgu objNgoaiNgu = new NgoaiNgu();
            this.ddlyeuCauNgoaiNgu.DataSource     = objNgoaiNgu.getDataCategoryToCombobox();
            this.ddlyeuCauNgoaiNgu.DataTextField  = "NameNgoaiNgu";
            this.ddlyeuCauNgoaiNgu.DataValueField = "IDNgoaiNgu";
            this.ddlyeuCauNgoaiNgu.DataBind();
            this.ddlyeuCauNgoaiNgu.SelectedValue = "0";

            TinHoc objTinHoc = new TinHoc();
            this.ddlyeuCauTinHoc.DataSource     = objTinHoc.getDataCategoryToCombobox();
            this.ddlyeuCauTinHoc.DataTextField  = "NameTinHoc";
            this.ddlyeuCauTinHoc.DataValueField = "IDTinHoc";
            this.ddlyeuCauTinHoc.DataBind();
            this.ddlyeuCauTinHoc.SelectedValue = "0";
        }
        if (!Page.IsPostBack)
        {
            getData();          /*------------------------------------*/
            this.objTable = this.objTuyenDung.getDataById(this.itemId);
            if (this.objTable.Rows.Count > 0)
            {
                this.txtTenDonVi.Text           = this.objTable.Rows[0]["TenDonVi"].ToString().ToUpper();
                this.ddlNhomNganh.SelectedValue = this.objTable.Rows[0]["IDNhomNghanh"].ToString();

                this.ddlIDChucVu.SelectedValue = this.objTable.Rows[0]["IDChucVu"].ToString();

                this.ddlIdVitri.SelectedValue = this.objTable.Rows[0]["IdViTri"].ToString();

                this.ddlIDNganhNghe.SelectedValue = this.objTable.Rows[0]["IDNganhNghe"].ToString();
                this.lblIDNganhNghe.Text          = this.ddlIDNganhNghe.SelectedItem.Text;

                this.ddlIDDoTuoi.SelectedValue   = this.objTable.Rows[0]["IDDoTuoi"].ToString();
                this.ddlIDGioiTinh.SelectedValue = this.objTable.Rows[0]["IDGioiTinh"].ToString();

                this.ddlIDTrinhDoChuyenMon.SelectedValue = this.objTable.Rows[0]["IDTrinhDoChuyenMon"].ToString();

                this.ddlIDMucLuong.SelectedValue = this.objTable.Rows[0]["IDMucLuong"].ToString();
                this.lblIDMucLuong.Text          = this.ddlIDMucLuong.SelectedItem.Text;

                this.txtQuyenLoi.Text = this.objTable.Rows[0]["QuyenLoi"].ToString();

                this.ddlyeuCauNgoaiNgu.SelectedValue = this.objTable.Rows[0]["YCNgoaiNgu"].ToString();
                this.ddlyeuCauTinHoc.SelectedValue   = this.objTable.Rows[0]["YCTinHoc"].ToString();
                this.txtDiaDiem.Text = this.objTable.Rows[0]["DiaDiem"].ToString();
                this.ddlThoiGianLamViec.SelectedValue = this.objTable.Rows[0]["ThoiGianLamViec"].ToString();
            }
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ACCOUNT"] == null)
        {
            Response.Redirect("../Login.aspx");
        }

        Session["TITLE"] = "THÔNG TIN TUYỂN DỤNG";
        try
        {
            this.itemId = int.Parse(Request["id"].ToString());
        }
        catch
        {
            this.itemId = 0;
        }
        try
        {
            this.IdDonVi = int.Parse(Request.QueryString["did"].ToString());
        }
        catch
        {
            this.IdDonVi = 0;
        }
        try
        {
            this.tenDonVi = Request.QueryString["n"].ToString();
        }
        catch
        {
            this.tenDonVi = "";
        }

        if (!Page.IsPostBack)
        {
            DoanhNghiep objDoanhNghiep = new DoanhNghiep();

            DataTable objdata = objDoanhNghiep.getDataById(this.IdDonVi);
            if (objdata.Rows.Count > 0)
            {
                this.txtIDDonVi.Value = objdata.Rows[0]["IDDonVi"].ToString();
                this.txtTenDonVi.Text = objdata.Rows[0]["TenDonVi"].ToString();
                nganhnghebuf          = objdata.Rows[0]["IDNganhNghe"].ToString();
            }
        }
        this.txtIDTuyenDung.Value = this.itemId.ToString();

        if (!Page.IsPostBack)
        {
            if (Session["TuyenDungMessage"] != null)
            {
                this.lblMsg.Text            = Session["TuyenDungMessage"].ToString();
                Session["TuyenDungMessage"] = null;
            }

            this.ddlNhomNganh.DataSource     = this.objNhomNganh.getDataCategoryToCombobox();
            this.ddlNhomNganh.DataTextField  = "NameNhomNganh";
            this.ddlNhomNganh.DataValueField = "IdNhomNganh";
            this.ddlNhomNganh.DataBind();
            this.ddlNhomNganh.SelectedValue = "0";

            this.ddlIDTinh.DataSource     = this.objProvincer.getDataCategoryToCombobox();
            this.ddlIDTinh.DataTextField  = "Name";
            this.ddlIDTinh.DataValueField = "Id";
            this.ddlIDTinh.DataBind();
            this.ddlIDTinh.SelectedValue = "0";

            ViTri objViTri = new ViTri();
            this.ddlIdVitri.DataSource     = objViTri.getDataCategoryToCombobox();
            this.ddlIdVitri.DataTextField  = "NameViTri";
            this.ddlIdVitri.DataValueField = "ID";
            this.ddlIdVitri.DataBind();
            this.ddlIdVitri.SelectedValue = "0";

            this.ddlIDChucVu.DataSource     = this.objChucVu.getDataCategoryToCombobox();
            this.ddlIDChucVu.DataTextField  = "NameChucVu";
            this.ddlIDChucVu.DataValueField = "IDChucVu";
            this.ddlIDChucVu.DataBind();
            this.ddlIDChucVu.SelectedValue = "0";

            TrinhDoTinHoc objTrinhDoTinHoc = new TrinhDoTinHoc();
            this.ddlTinHoc.DataSource     = objTrinhDoTinHoc.getDataCategoryToCombobox();
            this.ddlTinHoc.DataTextField  = "NameTrinhDo";
            this.ddlTinHoc.DataValueField = "ID";
            this.ddlTinHoc.DataBind();
            this.ddlTinHoc.SelectedValue = "0";

            TrinhDoNgoaiNgu objTrinhDoNgoaiNgu = new TrinhDoNgoaiNgu();
            this.ddlTrinhDoNgoaiNgu.DataSource     = objTrinhDoNgoaiNgu.getDataCategoryToCombobox();
            this.ddlTrinhDoNgoaiNgu.DataTextField  = "NameTrinhDo";
            this.ddlTrinhDoNgoaiNgu.DataValueField = "ID";
            this.ddlTrinhDoNgoaiNgu.DataBind();
            this.ddlTrinhDoNgoaiNgu.SelectedValue = "0";

            this.ddlIDDoTuoi.DataSource     = this.objDoTuoi.getDataCategoryToCombobox();
            this.ddlIDDoTuoi.DataTextField  = "NameDoTuoi";
            this.ddlIDDoTuoi.DataValueField = "IDDoTuoi";
            this.ddlIDDoTuoi.DataBind();
            this.ddlIDDoTuoi.SelectedValue = "0";

            this.ddlIDGioiTinh.DataSource     = this.objGioiTinh.getDataCategoryToCombobox("Nam/nữ");
            this.ddlIDGioiTinh.DataTextField  = "NameGioiTinh";
            this.ddlIDGioiTinh.DataValueField = "IDGioiTinh";
            this.ddlIDGioiTinh.DataBind();
            this.ddlIDGioiTinh.SelectedValue = "0";

            this.ddlIDTrinhDoChuyenMon.DataSource     = this.objTrinhDoChuyenMon.getDataCategoryToCombobox();
            this.ddlIDTrinhDoChuyenMon.DataTextField  = "NameTrinhDoChuyenMon";
            this.ddlIDTrinhDoChuyenMon.DataValueField = "IDTrinhDoChuyenMon";
            this.ddlIDTrinhDoChuyenMon.DataBind();
            this.ddlIDTrinhDoChuyenMon.SelectedValue = "0";

            this.ddlIDMucLuong.DataSource     = this.objMucluong.getDataCategoryToCombobox();
            this.ddlIDMucLuong.DataTextField  = "NameMucLuong";
            this.ddlIDMucLuong.DataValueField = "IDMucLuong";
            this.ddlIDMucLuong.DataBind();
            this.ddlIDMucLuong.SelectedValue = "0";

            NgoaiNgu objNgoaiNgu = new NgoaiNgu();
            this.ddlyeuCauNgoaiNgu.DataSource     = objNgoaiNgu.getDataCategoryToCombobox();
            this.ddlyeuCauNgoaiNgu.DataTextField  = "NameNgoaiNgu";
            this.ddlyeuCauNgoaiNgu.DataValueField = "IDNgoaiNgu";
            this.ddlyeuCauNgoaiNgu.DataBind();
            this.ddlyeuCauNgoaiNgu.SelectedValue = "0";

            TinHoc objTinHoc = new TinHoc();
            this.ddlyeuCauTinHoc.DataSource     = objTinHoc.getDataCategoryToCombobox();
            this.ddlyeuCauTinHoc.DataTextField  = "NameTinHoc";
            this.ddlyeuCauTinHoc.DataValueField = "IDTinHoc";
            this.ddlyeuCauTinHoc.DataBind();
            this.ddlyeuCauTinHoc.SelectedValue = "0";
        }
        if (!Page.IsPostBack && this.itemId > 0)
        {
            this.objTable = this.objTuyenDung.getDataById(this.itemId);
            if (this.objTable.Rows.Count > 0)
            {
                this.txtMaTuyenDung.Text        = this.objTable.Rows[0]["MaTuyenDung"].ToString();
                this.txtIDDonVi.Value           = this.objTable.Rows[0]["IDDonVi"].ToString();
                this.txtTenDonVi.Text           = this.objTable.Rows[0]["TenDonVi"].ToString();
                this.ddlNhomNganh.SelectedValue = this.objTable.Rows[0]["IDNhomNghanh"].ToString();

                this.ddlNganhNghe.DataSource     = this.objNganhNghe.getDataCategoryToCombobox(this.ddlNhomNganh.SelectedValue.ToString());
                this.ddlNganhNghe.DataTextField  = "NameDTNganhNghe";
                this.ddlNganhNghe.DataValueField = "IDDTNganhNghe";
                this.ddlNganhNghe.DataBind();

                this.ddlNganhNghe.SelectedValue = this.objTable.Rows[0]["IDNganhNghe"].ToString();

                this.ddlIDChucVu.SelectedValue        = this.objTable.Rows[0]["IDChucVu"].ToString();
                this.ddlTrinhDoNgoaiNgu.SelectedValue = this.objTable.Rows[0]["IdTrinhDoNgoaiNgu"].ToString();
                this.ddlTinHoc.SelectedValue          = this.objTable.Rows[0]["IdTrinhDoTinHoc"].ToString();
                this.ddlIdVitri.SelectedValue         = this.objTable.Rows[0]["IdViTri"].ToString();

                this.txtSoLuongTuyenDung.Text    = this.objTable.Rows[0]["SoLuongTuyenDung"].ToString();
                this.ddlIDDoTuoi.SelectedValue   = this.objTable.Rows[0]["IDDoTuoi"].ToString();
                this.ddlIDGioiTinh.SelectedValue = this.objTable.Rows[0]["IDGioiTinh"].ToString();
                this.txtUuTien.Text = this.objTable.Rows[0]["UuTien"].ToString();

                this.ddlIDTrinhDoChuyenMon.SelectedValue = this.objTable.Rows[0]["IDTrinhDoChuyenMon"].ToString();
                this.txtNoiDungKhac.Text         = this.objTable.Rows[0]["NoiDungKhac"].ToString();
                this.txtMoTa.Text                = this.objTable.Rows[0]["MoTa"].ToString();
                this.txtDiaDiem.Text             = this.objTable.Rows[0]["DiaDiem"].ToString();
                this.ddlIDMucLuong.SelectedValue = this.objTable.Rows[0]["IDMucLuong"].ToString();

                this.ckbNuocNgoai.Checked = bool.Parse(this.objTable.Rows[0]["NuocNgoai"].ToString());
                this.txtQuyenLoi.Text     = this.objTable.Rows[0]["QuyenLoi"].ToString();
                this.txtNgayBatDau.Value  = DateTime.Parse(this.objTable.Rows[0]["NgayBatDau"].ToString()).ToString("dd/MM/yyyy");
                this.txtNgayKetThuc.Value = DateTime.Parse(this.objTable.Rows[0]["NgayKetThuc"].ToString()).ToString("dd/MM/yyyy");
                this.ckbState.Checked     = bool.Parse(this.objTable.Rows[0]["State"].ToString());

                this.ddlyeuCauNgoaiNgu.SelectedValue  = this.objTable.Rows[0]["YCNgoaiNgu"].ToString();
                this.ddlyeuCauTinHoc.SelectedValue    = this.objTable.Rows[0]["YCTinHoc"].ToString();
                this.txtNamKinhNghiem.Text            = this.objTable.Rows[0]["NamKinhNghiem"].ToString();
                this.ddlThoiGianLamViec.SelectedValue = this.objTable.Rows[0]["ThoiGianLamViec"].ToString();

                this.txtIdQuocGia.Value   = this.objTable.Rows[0]["IdQuocGia"].ToString();
                this.txtNameQuocGia.Value = this.objTable.Rows[0]["NameQuocGia"].ToString();
            }
        }

        this.txtMaTuyenDung.Focus();
    }