Example #1
0
    public void btnSave_Click(object sender, EventArgs e)
    {
        int    ID     = int.Parse(this.lblID.Text);
        int    NewJob = int.Parse(this.ddlNewJob.SelectedValue);
        int    OldJob = int.Parse(this.ddlOldJob.SelectedValue);
        string Remark = this.txtRemark.Text;


        JobMoveInfosInfo model = new JobMoveInfosInfo();

        model.ID     = ID;
        model.NewJob = NewJob;
        model.OldJob = OldJob;
        model.Remark = Remark;
        if (rbNo.Checked == true)
        {
            model.Allow = 2;
        }
        if (rbYes.Checked == true)
        {
            //通过审核 将被审核人的职位改为申请职位
            UserInfosInfo info = new UserInfosInfo();
            info.ID  = int.Parse(HiddenField1.Value);
            info.Job = NewJob;

            UpdateUserInfo(info);

            model.Allow = 1;
        }
        Update(model);
    }
    private void ShowInfo(int ID)
    {
        UserInfosInfo model = GetModel(ID);

        this.lblID.Text                   = model.ID.ToString();
        this.txtUserName.Text             = model.UserName;
        this.txtPwd.Text                  = model.Pwd;
        this.ddlGender.SelectedValue      = model.Gender;
        this.txtMail.Text                 = model.Mail;
        this.txtBirthday.Text             = model.Birthday.ToString();
        this.DropDownList1.SelectedValue  = model.Marriage;
        this.ddlPolitical.SelectedValue   = model.Political;
        this.txtNation.Text               = model.Nation;
        this.txtProvince.Text             = model.Province;
        this.txtHomeAddress.Text          = model.HomeAddress;
        this.txtIDNumber.Text             = model.IDNumber;
        this.txtTel.Text                  = model.Tel;
        this.txtCollege.Text              = model.College;
        this.txtSpeciality.Text           = model.Speciality;
        this.txtSalary.Text               = model.Salary.ToString();
        this.ddlDepartment.SelectedValue  = model.Department.ToString();
        this.ddlJob.SelectedValue         = model.Job.ToString();
        this.ddlEducational.SelectedValue = model.Educational;
        this.txtEntryTime.Text            = model.EntryTime.ToString();
    }
Example #3
0
    private void ShowInfo(int ID)
    {
        UserInfosInfo model = GetModel(ID);

        this.lblID.Text          = model.ID.ToString();
        this.lblUserName.Text    = model.UserName;
        this.lblPwd.Text         = model.Pwd;
        this.lblGender.Text      = model.Gender;
        this.lblMail.Text        = model.Mail;
        this.lblBirthday.Text    = model.Birthday.ToString();
        this.lblMarriage.Text    = model.Marriage;
        this.lblPolitical.Text   = model.Political;
        this.lblNation.Text      = model.Nation;
        this.lblProvince.Text    = model.Province;
        this.lblHomeAddress.Text = model.HomeAddress;
        this.lblIDNumber.Text    = model.IDNumber;
        this.lblTel.Text         = model.Tel;
        this.lblCollege.Text     = model.College;
        this.lblSpeciality.Text  = model.Speciality;
        this.lblKultuLevel.Text  = model.KultuLevel;
        this.lblSalary.Text      = model.Salary.ToString();
        this.lblDepartment.Text  = model.DepartmentName.ToString();
        this.lblJob.Text         = model.JobName.ToString();
        this.lblEducational.Text = model.Educational;
        this.lblEntryTime.Text   = model.EntryTime.ToString();
        this.lblFileName.Text    = model.FileName;
        //this.lblFilePath.Text = model.FilePath;
        this.lblSubTime.Text = model.SubTime.ToString();
    }
Example #4
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");
    }
    public UserInfosInfo DataRowToModel(DataRow row)
    {
        UserInfosInfo model = new UserInfosInfo();

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

            if (row["ID"] != null && row["ID"].ToString() != "")
            {
                model.ID = int.Parse(row["ID"].ToString());
            }
            if (row["UserName"] != null)
            {
                model.UserName = row["UserName"].ToString();
            }
            if (row["Salary"] != null && row["Salary"].ToString() != "")
            {
                model.Salary = int.Parse(row["Salary"].ToString());
            }
        }
        return(model);
    }
Example #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int           UserId = int.Parse(Session["userid"].ToString());
        int           TypeId = int.Parse(ddlTylpe.SelectedValue);
        int           Money  = 0;
        DateTime      sTime  = Convert.ToDateTime(txtSTime.Text);
        DateTime      eTime  = Convert.ToDateTime(txtETime.Text);
        UserInfosInfo info   = GetModel(UserId);

        TimeSpan span = eTime - sTime;


        if (TypeId == 1) //事假 100
        {
            Money = -Convert.ToInt32(info.Salary) / 30 * span.Days;
        }
        else if (TypeId == 0)//病假 50
        {
            Money = -Convert.ToInt32(info.Salary) / 60 * span.Days;
        }

        string   Remark  = this.txtRemark.Text;
        DateTime SubTime = DateTime.Now;

        VacateInfosInfo model = new VacateInfosInfo();

        model.UserId    = UserId;
        model.TypeId    = TypeId;
        model.Money     = Money;
        model.Remark    = Remark;
        model.SubTime   = SubTime;
        model.StartTime = sTime;
        model.EndTime   = eTime;
        Add(model);
    }
