コード例 #1
0
 //更新商品信息
 //public bool UpdateSingleItem(int ItemID, int ProductID, int BrandID, string Name, string Area)
 //{
 //    if (helper.ExcuteCommandInt("update Items set ProductID=" + ProductID + ",BrandID=" + BrandID + ", Name='" + Name + "', Area='" + Area + "' where IID =" + ItemID + "") > 0)
 //        return true;
 //    else
 //        return false;
 //}
 public bool UpdateSingleItem(Entity.Items item)
 {
     return(helper.ExcuteCommandInt("update Items set ProductID="
                                    + item.getProductID() + ",BrandID="
                                    + item.getBrandID() + ", Name='"
                                    + item.getName() + "', Area='"
                                    + item.getArea() + "' where IID ="
                                    + item.getItemID() + "") > 0);
 }
コード例 #2
0
        public Entity.Items getSeckillItem(int id)
        {
            Entity.Items i   = new Entity.Items();
            DataRowView  drv = helper.GetTableValue("select  IID,ProductID,AgoraPrice,Days,Hours,Minutes,Seconds from Items,Images Where IID=" + id + "");

            i.setDays(drv["Days"].ToString());
            i.setHours(drv["Hours"].ToString());
            i.setMinutes(drv["Minutes"].ToString());
            i.setSeconds(drv["Seconds"].ToString());
            return(i);
        }
