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

            if (rowsCount > 0)
            {
                Eastcom.Model.v_Sys_Power_Role model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Eastcom.Model.v_Sys_Power_Role();
                    if (dt.Rows[n]["RoleID"] != null && dt.Rows[n]["RoleID"].ToString() != "")
                    {
                        model.RoleID = int.Parse(dt.Rows[n]["RoleID"].ToString());
                    }
                    if (dt.Rows[n]["RoleName"] != null && dt.Rows[n]["RoleName"].ToString() != "")
                    {
                        model.RoleName = dt.Rows[n]["RoleName"].ToString();
                    }
                    if (dt.Rows[n]["RoleWeight"] != null && dt.Rows[n]["RoleWeight"].ToString() != "")
                    {
                        model.RoleWeight = int.Parse(dt.Rows[n]["RoleWeight"].ToString());
                    }
                    if (dt.Rows[n]["Remark"] != null && dt.Rows[n]["Remark"].ToString() != "")
                    {
                        model.Remark = dt.Rows[n]["Remark"].ToString();
                    }
                    if (dt.Rows[n]["FK_EditID"] != null && dt.Rows[n]["FK_EditID"].ToString() != "")
                    {
                        model.FK_EditID = int.Parse(dt.Rows[n]["FK_EditID"].ToString());
                    }
                    if (dt.Rows[n]["EditTime"] != null && dt.Rows[n]["EditTime"].ToString() != "")
                    {
                        model.EditTime = DateTime.Parse(dt.Rows[n]["EditTime"].ToString());
                    }
                    if (dt.Rows[n]["FK_CreateID"] != null && dt.Rows[n]["FK_CreateID"].ToString() != "")
                    {
                        model.FK_CreateID = int.Parse(dt.Rows[n]["FK_CreateID"].ToString());
                    }
                    if (dt.Rows[n]["CreateTime"] != null && dt.Rows[n]["CreateTime"].ToString() != "")
                    {
                        model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
                    }
                    if (dt.Rows[n]["Sort"] != null && dt.Rows[n]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(dt.Rows[n]["Sort"].ToString());
                    }
                    if (dt.Rows[n]["创建者名"] != null && dt.Rows[n]["创建者名"].ToString() != "")
                    {
                        model.创建者名 = dt.Rows[n]["创建者名"].ToString();
                    }
                    if (dt.Rows[n]["修改者名"] != null && dt.Rows[n]["修改者名"].ToString() != "")
                    {
                        model.修改者名 = dt.Rows[n]["修改者名"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Eastcom.Model.v_Sys_Power_Role model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Eastcom.Model.v_Sys_Power_Role model)
 {
     return(dal.Add(model));
 }