Example #7
0
    public void UpdateUserInfo(UserInfosInfo model)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("update UserInfos set ");
        strSql.Append("Job='" + model.Job + "'");
        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();
    }
    public void Update(UserInfosInfo model)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append("update UserInfos set ");
        strSql.Append("UserName='******',");
        strSql.Append("Pwd='" + model.Pwd + "',");
        strSql.Append("Gender='" + model.Gender + "',");
        strSql.Append("Mail='" + model.Mail + "',");
        strSql.Append("Birthday='" + model.Birthday + "',");
        strSql.Append("Marriage='" + model.Marriage + "',");
        strSql.Append("Political='" + model.Political + "',");
        strSql.Append("Nation='" + model.Nation + "',");
        strSql.Append("Province='" + model.Province + "',");
        strSql.Append("HomeAddress='" + model.HomeAddress + "',");
        strSql.Append("IDNumber='" + model.IDNumber + "',");
        strSql.Append("Tel='" + model.Tel + "',");
        strSql.Append("College='" + model.College + "',");
        strSql.Append("Speciality='" + model.Speciality + "',");
        strSql.Append("KultuLevel='" + model.KultuLevel + "',");
        strSql.Append("Salary='" + model.Salary + "',");
        strSql.Append("Department='" + model.Department + "',");
        strSql.Append("Job='" + model.Job + "',");
        strSql.Append("Educational='" + model.Educational + "',");
        strSql.Append("EntryTime='" + model.EntryTime + "'");
        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");
    }
    /// <summary>
    /// 得到一个对象实体
    /// </summary>
    public UserInfosInfo DataRowToModel(DataRow row)
    {
        UserInfosInfo model = new UserInfosInfo();

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

            if (row["ID"] != null && row["ID"].ToString() != "")
            {
                model.ID = int.Parse(row["ID"].ToString());
            }
            if (row["UserName"] != null)
            {
                model.UserName = row["UserName"].ToString();
            }
            if (row["Pwd"] != null)
            {
                model.Pwd = row["Pwd"].ToString();
            }
            if (row["Gender"] != null)
            {
                model.Gender = row["Gender"].ToString();
            }
            if (row["Mail"] != null)
            {
                model.Mail = row["Mail"].ToString();
            }
            if (row["Birthday"] != null && row["Birthday"].ToString() != "")
            {
                model.Birthday = DateTime.Parse(row["Birthday"].ToString());
            }
            if (row["Marriage"] != null)
            {
                model.Marriage = row["Marriage"].ToString();
            }
            if (row["Political"] != null)
            {
                model.Political = row["Political"].ToString();
            }
            if (row["Nation"] != null)
            {
                model.Nation = row["Nation"].ToString();
            }
            if (row["Province"] != null)
            {
                model.Province = row["Province"].ToString();
            }
            if (row["HomeAddress"] != null)
            {
                model.HomeAddress = row["HomeAddress"].ToString();
            }
            if (row["IDNumber"] != null)
            {
                model.IDNumber = row["IDNumber"].ToString();
            }
            if (row["Tel"] != null)
            {
                model.Tel = row["Tel"].ToString();
            }
            if (row["College"] != null)
            {
                model.College = row["College"].ToString();
            }
            if (row["Speciality"] != null)
            {
                model.Speciality = row["Speciality"].ToString();
            }
            if (row["KultuLevel"] != null)
            {
                model.KultuLevel = row["KultuLevel"].ToString();
            }
            if (row["Salary"] != null && row["Salary"].ToString() != "")
            {
                model.Salary = int.Parse(row["Salary"].ToString());
            }
            if (row["Department"] != null && row["Department"].ToString() != "")
            {
                model.Department = int.Parse(row["Department"].ToString());
            }
            if (row["Job"] != null && row["Job"].ToString() != "")
            {
                model.Job = int.Parse(row["Job"].ToString());
            }
            if (row["Educational"] != null)
            {
                model.Educational = row["Educational"].ToString();
            }
            if (row["EntryTime"] != null && row["EntryTime"].ToString() != "")
            {
                model.EntryTime = DateTime.Parse(row["EntryTime"].ToString());
            }
            if (row["FileName"] != null)
            {
                model.FileName = row["FileName"].ToString();
            }
            if (row["FilePath"] != null)
            {
                model.FilePath = row["FilePath"].ToString();
            }
            if (row["SubTime"] != null && row["SubTime"].ToString() != "")
            {
                model.SubTime = DateTime.Parse(row["SubTime"].ToString());
            }
        }
        return(model);
    }
