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

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_apprate model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_apprate();
                    if (dt.Rows[n]["r_id"].ToString() != "")
                    {
                        model.r_id = int.Parse(dt.Rows[n]["r_id"].ToString());
                    }
                    if (dt.Rows[n]["r_appid"].ToString() != "")
                    {
                        model.r_appid = int.Parse(dt.Rows[n]["r_appid"].ToString());
                    }
                    if (dt.Rows[n]["r_paymodeid"].ToString() != "")
                    {
                        model.r_paymodeid = int.Parse(dt.Rows[n]["r_paymodeid"].ToString());
                    }
                    if (dt.Rows[n]["r_proportion"].ToString() != "")
                    {
                        model.r_proportion = decimal.Parse(dt.Rows[n]["r_proportion"].ToString());
                    }
                    if (dt.Rows[n]["r_state"].ToString() != "")
                    {
                        model.r_state = int.Parse(dt.Rows[n]["r_state"].ToString());
                    }
                    if (dt.Rows[n]["r_time"].ToString() != "")
                    {
                        model.r_time = DateTime.Parse(dt.Rows[n]["r_time"].ToString());
                    }
                    model.r_name = dt.Rows[n]["r_name"].ToString();


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