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

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_saletype model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_saletype();
                    if (dt.Rows[n]["s_id"].ToString() != "")
                    {
                        model.s_id = int.Parse(dt.Rows[n]["s_id"].ToString());
                    }
                    model.s_name = dt.Rows[n]["s_name"].ToString();
                    if (dt.Rows[n]["s_value"].ToString() != "")
                    {
                        model.s_value = int.Parse(dt.Rows[n]["s_value"].ToString());
                    }
                    if (dt.Rows[n]["s_state"].ToString() != "")
                    {
                        model.s_state = int.Parse(dt.Rows[n]["s_state"].ToString());
                    }


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