예제 #1
0
 /// <summary>
 /// 查詢固定組合商品的總信息
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public List<ProductItemMap> QueryProductItemMap(ProductItemMap p)
 {
     p.Replace4MySQL();
     tempStr = string.Format("select  rid,channel_id,channel_detail_id,item_id,product_name,product_cost,product_price,product_id,group_item_id,price_master_id  from product_item_map where channel_id={0} and product_id={1} and group_item_id='{2}' and price_master_id={3}", p.channel_id, p.product_id, p.group_item_id, p.price_master_id);//edit by xiangwang0413w 20714/07/02
     return _accessMySql.getDataTableForObj<ProductItemMap>(tempStr.ToString());
 }
예제 #2
0
 public List<ProductItemMap> QueryAll(ProductItemMap p)
 {
     p.Replace4MySQL();
     tempStr = string.Format(@"SELECT  rid,channel_id,channel_detail_id,item_id,product_name,product_cost,product_price,product_id,group_item_id,price_master_id  FROM product_item_map WHERE channel_id = {0} AND channel_detail_id = '{1}'", p.channel_id, p.channel_detail_id);
     return _accessMySql.getDataTableForObj<ProductItemMap>(tempStr);
 }
예제 #3
0
 public string saveString(ProductItemMap p)
 {
     p.Replace4MySQL();
     return string.Format("insert into product_item_map (`channel_id`, `channel_detail_id`, `item_id`, `product_name`, `product_cost`, `product_price`,`product_id`,`group_item_id`,`price_master_id`) values ({0},'{1}',{2},'{3}',{4},{5},{6},'{7}',{8});select @@identity;", p.channel_id, p.channel_detail_id, p.item_id, p.product_name, p.product_cost, p.product_price, p.product_id, p.group_item_id, p.price_master_id); //edit by xiangwang0413w 2014/07/20 增加站台價格
 }
예제 #4
0
 public int UpdatePIM(ProductItemMap p)
 {
     p.Replace4MySQL();
     tempStr = string.Format("update product_item_map set product_name='{1}',product_price={2} where channel_detail_id = '{0}' ", p.channel_detail_id, p.product_name, p.product_price);
     return _accessMySql.execCommand(tempStr);
 }
예제 #5
0
        //public int Save(ProductCompare p)
        //{
        //    tempStr = string.Format("insert into product_item_map (`channel_id`, `channel_detail_id`, `item_id`, `product_name`, `product_cost`, `product_price`) values ({0},'{1}',{2},'{3}',{4},{5});", p.channel_id, p.channel_detail_id, p.item_id, p.product_name, p.product_cost, p.product_price);
        //    return _accessMySql.execCommand(tempStr);
        //}

        /// <summary>
        /// 保存商品對照(單一)
        /// </summary>
        /// <param name="p">一條商品信息</param>
        /// <returns></returns>
        public int Save(ProductItemMap p)
        {
            p.Replace4MySQL();
            tempStr = string.Format("insert into product_item_map (`channel_id`, `channel_detail_id`, `item_id`, `product_name`, `product_cost`, `product_price`,`product_id`,`price_master_id`) values ({0},'{1}',{2},'{3}',{4},{5},{6},{7})", p.channel_id, p.channel_detail_id, p.item_id, p.product_name, p.product_cost, p.product_price, p.product_id, p.price_master_id);
            return _accessMySql.execCommand(tempStr);
        }