public ActionResult ProductsTypeDelete()
        {
            bool result = false;
            string Message = "";
            try
            {
                string dliid = RequestBase.GetString("dli_id");
                string pid = dliid.Split('|')[0];
               List<Model.ProductTypeBase> model = ptbll.GetModelList(" pt_parentid ="+pid+" and pt_IsDel=0");
               if (model.Count > 0)
               {
                   Message = "该类别下有其它子类,不允许删除!";
                   return Content(DWZUtil.GetResultJson("300", Message, "", "", ""));

               }
               else
               {
                   var ptlist = new BLL.ProductBase().GetModelList(" p_IsDel=0 and pt_Id="+pid);
                   if (ptlist.Count > 0)
                   {
                       return Content(DWZUtil.GetResultJson("300", "该类别已被引用,不允许删除", "", "", ""));
                   }
                   else
                   {
                       Model.ProductTypeBase ptmodel = ptbll.GetModel(int.Parse(pid));
                       ptmodel.pt_IsDel = true;
                       result = ptbll.Update(ptmodel);
                   }
               }
                if (result)
                {
                    return Content(DWZUtil.GetAjaxTodoJson("200", "删除成功!!", "", "", "", "ptBox", ""));
                }
                else
                {
                    Message = "删除失败!";
                    return Content(DWZUtil.GetResultJson("300", Message, "", "", ""));
                }
            }
            catch
            {
                return Content(DWZUtil.GetResultJson("300", "删除失败!!", "", "", ""));
            }
            finally
            {

            }
        }
Exemplo n.º 2
0
        //删除
        public ActionResult CarriageDelete()
        {
            bool result = false;
            string Message = "";
            try
            {
                string id = RequestBase.GetString("dli_id");
                string pid = id.Split('|')[1];
                int ptid = int.Parse(pid);//运费模板ID

                var list = new BLL.ProductBase().GetModelList(" p_IsDel=0 and ct_ID="+ptid);
                if (list.Count > 0)
                {
                    return Content(DWZUtil.GetResultJson("300", "该运费模板已被引用,无法删除", "", "", ""));
                }
                else
                {
                    Model.CarriageBase NewP = pcbll.GetModel(ptid);
                    NewP.car_IsDel = true;
                    result = pcbll.Update(NewP);
                }
                if (result)
                {
                    Message = "删除成功!";
                    return Content(DWZUtil.GetAjaxTodoJson("200", Message, "", "", "", "cBox", ""));
                }
                else
                {
                    Message = "程序异常,删除失败";
                    return Content(DWZUtil.GetResultJson("300", Message, "", "", ""));
                }
            }
            catch
            {
                Message = "程序异常,删除失败";
                return Content(DWZUtil.GetResultJson("300", Message, "", "", ""));
            }
        }