Example #10
0
    public void btnSave_Click(object sender, EventArgs e)
    {
        string strErr = "";

        if (this.txtUserName.Text.Trim().Length == 0)
        {
            strErr += "姓名不能为空\\n";
        }
        if (txtSalary.Text.Trim().Length == 0)
        {
            strErr += "请输入正确的基本工资\\n";
        }
        if (txtEntryTime.Text.Trim().Length == 0)
        {
            strErr += "请输入入职时间\\n";
        }
        if (strErr != "")
        {
            Response.Write("<script language='javascript'>alert('" + strErr + "');</script>");
        }
        else
        {
            int      ID          = int.Parse(this.lblID.Text);
            string   UserName    = this.txtUserName.Text;
            string   Pwd         = this.txtPwd.Text;
            string   Gender      = this.ddlGender.SelectedValue;
            string   Mail        = this.txtMail.Text;
            DateTime?Birthday    = txtBirthday.Text == "" ? (DateTime?)null : DateTime.Parse(this.txtBirthday.Text);
            string   Marriage    = this.DropDownList1.SelectedValue;
            string   Political   = this.ddlPolitical.SelectedValue;
            string   Nation      = this.txtNation.Text;
            string   Province    = this.txtProvince.Text;
            string   HomeAddress = this.txtHomeAddress.Text;
            string   IDNumber    = this.txtIDNumber.Text;
            string   Tel         = this.txtTel.Text;
            string   College     = this.txtCollege.Text;
            string   Speciality  = this.txtSpeciality.Text;
            int      Salary      = int.Parse(this.txtSalary.Text);
            int      Department  = int.Parse(this.ddlDepartment.SelectedValue);
            int      Job         = int.Parse(this.ddlJob.SelectedValue);
            string   Educational = this.ddlEducational.SelectedValue;
            DateTime EntryTime   = DateTime.Parse(this.txtEntryTime.Text);


            UserInfosInfo model = new UserInfosInfo();
            model.ID          = ID;
            model.UserName    = UserName;
            model.Pwd         = Pwd;
            model.Gender      = Gender;
            model.Mail        = Mail;
            model.Birthday    = Birthday;
            model.Marriage    = Marriage;
            model.Political   = Political;
            model.Nation      = Nation;
            model.Province    = Province;
            model.HomeAddress = HomeAddress;
            model.IDNumber    = IDNumber;
            model.Tel         = Tel;
            model.College     = College;
            model.Speciality  = Speciality;
            model.KultuLevel  = "";
            model.Salary      = Salary;
            model.Department  = Department;
            model.Job         = Job;
            model.Educational = Educational;
            model.EntryTime   = EntryTime;

            //Maticsoft.BLL.UserInfosBll bll = new Maticsoft.BLL.UserInfosBll();
            Update(model);
            //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
    }
Example #11
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strErr = "";

        if (this.txtUserName.Text.Trim().Length == 0)
        {
            strErr += "姓名不能为空\\n";
        }
        if (txtSalary.Text.Trim().Length == 0)
        {
            strErr += "请输入正确的基本工资\\n";
        }
        if (txtEntryTime.Text.Trim().Length == 0)
        {
            strErr += "请输入入职时间\\n";
        }
        if (strErr != "")
        {
            Response.Write("<script language='javascript'>alert('" + strErr + "');</script>");
        }
        else
        {
            string UserName = this.txtUserName.Text;
            string Pwd      = "123456";
            string Gender   = ddlGender.SelectedValue;
            string Mail     = this.txtMail.Text;

            DateTime?Birthday    = txtBirthday.Text == "" ? (DateTime?)null : DateTime.Parse(this.txtBirthday.Text);
            string   Marriage    = this.ddlMarriage.SelectedValue;
            string   Political   = this.ddlPolitical.SelectedValue;
            string   Nation      = this.txtNation.Text;
            string   Province    = this.txtProvince.Text;
            string   HomeAddress = this.txtHomeAddress.Text;
            string   IDNumber    = this.txtIDNumber.Text;
            string   Tel         = this.txtTel.Text;
            string   College     = this.txtCollege.Text;
            string   Speciality  = this.txtSpeciality.Text;
            int      Salary      = int.Parse(this.txtSalary.Text);
            int      Department  = int.Parse(ddlDepartment.SelectedValue);
            int      Job         = int.Parse(ddlJob.SelectedValue);
            string   Educational = this.ddlEducational.SelectedValue;
            DateTime EntryTime   = DateTime.Parse(this.txtEntryTime.Text);

            UserInfosInfo model = new UserInfosInfo();
            model.UserName    = UserName;
            model.Pwd         = Pwd;
            model.Gender      = Gender;
            model.Mail        = Mail;
            model.Birthday    = Birthday;
            model.Marriage    = Marriage;
            model.Political   = Political;
            model.Nation      = Nation;
            model.Province    = Province;
            model.HomeAddress = HomeAddress;
            model.IDNumber    = IDNumber;
            model.Tel         = Tel;
            model.College     = College;
            model.Speciality  = Speciality;
            model.Salary      = Salary;
            model.Department  = Department;
            model.Job         = Job;
            model.Educational = Educational;
            model.EntryTime   = EntryTime;
            model.SubTime     = DateTime.Now;
            model.KultuLevel  = "";
            model.FileName    = "";
            model.FilePath    = "";
            Add(model);
        }
    }