Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindDDL1();
            BindDDL2();
            BindDDL3();
            BindDDL4();
            txtEntryTime.Text = DateTime.Now.Date.ToString("yyyy-MM-dd");

            //判断是否是招聘申请入职人员 如果是 更新招聘表 绑定被招聘人员
            if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
            {
                int id = (Convert.ToInt32(Request.Params["id"]));

                //根据招聘编号查询部门与职位

                RecruitInfosInfo model = GetModel(id);

                if (model != null)
                {
                    ddlDepartment.SelectedValue = model.DepartId.ToString();
                    ddlJob.SelectedValue        = model.JobId.ToString();
                    ddlDepartment.Enabled       = false;
                    ddlJob.Enabled = false;
                }
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 增加一条数据
    /// </summary>
    public void Add(UserInfosInfo model)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("insert into UserInfos(");
        strSql.Append("UserName,Pwd,Gender,Mail,Birthday,Marriage,Political,Nation,Province,HomeAddress,IDNumber,Tel,College,Speciality,KultuLevel,Salary,Department,Job,Educational,EntryTime,FileName,FilePath,SubTime)");
        strSql.Append(" values (");
        strSql.Append("'" + model.UserName + "','" + model.Pwd + "','" + model.Gender + "','" + model.Mail + "','" + model.Birthday + "','" + model.Marriage + "','" + model.Political + "','" + model.Nation + "','" + model.Province + "','" + model.HomeAddress + "','" + model.IDNumber + "','" + model.Tel + "','" + model.College + "','" + model.Speciality + "','" + model.KultuLevel + "','" + model.Salary + "','" + model.Department + "','" + model.Job + "','" + model.Educational + "','" + model.EntryTime + "','" + model.FileName + "','" + model.FilePath + "','" + model.SubTime + "')");
        strSql.Append(";select @@IDENTITY");
        SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

        scon.Open();
        SqlCommand scmd   = new SqlCommand(strSql.ToString(), scon);
        int        userId = Convert.ToInt32(scmd.ExecuteScalar());

        scmd.Dispose();
        scon.Close();

        //判断是否是招聘申请入职人员 如果是 更新招聘表 绑定被招聘人员
        if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
        {
            int id = (Convert.ToInt32(Request.Params["id"]));
            RecruitInfosInfo info = new RecruitInfosInfo();
            info.ID     = id;
            info.IsHave = userId;
            info.Allow  = 3;
            Update(info);
        }

        Response.Write("<script language='javascript'>alert('添加成功!');</script>");
        Server.Transfer("list.aspx");
    }
Esempio n. 3
0
    public void btnSave_Click(object sender, EventArgs e)
    {
        int    ID       = int.Parse(this.lblID.Text);
        int    DepartId = int.Parse(ddlDepartment.SelectedValue);
        int    JobId    = int.Parse(ddlJob.SelectedValue);
        string Remark   = this.txtRemark.Text;


        RecruitInfosInfo model = new RecruitInfosInfo();

        model.ID       = ID;
        model.DepartId = DepartId;
        model.JobId    = JobId;
        model.Remark   = Remark;

        if (rbNo.Checked == true)
        {
            model.Allow = 2;
        }
        if (rbYes.Checked == true)
        {
            //通过审核 将被审核人的职位改为申请职位
            model.Allow = 1;
        }

        Update(model);
    }
Esempio n. 4
0
    public RecruitInfosInfo DataRowToModel(DataRow row)
    {
        RecruitInfosInfo model = new RecruitInfosInfo();

        if (row != null)
        {
            if (row["ShenQingRen"] != null)
            {
                model.ShenQingRen = row["ShenQingRen"].ToString();
            }
            if (row["UserName"] != null)
            {
                model.UserName = row["UserName"].ToString();
            }
            if (row["JobName"] != null)
            {
                model.JobName = row["JobName"].ToString();
            }
            if (row["DepName"] != null)
            {
                model.DepName = row["DepName"].ToString();
            }

            if (row["ID"] != null && row["ID"].ToString() != "")
            {
                model.ID = int.Parse(row["ID"].ToString());
            }
            if (row["DepartId"] != null && row["DepartId"].ToString() != "")
            {
                model.DepartId = int.Parse(row["DepartId"].ToString());
            }
            if (row["JobId"] != null && row["JobId"].ToString() != "")
            {
                model.JobId = int.Parse(row["JobId"].ToString());
            }
            if (row["UserId"] != null && row["UserId"].ToString() != "")
            {
                model.UserId = int.Parse(row["UserId"].ToString());
            }
            if (row["Allow"] != null && row["Allow"].ToString() != "")
            {
                model.Allow = int.Parse(row["Allow"].ToString());
            }
            if (row["IsHave"] != null && row["IsHave"].ToString() != "")
            {
                model.IsHave = int.Parse(row["IsHave"].ToString());
            }
            if (row["Remark"] != null)
            {
                model.Remark = row["Remark"].ToString();
            }
            if (row["SubTime"] != null && row["SubTime"].ToString() != "")
            {
                model.SubTime = DateTime.Parse(row["SubTime"].ToString());
            }
        }
        return(model);
    }