Exemplo n.º 3
0
 public ActionResult Partialremaituijian()
 {
     List<Model.ProductBase> pinfo = new BLL.ProductBase().GetpInfoByRecommendTypeId(1);
     return View(pinfo.ToList());
 }
 public ActionResult Delete()
 {
     bool result = true;
     try
     {
         string id = RequestBase.GetString("b_ID");
         Model.BrandBase NewModel = bll.GetModel(Convert.ToInt32(id));
         NewModel.b_IsDel = true;
         var ptypebrand = new BLL.ProductBase().GetModelList(" p_IsDel=0 and b_Id=" + int.Parse(id));
         if (ptypebrand.Count > 0)
         {
             return Content(DWZUtil.GetResultJson("300", "该品牌已被商品引用,不允许删除!!", "", "", ""));
         }
         else
         {
             result = bll.Update(NewModel);
             if (result)
                 return Content(DWZUtil.GetAjaxTodoJson("200", "删除成功!!", "", "", "", "BrandBox", ""));
             else
                 return Content(DWZUtil.GetResultJson("300", "程序异常,删除失败", "", "", ""));
         }
     }
     catch
     {
         return Content(DWZUtil.GetResultJson("300", "删除失败!!", "", "", ""));
     }
 }
        /// <summary>
        /// 购物车
        /// </summary>
        /// <returns></returns>
        private string shopcartMethod()
        {
            string result = "";
            string pid = Form["p_id"];
            string p_chima = Form["p_chima"];
            string p_yanse = Form["p_yanse"];
            string p_commoditynum = Form["p_commoditynum"];
            DataTable dtsku = new BLL.SKUBase().GetList(" sku_IsDel=0 and p_ID= "+pid).Tables[0];
            string  pt_id= new BLL.ProductBase().GetModel(int.Parse(pid)).pt_ID.ToString();//商品小类型
            string ptp_id= new BLL.ProductTypeBase().GetModel(int.Parse(pt_id)).pt_ParentId.ToString();//商品大类型
            if (System.Web.HttpContext.Current.Request.Cookies[":userlogin"] == null || System.Web.HttpContext.Current.Request.Cookies[":userlogin"].Value == "")//如果没有用户登录
            {
                result = "{'result':'error_login'}";
            }
            else {//如果有用户登录

                Model.MemberBase mbmodel = CookieEncrypt.DeserializeObject(System.Web.HttpContext.Current.Request.Cookies[":userlogin"].Value) as MemberBase;

                if (ptp_id == "488" || ptp_id == "489") //是男鞋或女鞋
                {
                    if (p_chima == "0")
                    {
                        result = "{'result':'error_chima'}";
                    }
                    else if (p_yanse == "0")
                    {
                        result = "{'result':'error_yanse'}";
                    }
                    else
                    { //尺码 颜色都选择后  写入购物车

                        Model.ShoppingCartBase scmodel = new ShoppingCartBase();
                        scmodel.sku_ID = int.Parse(dtsku.Rows[0]["sku_ID"].ToString());
                        scmodel.m_ID = mbmodel.m_ID;
                        scmodel.sc_pCount =int.Parse( p_commoditynum);
                        scmodel.sc_pPric = Convert.ToDecimal(dtsku.Rows[0]["sku_Price"]);
                        scmodel.sc_CreateOn = DateTime.Now;
                        scmodel.sc_IsDel = false;
                        scmodel.sc_Status = false;
                        scmodel.sc_IsGP = false;
                        scmodel.sc_chima = p_chima;
                        scmodel.sc_yanse = p_yanse;

                        int re= new BLL.ShoppingCartBase().Add(scmodel);
                        if (re > 0)
                        {
                            result = "{'result':'success'}";
                        }
                        else {
                            result = "{'result':'error_data'}";
                        }
                    }
                }
                else//如果选择的商品不是鞋子那么尺码颜色设为0
                {
                    Model.ShoppingCartBase scmodel = new ShoppingCartBase();
                    scmodel.sku_ID = int.Parse(dtsku.Rows[0]["sku_id"].ToString());
                    scmodel.m_ID = mbmodel.m_ID;
                    scmodel.sc_pCount = int.Parse(p_commoditynum);
                    scmodel.sc_pPric = Convert.ToDecimal(dtsku.Rows[0]["sku_Price"]);
                    scmodel.sc_CreateOn = DateTime.Now;
                    scmodel.sc_IsDel = false;
                    scmodel.sc_Status = false;
                    scmodel.sc_IsGP = false;
                    scmodel.sc_chima = p_chima;
                    scmodel.sc_yanse = p_yanse;

                    int re = new BLL.ShoppingCartBase().Add(scmodel);
                    if (re > 0)
                    {
                        result = "{'result':'success'}";
                    }
                    else
                    {
                        result = "{'result':'error_data'}";
                    }
                }
            }
            return result;
        }
Exemplo n.º 6
0
        public DataTable GetProductPropertyDetail(string strWhere = "")
        {
            BLL.ProductBase productBase = new BLL.ProductBase();

            return productBase.GetProductPropertyDetail(strWhere);
        }
Exemplo n.º 7
0
 public List<Model.ProductBase> GetpInfoByTypeId(int ptID)
 {
     BLL.ProductBase productBase = new BLL.ProductBase();
     var list = productBase.GetpInfoByTypeId(ptID);
     return list;
 }