Ejemplo n.º 1
0
        public int Uptdate(Model.SeckillCom Model)
        {
            string sql  = $"update SeckillCom set ActivityId={ Model.ActivityId},CommodityId={Model.CommodityId},SeckillTitle='{Model.SeckillTitle}',SeckillRemaek='{Model.SeckillRemaek}',SeckillModel={ Model.SeckillModel},TackTime={ Model.TackTime},ActionDate='{Model.ActionDate}',State={ Model.State},SeckilPrice={ Model.SeckilPrice},LimitNum={ Model.LimitNum} where SeckillComId={Model.SeckillComId}";
            string sql2 = $"insert into Lognote values (NULL,'修改',NOW(),'SeckillCom秒杀商品表');";

            DapperHelper.Execute(sql2);
            return(DapperHelper.Execute(sql));
        }
Ejemplo n.º 2
0
        public int Insert(Model.SeckillCom Model)
        {
            string sql  = $"insert into SeckillCom values (null,{Model.ActivityId},{Model.CommodityId},'{Model.SeckillTitle}','{Model.SeckillRemaek}',{Model.SeckillModel},{Model.TackTime},'{Model.ActionDate}',{Model.State},{Model.SeckilPrice},{Model.LimitNum},NOW())";
            string sql2 = $"insert into Lognote values (NULL,'添加',NOW(),'SeckillCom秒杀商品表');";

            DapperHelper.Execute(sql2);
            return(DapperHelper.Execute(sql));
        }
Ejemplo n.º 3
0
        public int UptZt(int sid)
        {
            string sql = "select * FROM SeckillCom";
            List <Model.SeckillCom> la = DapperHelper.GetList <Model.SeckillCom>(sql);

            Model.SeckillCom aa   = la.FirstOrDefault(x => x.SeckillComId.Equals(sid));
            string           sql1 = "";

            if (aa.State == 0)
            {
                sql1 = $"UPDATE SeckillCom SET State=State+1 where SeckillComId={sid}";
            }
            else
            {
                sql1 = $"UPDATE SeckillCom SET State=State-1 where SeckillComId={sid}";
            }
            string sql2 = $"insert into Lognote values (NULL,'修改状态',NOW(),'SeckillCom秒杀商品表');";

            DapperHelper.Execute(sql2);
            return(DapperHelper.Execute(sql1));
        }
Ejemplo n.º 4
0
        public int Uptdate(Model.SeckillCom Model)
        {
            string sql = $"update SeckillCom set ActivityId={ Model.ActivityId},CommodityId={Model.CommodityId},SeckillTitle='{Model.SeckillTitle}',SeckillRemaek='{Model.SeckillRemaek}',SeckillModel={ Model.SeckillModel},TackTime={ Model.TackTime},ActionDate='{Model.ActionDate}',State={ Model.State}.SeckilPrice={ Model.SeckilPrice},LimitNum={ Model.LimitNum} where SeckillComId={Model.SeckillComId}";

            return(DapperHelper.Execute(sql));
        }
Ejemplo n.º 5
0
        public int Insert(Model.SeckillCom Model)
        {
            string sql = $"insert into SeckillCom values (null,{Model.ActivityId},{Model.CommodityId},'{Model.SeckillTitle}','{Model.SeckillRemaek}',{Model.SeckillModel},{Model.TackTime},'{Model.ActionDate}',{Model.State},{Model.SeckilPrice},{Model.LimitNum})";

            return(DapperHelper.Execute(sql));
        }