Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LYSC.CompanyWeb.Model.HKSJ_Services> DataTableToList(DataTable dt)
        {
            List <LYSC.CompanyWeb.Model.HKSJ_Services> modelList = new List <LYSC.CompanyWeb.Model.HKSJ_Services>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LYSC.CompanyWeb.Model.HKSJ_Services model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LYSC.CompanyWeb.Model.HKSJ_Services();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["Name"] != null && dt.Rows[n]["Name"].ToString() != "")
                    {
                        model.Name = dt.Rows[n]["Name"].ToString();
                    }
                    if (dt.Rows[n]["Context"] != null && dt.Rows[n]["Context"].ToString() != "")
                    {
                        model.Context = dt.Rows[n]["Context"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LYSC.CompanyWeb.Model.HKSJ_Services model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LYSC.CompanyWeb.Model.HKSJ_Services model)
 {
     return(dal.Add(model));
 }