Esempio n. 5
0
    private void ShowInfo(int ID)
    {
        RecruitInfosInfo model = GetModel(ID);

        this.lblID.Text             = model.ID.ToString();
        ddlDepartment.SelectedValue = model.DepartId.ToString();
        ddlJob.SelectedValue        = model.JobId.ToString();
        this.txtRemark.Text         = model.Remark;
    }
Esempio n. 6
0
    public void btnSave_Click(object sender, EventArgs e)
    {
        int    ID       = int.Parse(this.lblID.Text);
        int    DepartId = int.Parse(ddlDepartment.SelectedValue);
        int    JobId    = int.Parse(ddlJob.SelectedValue);
        string Remark   = this.txtRemark.Text;


        RecruitInfosInfo model = new RecruitInfosInfo();

        model.ID       = ID;
        model.DepartId = DepartId;
        model.JobId    = JobId;
        model.Remark   = Remark;

        Update(model);
    }
Esempio n. 7
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int      DepartId = int.Parse(this.ddlDepartment.SelectedValue);
        int      JobId    = int.Parse(this.ddlJob.SelectedValue);
        string   Remark   = this.txtRemark.Text;
        DateTime SubTime  = DateTime.Now;

        RecruitInfosInfo model = new RecruitInfosInfo();

        model.DepartId = DepartId;
        model.JobId    = JobId;
        model.UserId   = Convert.ToInt32(Session["userid"]);
        model.Remark   = Remark;
        model.SubTime  = SubTime;

        Add(model);
    }
Esempio n. 8
0
    public void Update(RecruitInfosInfo model)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("update RecruitInfos set ");
        strSql.Append("IsHave='" + model.IsHave + "',");
        strSql.Append("Allow='" + model.Allow + "'");
        strSql.Append(" where ID='" + model.ID + "'");

        SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

        scon.Open();
        SqlCommand scmd = new SqlCommand(strSql.ToString(), scon);

        scmd.ExecuteNonQuery();
        scmd.Dispose();
        scon.Close();
    }
Esempio n. 9
0
    public void Update(RecruitInfosInfo model)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("update RecruitInfos set ");
        strSql.Append("DepartId='" + model.DepartId + "',");
        strSql.Append("JobId='" + model.JobId + "',");
        strSql.Append("Remark='" + model.Remark + "'");
        strSql.Append(" where ID='" + model.ID + "'");

        SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

        scon.Open();
        SqlCommand scmd = new SqlCommand(strSql.ToString(), scon);

        scmd.ExecuteNonQuery();
        scmd.Dispose();
        scon.Close();
        Response.Write("<script language='javascript'>alert('更新成功!');</script>");
        Server.Transfer("list.aspx");
    }
Esempio n. 10
0
    public void Add(RecruitInfosInfo model)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("insert into RecruitInfos(");
        strSql.Append("DepartId,JobId,UserId,Remark,SubTime)");
        strSql.Append(" values (");
        strSql.Append("'" + model.DepartId + "','" + model.JobId + "','" + model.UserId + "','" + model.Remark + "','" + model.SubTime + "')");
        strSql.Append(";select @@IDENTITY");

        SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

        scon.Open();
        SqlCommand scmd = new SqlCommand(strSql.ToString(), scon);

        scmd.ExecuteNonQuery();
        scmd.Dispose();
        scon.Close();
        Response.Write("<script language='javascript'>alert('添加成功!');</script>");
        Server.Transfer("list.aspx");
    }