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

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_AppChannelReport model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_AppChannelReport();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["CreatedOn"].ToString() != "")
                    {
                        model.CreatedOn = DateTime.Parse(dt.Rows[n]["CreatedOn"].ToString());
                    }
                    if (dt.Rows[n]["CreatedDate"].ToString() != "")
                    {
                        model.CreatedDate = DateTime.Parse(dt.Rows[n]["CreatedDate"].ToString());
                    }
                    if (dt.Rows[n]["ChannelId"].ToString() != "")
                    {
                        model.ChannelId = int.Parse(dt.Rows[n]["ChannelId"].ToString());
                    }
                    model.ChannelName = dt.Rows[n]["ChannelName"].ToString();
                    model.PayTypeName = dt.Rows[n]["PayTypeName"].ToString();
                    if (dt.Rows[n]["AppId"].ToString() != "")
                    {
                        model.AppId = int.Parse(dt.Rows[n]["AppId"].ToString());
                    }
                    if (dt.Rows[n]["Money"].ToString() != "")
                    {
                        model.Money = decimal.Parse(dt.Rows[n]["Money"].ToString());
                    }
                    if (dt.Rows[n]["Notpay"].ToString() != "")
                    {
                        model.Notpay = decimal.Parse(dt.Rows[n]["Notpay"].ToString());
                    }
                    if (dt.Rows[n]["Success"].ToString() != "")
                    {
                        model.Success = decimal.Parse(dt.Rows[n]["Success"].ToString());
                    }
                    if (dt.Rows[n]["Successratio"].ToString() != "")
                    {
                        model.Successratio = decimal.Parse(dt.Rows[n]["Successratio"].ToString());
                    }


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