Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ERM.MDL.Ref> GetModelList(string strWhere)
        {
            DataSet            ds        = dal.GetList(strWhere);
            List <ERM.MDL.Ref> modelList = new List <ERM.MDL.Ref>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                ERM.MDL.Ref model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model         = new ERM.MDL.Ref();
                    model.keyWord = ds.Tables[0].Rows[n]["keyWord"].ToString();
                    if (ds.Tables[0].Rows[n]["orderindex"].ToString() != "")
                    {
                        model.orderindex = int.Parse(ds.Tables[0].Rows[n]["orderindex"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["RefID"].ToString() != "")
                    {
                        model.RefID = int.Parse(ds.Tables[0].Rows[n]["RefID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["tempid"].ToString() != "")
                    {
                        model.tempid = int.Parse(ds.Tables[0].Rows[n]["tempid"].ToString());
                    }
                    model.title = ds.Tables[0].Rows[n]["title"].ToString();
                    if (ds.Tables[0].Rows[n]["visible"].ToString() != "")
                    {
                        model.visible = int.Parse(ds.Tables[0].Rows[n]["visible"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ERM.MDL.Ref model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(ERM.MDL.Ref model)
 {
     dal.Add(model);
 }