コード例 #3
0
 //更新商品价格
 public bool UpdateSinglePrice(Entity.Items item)
 {
     //int ItemID, string AgoraPrice, string MemberPrice, string VipPrice, string SeckillPrice
     if (helper.ExcuteCommandInt("update Items set AgoraPrice='"
                                 + item.getAgoraPrice() + "',MemberPrice='"
                                 + item.getMemberPrice() + "',VipPrice='"
                                 + item.getVipPrice() + "',SeckillPrice='"
                                 + item.getSeckillPrice() + "' where IID ="
                                 + item.getItemID() + "") > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #4
0
 //更新秒杀信息
 //public bool UpdateSingleItem(int ItemID, string Days, string Hours, string Minutes, string Seconds, string IsSecondKill)
 //{
 //    if (helper.ExcuteCommandInt("update Items set Days='"
 //        + Days + "',Hours='" + Hours + "',Minutes='" + Minutes + "',Seconds='" + Seconds + "',IsSecondKill='" + IsSecondKill + "' where IID=" + ItemID + "") > 0)
 //        return true;
 //    else
 //        return false;
 //}
 public bool UpdateSingleItemSeckill(Entity.Items items)
 {
     if (helper.ExcuteCommandInt("update Items set Days='"
                                 + items.getDays() + "',Hours='"
                                 + items.getHours() + "',Minutes='"
                                 + items.getMinutes() + "',Seconds='"
                                 + items.getSeconds() + "',IsSecondKill='"
                                 + items.getIsSecondKill() + "' where IID="
                                 + items.getItemID() + "") > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #5
0
        ////新增(不知道有没有调用?)
        ////public bool AddItems(string Name, string AgoraPrice, string MemberPrice, string VipPrice, string SeckillPrice, string Area, string Details, string Days, string Hours, string Minutes, string Seconds)
        ////{
        ////    //ProductID,BrandID,Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,IsSecondKill,LimitTime
        ////    if (helper.ExcuteCommandInt("insert into Items(Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,Days,Hours,Minutes,Seconds) values ('"
        ////        + Name + "','" + AgoraPrice + "','" + MemberPrice + "','" + VipPrice + "','" + SeckillPrice + "','" + Area + "','" + Details + "','" + Days + "','" + Hours + "','" + Minutes + "','" + Seconds + "')") > 0)
        ////        return true;
        ////    else
        ////        return false;
        ////}
        //public bool AddItems(Entity.Items items) {
        //    return helper.ExcuteCommandInt("insert into Items(Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,Days,Hours,Minutes,Seconds) values ('"
        //            + items.getName() + "','"
        //            + items.getAgoraPrice() + "','"
        //            + items.getMemberPrice() + "','"
        //            + items.getVipPrice()+ "','"
        //            + items.getSeckillPrice()+ "','"
        //            + items.getArea() + "','"
        //            + items.getDetails() + "','"
        //            + items.getDays() + "','"
        //            + items.getHours()+ "','"
        //            + items.getMinutes() + "','"
        //            + items.getSeconds()+ "')") > 0;
        //}

        //新增
        public bool AddItemsInfo(Entity.Items items)
        {
            //ProductID,BrandID,Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,IsSecondKill,LimitTime
            return(helper.ExcuteCommandInt("insert into Items(ProductID,BrandID,Name,AgoraPrice,MemberPrice,VipPrice,SeckillPrice,Area,Details,Days,Hours,Minutes,Seconds) values ("
                                           + items.getProductID() + ","
                                           + items.getBrandID() + ",'"
                                           + items.getName() + "','"
                                           + items.getAgoraPrice() + "','"
                                           + items.getMemberPrice() + "','"
                                           + items.getVipPrice() + "','"
                                           + items.getSeckillPrice() + "','"
                                           + items.getArea() + "','"
                                           + items.getDetails() + "','"
                                           + items.getDays() + "','"
                                           + items.getHours() + "','"
                                           + items.getMinutes() + "','"
                                           + items.getSeconds() + "')") > 0);
        }
コード例 #6
0
 public Entity.Items GetSingleItem(int ItemID)
 {
     DataRowView drv = helper.GetTableValue("select * from Items where IID=" + ItemID + "");
     Entity.Items item = new Entity.Items();
     item.setItemID(ItemID);
     item.setProductID(int.Parse(drv["ProductID"].ToString()));
     item.setBrandID( int.Parse(drv["BrandID"].ToString()));
     item.setName(drv["Name"].ToString());
     item.setAgoraPrice(drv["AgoraPrice"].ToString());
     item.setSeckillPrice(drv["SeckillPrice"].ToString());
     item.setMemberPrice(drv["MemberPrice"].ToString());
     item.setArea(drv["Area"].ToString());
     item.setDetails(drv["Details"].ToString());
     item.setVipPrice(drv["VipPrice"].ToString());
     item.setDays(drv["Days"].ToString());
     item.setHours(drv["Hours"].ToString());
     item.setMinutes(drv["Minutes"].ToString());
     item.setSeconds(drv["Seconds"].ToString());
     item.setIsSecondKill(drv["IsSecondKill"].ToString()); 
     return item;  
 }
コード例 #7
0
        public Entity.Items GetSingleItem(int ItemID)
        {
            DataRowView drv = helper.GetTableValue("select * from Items where IID=" + ItemID + "");

            Entity.Items item = new Entity.Items();
            item.setItemID(ItemID);
            item.setProductID(int.Parse(drv["ProductID"].ToString()));
            item.setBrandID(int.Parse(drv["BrandID"].ToString()));
            item.setName(drv["Name"].ToString());
            item.setAgoraPrice(drv["AgoraPrice"].ToString());
            item.setSeckillPrice(drv["SeckillPrice"].ToString());
            item.setMemberPrice(drv["MemberPrice"].ToString());
            item.setArea(drv["Area"].ToString());
            item.setDetails(drv["Details"].ToString());
            item.setVipPrice(drv["VipPrice"].ToString());
            item.setDays(drv["Days"].ToString());
            item.setHours(drv["Hours"].ToString());
            item.setMinutes(drv["Minutes"].ToString());
            item.setSeconds(drv["Seconds"].ToString());
            item.setIsSecondKill(drv["IsSecondKill"].ToString());
            return(item);
        }
コード例 #8
0
 public Entity.Items getSeckillItem(int id) {
     Entity.Items i= new Entity.Items();
     DataRowView drv = helper.GetTableValue("select  IID,ProductID,AgoraPrice,Days,Hours,Minutes,Seconds from Items,Images Where IID=" + id + "");
     i.setDays(drv["Days"].ToString());
     i.setHours(drv["Hours"].ToString());
     i.setMinutes(drv["Minutes"].ToString());
     i.setSeconds(drv["Seconds"].ToString());
     return i;
 }