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

            if (rowsCount > 0)
            {
                LPWeb.Model.Template_Reports model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Template_Reports();
                    if (dt.Rows[n]["TemplReportId"].ToString() != "")
                    {
                        model.TemplReportId = int.Parse(dt.Rows[n]["TemplReportId"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();
                    if (dt.Rows[n]["Standard"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Standard"].ToString() == "1") || (dt.Rows[n]["Standard"].ToString().ToLower() == "true"))
                        {
                            model.Standard = true;
                        }
                        else
                        {
                            model.Standard = false;
                        }
                    }
                    model.HtmlTemplContent = dt.Rows[n]["HtmlTemplContent"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.Template_Reports model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.Template_Reports model)
 {
     return(dal.Add(model));
 }