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

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_platform model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_platform();
                    if (dt.Rows[n]["p_id"].ToString() != "")
                    {
                        model.p_id = int.Parse(dt.Rows[n]["p_id"].ToString());
                    }
                    model.p_name  = dt.Rows[n]["p_name"].ToString();
                    model.p_value = dt.Rows[n]["p_value"].ToString();
                    if (dt.Rows[n]["p_state"].ToString() != "")
                    {
                        model.p_state = int.Parse(dt.Rows[n]["p_state"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(JMP.MDL.jmp_platform model)
 {
     return(dal.Update(model));
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(JMP.MDL.jmp_platform model)
 {
     return(dal.Add(model));
 }