示例#1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(zlzw.Model.JobKindListModel model)
 {
     return(dal.Add(model));
 }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(zlzw.Model.JobKindListModel model)
 {
     return(dal.Update(model));
 }
示例#3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <zlzw.Model.JobKindListModel> DataTableToList(DataTable dt)
        {
            List <zlzw.Model.JobKindListModel> modelList = new List <zlzw.Model.JobKindListModel>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                zlzw.Model.JobKindListModel model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new zlzw.Model.JobKindListModel();
                    if (dt.Rows[n]["JobKindID"] != null && dt.Rows[n]["JobKindID"].ToString() != "")
                    {
                        model.JobKindID = int.Parse(dt.Rows[n]["JobKindID"].ToString());
                    }
                    if (dt.Rows[n]["JobCategoryGUID"] != null && dt.Rows[n]["JobCategoryGUID"].ToString() != "")
                    {
                        model.JobCategoryGUID = new Guid(dt.Rows[n]["JobCategoryGUID"].ToString());
                    }
                    if (dt.Rows[n]["JobKindGUID"] != null && dt.Rows[n]["JobKindGUID"].ToString() != "")
                    {
                        model.JobKindGUID = new Guid(dt.Rows[n]["JobKindGUID"].ToString());
                    }
                    if (dt.Rows[n]["JobKindName"] != null && dt.Rows[n]["JobKindName"].ToString() != "")
                    {
                        model.JobKindName = dt.Rows[n]["JobKindName"].ToString();
                    }
                    if (dt.Rows[n]["JobCount"] != null && dt.Rows[n]["JobCount"].ToString() != "")
                    {
                        model.JobCount = int.Parse(dt.Rows[n]["JobCount"].ToString());
                    }
                    if (dt.Rows[n]["IsHot"] != null && dt.Rows[n]["IsHot"].ToString() != "")
                    {
                        model.IsHot = int.Parse(dt.Rows[n]["IsHot"].ToString());
                    }
                    if (dt.Rows[n]["IsEnable"] != null && dt.Rows[n]["IsEnable"].ToString() != "")
                    {
                        model.IsEnable = int.Parse(dt.Rows[n]["IsEnable"].ToString());
                    }
                    if (dt.Rows[n]["IsShowDefaultPage"] != null && dt.Rows[n]["IsShowDefaultPage"].ToString() != "")
                    {
                        model.IsShowDefaultPage = int.Parse(dt.Rows[n]["IsShowDefaultPage"].ToString());
                    }
                    if (dt.Rows[n]["PublishDate"] != null && dt.Rows[n]["PublishDate"].ToString() != "")
                    {
                        model.PublishDate = DateTime.Parse(dt.Rows[n]["PublishDate"].ToString());
                    }
                    if (dt.Rows[n]["Other01"] != null && dt.Rows[n]["Other01"].ToString() != "")
                    {
                        model.Other01 = dt.Rows[n]["Other01"].ToString();
                    }
                    if (dt.Rows[n]["Other02"] != null && dt.Rows[n]["Other02"].ToString() != "")
                    {
                        model.Other02 = dt.Rows[n]["Other02"].ToString();
                    }
                    if (dt.Rows[n]["Other03"] != null && dt.Rows[n]["Other03"].ToString() != "")
                    {
                        model.Other03 = int.Parse(dt.Rows[n]["Other03"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }