Ejemplo n.º 1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<WebProject.Model.BaseData.ZT_COM_ZhaoPin> DataTableToList(DataTable dt)
 {
     List<WebProject.Model.BaseData.ZT_COM_ZhaoPin> modelList = new List<WebProject.Model.BaseData.ZT_COM_ZhaoPin>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         WebProject.Model.BaseData.ZT_COM_ZhaoPin model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new WebProject.Model.BaseData.ZT_COM_ZhaoPin();
             if(dt.Rows[n]["ZhaoPinID"].ToString()!="")
             {
                 model.ZhaoPinID=int.Parse(dt.Rows[n]["ZhaoPinID"].ToString());
             }
             model.Position=dt.Rows[n]["Position"].ToString();
             if(dt.Rows[n]["ZhaoPinOrder"].ToString()!="")
             {
                 model.ZhaoPinOrder=int.Parse(dt.Rows[n]["ZhaoPinOrder"].ToString());
             }
             model.Address=dt.Rows[n]["Address"].ToString();
             if(dt.Rows[n]["Number"].ToString()!="")
             {
                 model.Number=int.Parse(dt.Rows[n]["Number"].ToString());
             }
             model.Salary=dt.Rows[n]["Salary"].ToString();
             if(dt.Rows[n]["StartDate"].ToString()!="")
             {
                 model.StartDate=DateTime.Parse(dt.Rows[n]["StartDate"].ToString());
             }
             if(dt.Rows[n]["EndDate"].ToString()!="")
             {
                 model.EndDate=DateTime.Parse(dt.Rows[n]["EndDate"].ToString());
             }
             model.Body=dt.Rows[n]["Body"].ToString();
             if(dt.Rows[n]["YingPin"].ToString()!="")
             {
                 model.YingPin=int.Parse(dt.Rows[n]["YingPin"].ToString());
             }
             model.CreateBy=dt.Rows[n]["CreateBy"].ToString();
             if(dt.Rows[n]["CreateDate"].ToString()!="")
             {
                 model.CreateDate=DateTime.Parse(dt.Rows[n]["CreateDate"].ToString());
             }
             model.LastUpdateBy=dt.Rows[n]["LastUpdateBy"].ToString();
             if(dt.Rows[n]["LastUpdateDate"].ToString()!="")
             {
                 model.LastUpdateDate=DateTime.Parse(dt.Rows[n]["LastUpdateDate"].ToString());
             }
             model.Remark=dt.Rows[n]["Remark"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Ejemplo n.º 2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Session["ZT_ADMIN"] == null)
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         if (this.txtAddress.Text == "")
         {
             MessageBox.Show(this, "请输入工作地址!");
             return;
         }
         if (this.txtBody.Text == "")
         {
             MessageBox.Show(this, "请输入招聘内容!");
             return;
         }
         if (this.txtEndDate.Text == "")
         {
             MessageBox.Show(this, "请输入截止日期!");
             return;
         }
         if (this.txtNumber.Text == "")
         {
             MessageBox.Show(this, "请输入招聘人数!");
             return;
         }
         if (this.txtPosition.Text == "")
         {
             MessageBox.Show(this, "请输入招聘职位!");
             return;
         }
         if (this.txtSalary.Text == "")
         {
             MessageBox.Show(this, "请输入工资待遇!");
             return;
         }
         if (this.txtZhaoPinOrder.Text == "")
         {
             MessageBox.Show(this, "请输入招聘排序!");
             return;
         }
         try
         {
             WebProject.Model.BaseData.ZT_COM_ZhaoPin model_ZhaoPin = new WebProject.Model.BaseData.ZT_COM_ZhaoPin();
             model_ZhaoPin.Address = this.txtAddress.Text.Trim();
             model_ZhaoPin.Body = this.txtBody.Text.Trim();
             model_ZhaoPin.CreateBy = SessionUtil.GetAdminSession().AdminNo;
             model_ZhaoPin.CreateDate = DateTime.Now;
             model_ZhaoPin.EndDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
             model_ZhaoPin.Number = Convert.ToInt32(this.txtNumber.Text.Trim());
             model_ZhaoPin.Position = this.txtPosition.Text.Trim();
             model_ZhaoPin.Salary = this.txtSalary.Text.Trim();
             model_ZhaoPin.YingPin = 0;
             model_ZhaoPin.ZhaoPinOrder = Convert.ToInt32(this.txtZhaoPinOrder.Text.Trim());
             WebProject.BLL.BaseData.ZT_COM_ZhaoPin bll_ZhaoPin = new WebProject.BLL.BaseData.ZT_COM_ZhaoPin();
             bll_ZhaoPin.Add(model_ZhaoPin);
             LogManage.WriteLog(Request.UserHostAddress, "招聘管理", "添加招聘信息", "成功", "招聘职位:" + model_ZhaoPin.Position.ToString() + ", 创建人:" + SessionUtil.GetAdminSession().AdminNo);
             MessageBox.ShowAndRedirect(this, "添加招聘信息成功!", "ZhaoPinList.aspx");
         }
         catch
         {
             Response.Redirect("RightsWarn.aspx");
         }
     }
 }