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

            if (rowsCount > 0)
            {
                JMP.MDL.jmp_pay model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JMP.MDL.jmp_pay();
                    if (dt.Rows[n]["p_id"].ToString() != "")
                    {
                        model.p_id = int.Parse(dt.Rows[n]["p_id"].ToString());
                    }
                    model.p_tradeno = dt.Rows[n]["p_tradeno"].ToString();
                    if (dt.Rows[n]["p_applytime"].ToString() != "")
                    {
                        model.p_applytime = DateTime.Parse(dt.Rows[n]["p_applytime"].ToString());
                    }
                    model.p_dealno = dt.Rows[n]["p_dealno"].ToString();
                    if (dt.Rows[n]["p_paytime"].ToString() != "")
                    {
                        model.p_paytime = DateTime.Parse(dt.Rows[n]["p_paytime"].ToString());
                    }
                    if (dt.Rows[n]["p_state"].ToString() != "")
                    {
                        model.p_state = int.Parse(dt.Rows[n]["p_state"].ToString());
                    }
                    if (dt.Rows[n]["p_money"].ToString() != "")
                    {
                        model.p_money = decimal.Parse(dt.Rows[n]["p_money"].ToString());
                    }
                    model.p_bill_id = dt.Rows[n]["p_bill_id"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(JMP.MDL.jmp_pay model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(JMP.MDL.jmp_pay model)
 {
     return(dal.Add(model));
 }