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

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_poundage model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_poundage();
                    if (dt.Rows[n]["p_id"].ToString() != "")
                    {
                        model.p_id = int.Parse(dt.Rows[n]["p_id"].ToString());
                    }
                    if (dt.Rows[n]["p_sprice"].ToString() != "")
                    {
                        model.p_sprice = int.Parse(dt.Rows[n]["p_sprice"].ToString());
                    }
                    if (dt.Rows[n]["p_eprice"].ToString() != "")
                    {
                        model.p_eprice = int.Parse(dt.Rows[n]["p_eprice"].ToString());
                    }
                    if (dt.Rows[n]["p_rate"].ToString() != "")
                    {
                        model.p_rate = decimal.Parse(dt.Rows[n]["p_rate"].ToString());
                    }
                    if (dt.Rows[n]["p_state"].ToString() != "")
                    {
                        model.p_state = int.Parse(dt.Rows[n]["p_state"].ToString());
                    }


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