zoukankan      html  css  js  c++  java
  • API-DAL后台示例--dal(添加,显示)

    dal(添加,显示)
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Model;
    namespace DAL
    {
        public class ShoppingDAL
        {
            DBHelper helper = new DBHelper();
            /// <summary>
            /// 新增优惠券的方式
            /// </summary>
            /// <param name="m"></param>
            /// <returns></returns>
            public int Add(yhqModel m)
            {
                string sql = string.Format("insert into [yhq] values ('{0}', '{1}', {2}, '{3}', '{4}', '{5}', '{6}', '{7}', {8}, {9})",
                    m.mc, m.Fenlei, m.sytj, m.ksrq, m.jsrq, m.yhfs, m.yhfs1, m.yhfs2, m.flfs, m.ffzs);
                return helper.ExecuteNonQuery(sql);
            }
            /// <summary>
            /// 获取所有领取记录的方法
            /// </summary>
            /// <returns></returns>
            public List<lqjlModel> Show()
            {
                string sql = @"select lqjl.Id, yh.Name, yhq.mc, yhq.sytj, yhq.yhfs, yhq.yhfs1, lqjl.lqsh, lqjl.hxzt
                    from lqjl left join yh on lqjl.yhId = yh.Id
                    left join yhq on lqjl.yhqId = yhq.Id";
                return helper.GetToList<lqjlModel>(sql);
            }
        }
    }
  • 相关阅读:
    第四周作业及总结
    第三周作业及其总结
    第二周作业及总结
    我所敬佩的老师
    秋季学习总结
    自我介绍
    寒三总结
    2019春第7周作业
    2019春第六周作业
    2019春第五周作业
  • 原文地址:https://www.cnblogs.com/gc1229/p/13072889.html
Copyright © 2011-2022 走看看