Пример #1
0
 public bool UpdateProductDetails(string detailid, string productid, string productCode, string shapeCode, decimal bigPrice, string attrlist, string valuelist, string attrvaluelist, decimal price, decimal weight, string description, string productImg, string operateid, string clientid)
 {
     lock (SingleLock)
     {
         if (!string.IsNullOrEmpty(productImg) && productImg.IndexOf(TempPath) >= 0)
         {
             if (productImg.IndexOf("?") > 0)
             {
                 productImg = productImg.Substring(0, productImg.IndexOf("?"));
             }
             FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(productImg));
             productImg = FILEPATH + file.Name;
             if (file.Exists)
             {
                 file.MoveTo(HttpContext.Current.Server.MapPath(productImg));
             }
         }
         var dal = new ProductsDAL();
         return dal.UpdateProductDetails(detailid, productid, productCode, shapeCode, bigPrice, attrlist, valuelist, attrvaluelist, price, weight, description, productImg);
     }
 }
Пример #2
0
 /// <summary>
 /// 编辑子产品
 /// </summary>
 /// <param name="detailid">子产品ID</param>
 /// <param name="productid">产品ID</param>
 /// <param name="productCode">产品Code</param>
 /// <param name="shapeCode">条形码</param>
 /// <param name="attrlist">规格</param>
 /// <param name="valuelist">值</param>
 /// <param name="attrvaluelist"></param>
 /// <param name="price">价格</param>
 /// <param name="weight">重量</param>
 /// <param name="description">描述</param>
 /// <param name="operateid"></param>
 /// <param name="clientid"></param>
 /// <returns></returns>
 public bool UpdateProductDetails(string detailid, string productid, string productCode, string shapeCode, decimal bigPrice, string attrlist, string valuelist, string attrvaluelist, decimal price, decimal weight, string description, string productImg, string operateid, string clientid)
 {
     lock (SingleLock)
     {
         if (!string.IsNullOrEmpty(productImg))
         {
             if (productImg.IndexOf("tempfile") >= 0)
             {
                 if (productImg.IndexOf("?") > 0)
                 {
                     productImg = productImg.Substring(0, productImg.IndexOf("?"));
                 }
                 FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath(productImg));
                 productImg = FILEPATH + file.Name;
                 if (file.Exists)
                 {
                     file.MoveTo(HttpContext.Current.Server.MapPath(productImg));
                 }
             }
         }
         else
         {
             productImg = FILEPATH + DateTime.Now.ToString("yyyyMMddHHmmssms") + new Random().Next(1000, 9999).ToString() + ".png";
         }
         var dal = new ProductsDAL();
         return dal.UpdateProductDetails(detailid, productid, productCode, shapeCode, bigPrice, attrlist, valuelist, attrvaluelist, price, weight, description, productImg);
     }
 }