Exemplo n.º 1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(DigiPower.Onlinecol.Standard.Model.T_Module_MDL model)
 {
     dal.Update(model);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DigiPower.Onlinecol.Standard.Model.T_Module_MDL> DataTableToList(DataTable dt)
        {
            List <DigiPower.Onlinecol.Standard.Model.T_Module_MDL> modelList = new List <DigiPower.Onlinecol.Standard.Model.T_Module_MDL>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DigiPower.Onlinecol.Standard.Model.T_Module_MDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DigiPower.Onlinecol.Standard.Model.T_Module_MDL();
                    if (dt.Rows[n]["ModuleID"].ToString() != "")
                    {
                        model.ModuleID = int.Parse(dt.Rows[n]["ModuleID"].ToString());
                    }
                    if (dt.Rows[n]["ParentID"].ToString() != "")
                    {
                        model.ParentID = int.Parse(dt.Rows[n]["ParentID"].ToString());
                    }
                    model.BH         = dt.Rows[n]["BH"].ToString();
                    model.ModuleName = dt.Rows[n]["ModuleName"].ToString();
                    if (dt.Rows[n]["PictureIndex"].ToString() != "")
                    {
                        model.PictureIndex = int.Parse(dt.Rows[n]["PictureIndex"].ToString());
                    }
                    if (dt.Rows[n]["SelectedIndex"].ToString() != "")
                    {
                        model.SelectedIndex = int.Parse(dt.Rows[n]["SelectedIndex"].ToString());
                    }
                    model.FileName = dt.Rows[n]["FileName"].ToString();
                    if (dt.Rows[n]["IfVisible"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IfVisible"].ToString() == "1") || (dt.Rows[n]["IfVisible"].ToString().ToLower() == "true"))
                        {
                            model.IfVisible = true;
                        }
                        else
                        {
                            model.IfVisible = false;
                        }
                    }
                    if (dt.Rows[n]["OrderIndex"].ToString() != "")
                    {
                        model.OrderIndex = int.Parse(dt.Rows[n]["OrderIndex"].ToString());
                    }
                    model.Description = dt.Rows[n]["Description"].ToString();
                    if (dt.Rows[n]["Del"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Del"].ToString() == "1") || (dt.Rows[n]["Del"].ToString().ToLower() == "true"))
                        {
                            model.Del = true;
                        }
                        else
                        {
                            model.Del = false;
                        }
                    }
                    model.RightListID = dt.Rows[n]["RightListID"].ToString();
                    if (dt.Rows[n]["IfInsidePage"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IfInsidePage"].ToString() == "1") || (dt.Rows[n]["IfInsidePage"].ToString().ToLower() == "true"))
                        {
                            model.IfInsidePage = true;
                        }
                        else
                        {
                            model.IfInsidePage = false;
                        }
                    }

                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DigiPower.Onlinecol.Standard.Model.T_Module_MDL model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     Model.T_Module_MDL model = new DigiPower.Onlinecol.Standard.Model.T_Module_MDL();
     this.BindGridView(1);
 }