public HttpResponseBase VendorProductDelete() { BLL.gigade.Model.Vendor vendorModel = (BLL.gigade.Model.Vendor)Session["vendor"]; _productTempMgr = new ProductTempMgr(connectionString); int writerId = (int)vendorModel.vendor_id; string json = "{success:false}"; try { if (!string.IsNullOrEmpty(Request.Form["Product_Id"])) { string[] pro_Ids = Request.Form["Product_Id"].Split('|'); _productMgr = new ProductMgr(connectionString); foreach (string product_id in pro_Ids.Distinct()) { if (!string.IsNullOrEmpty(product_id)) { ProductTemp product_temp = new ProductTemp(); _productTempMgr = new ProductTempMgr(connectionString); product_temp = _productTempMgr.GetVendorProTemp(new ProductTemp { Product_Id = product_id, Writer_Id = writerId }); int combo_type = product_temp.Combo_Type; bool isDelete = _productTempMgr.DeleteVendorProductTemp(writerId, combo_type, product_id == string.Empty ? "0" : product_id); if (isDelete) { json = "{success:true}"; } else { json = "{success:false}"; } } } } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }
public HttpResponseBase DeleteTempPro() { string json = string.Empty; try { BLL.gigade.Model.Vendor vendorModel = (BLL.gigade.Model.Vendor)Session["vendor"]; int writerId = (int)vendorModel.vendor_id;// (Session["caller"] as Caller).user_id; string product_id = string.Empty; if (!string.IsNullOrEmpty(Request.Params["ProductId"])) { product_id = Request.Params["ProductId"].ToString(); } //if (!string.IsNullOrEmpty(Request.Form["OldProductId"])) //{ // product_id = Request.Form["OldProductId"].ToString(); //} _productTempMgr = new ProductTempMgr(connectionString); //刪除服務器上對應的圖片 DeletePicOnServer(true, true, true, 0, product_id); if (_productTempMgr.DeleteVendorProductTemp(writerId, COMBO_TYPE, product_id == string.Empty ? "0" : product_id)) { json = "{success:true}"; } else { json = "{success:false}"; } } catch (Exception ex) { Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage(); logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message); logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name; log.Error(logMessage); json = "{success:false}"; } this.Response.Clear(); this.Response.Write(json); this.Response.End(); return this.Response; }