Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.JobInfo> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.JobInfo> modelList = new List <Maticsoft.Model.JobInfo>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.JobInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.JobInfo();
                    if (dt.Rows[n]["JobID"].ToString() != "")
                    {
                        model.JobID = int.Parse(dt.Rows[n]["JobID"].ToString());
                    }
                    model.JobTitle = dt.Rows[n]["JobTitle"].ToString();
                    model.Address  = dt.Rows[n]["Address"].ToString();
                    model.Nunber   = dt.Rows[n]["Nunber"].ToString();
                    if (dt.Rows[n]["Starttime"].ToString() != "")
                    {
                        model.Starttime = DateTime.Parse(dt.Rows[n]["Starttime"].ToString());
                    }
                    model.Duxiang = dt.Rows[n]["Duxiang"].ToString();
                    model.Age     = dt.Rows[n]["Age"].ToString();
                    model.Xueli   = dt.Rows[n]["Xueli"].ToString();
                    model.Monery  = dt.Rows[n]["Monery"].ToString();
                    model.Zhuanye = dt.Rows[n]["Zhuanye"].ToString();
                    if (dt.Rows[n]["Endtime"].ToString() != "")
                    {
                        model.Endtime = DateTime.Parse(dt.Rows[n]["Endtime"].ToString());
                    }
                    model.Miaoshu = dt.Rows[n]["Miaoshu"].ToString();
                    model.Lianxi  = dt.Rows[n]["Lianxi"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.JobInfo model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.JobInfo model)
 {
     return(dal.Add(model));
 }