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

            if (rowsCount > 0)
            {
                MobileSoft.Model.SQMSys.Tb_Sys_PowerNode model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model              = new MobileSoft.Model.SQMSys.Tb_Sys_PowerNode();
                    model.PNodeCode    = dt.Rows[n]["PNodeCode"].ToString();
                    model.PNodeName    = dt.Rows[n]["PNodeName"].ToString();
                    model.URLPage      = dt.Rows[n]["URLPage"].ToString();
                    model.URLTarget    = dt.Rows[n]["URLTarget"].ToString();
                    model.BackTitleImg = dt.Rows[n]["BackTitleImg"].ToString();
                    model.Narrate      = dt.Rows[n]["Narrate"].ToString();
                    if (dt.Rows[n]["InPopedom"].ToString() != "")
                    {
                        model.InPopedom = int.Parse(dt.Rows[n]["InPopedom"].ToString());
                    }
                    model.Functions = dt.Rows[n]["Functions"].ToString();
                    if (dt.Rows[n]["NodeType"].ToString() != "")
                    {
                        model.NodeType = int.Parse(dt.Rows[n]["NodeType"].ToString());
                    }
                    if (dt.Rows[n]["PNodeSort"].ToString() != "")
                    {
                        model.PNodeSort = int.Parse(dt.Rows[n]["PNodeSort"].ToString());
                    }
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.SQMSys.Tb_Sys_PowerNode model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.SQMSys.Tb_Sys_PowerNode model)
 {
     dal.Add(model);
 }