/// <summary> /// 添加用户收藏商品 /// </summary> /// <param name="entId"></param> /// <param name="userId"></param> /// <param name="article_Id"></param> /// <returns></returns> public static bool AddGoodsCollection(string entId, string userId, string article_Id) { bool flag = false; try { SqlParameter[] param = new SqlParameter[] { new SqlParameter("@Type", "AddGoodsCollection"), new SqlParameter("@entId", entId), new SqlParameter("@userId", userId), new SqlParameter("@article_Id", article_Id), }; SqlRun sql = new SqlRun(SqlRun.sqlstr); if (sql.ExecuteNonQuery("Proc_Goods_Statistical", param) > 0) { flag = true; } } catch (Exception ex) { LogQueue.Write(LogType.Error, "StatisticalDal/AddGoodsCollection", ex.Message.ToString()); throw ex; } return(flag); }
/// <summary> /// 再次购买 /// </summary> /// <param name="userId">用户Id</param> /// <param name="entId">机构Id</param> /// <param name="billNo">订单序号</param> /// <returns></returns> public JsonResult OnceAgain(string userId, string entId, int billNo, string cartType, string bs = "XQ", string loginId = "") { try { if (string.IsNullOrEmpty(userId)) { LogQueue.Write(LogType.Error, "Cart/OnceAgain", $"userId:{userId},entId:{entId},billNo:{billNo}"); return(Json(new{ success = false, message = "用户未登录,请先登录!" })); } ///获取用户信息 UserInfoDal udal = new UserInfoDal(); List <UserInfo> user = udal.GetUserInfo(userId, entId); string jgjb = "", khType = ""; if (user.Count > 0) { jgjb = user[0].Pricelevel; khType = user[0].KhType; } CartDal dal = new CartDal(); string result = dal.OnceAgain(userId, entId, billNo, loginId, out bool flag, jgjb, khType, cartType, bs); return(Json(new { success = flag, message = result })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Cart/OnceAgain", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message })); } }
/// <summary> /// 获取购物车金额 /// </summary> /// <param name="entId">企业Id</param> /// <param name="userId">用户id</param> /// <param name="goodsList">选中的商品id</param> /// <returns></returns> public JsonResult CartAmount(string entId, string userId, string goodsList, string ywyId = "") { try { if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } ///获取用户信息 UserInfoDal dal = new UserInfoDal(); List <UserInfo> user = dal.GetUserInfo(userId, entId); if (user.Count <= 0) { return(Json(new { success = false, message = "E002" })); } ///获取购物车信息 CartDal cdal = new CartDal(); List <CartList> list = cdal.GetCartAmount(user[0].EntId, userId, goodsList, user[0].Pricelevel, user[0].KhType, ywyId); return(Json(new { success = true, list = list })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Cart/CartAmount", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
public JsonResult AddGoodsCollection(string entId, string userId, string article_Id) { try { ///获取用户收藏商品 if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } if (string.IsNullOrEmpty(article_Id)) { return(Json(new { success = false, message = "必传参数不能为空" })); } bool flag = StatisticalDal.AddGoodsCollection(entId, userId, article_Id); if (flag) { return(Json(new { success = true, message = "操作成功" })); } else { return(Json(new { success = false, message = "操作失败" })); } } catch (Exception ex) { LogQueue.Write(LogType.Error, "Search/AddGoodsCollection", ex.Message.ToString()); return(Json(new { success = false, message = "商品收藏添加失败!" })); } }
public JsonResult GoodsDetails(string entId, string userId, string articleId) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } if (string.IsNullOrEmpty(articleId)) { return(Json(new { success = false, message = "参数获取失败!" })); } ///商品信息 GoodsInfoDal dal = new GoodsInfoDal(); ///商品当月销量排行 List <GoodsStatistical> slist = dal.GetGoodsRanking(userId, entId, "GoodsSale", 10); ///商品当月点击量量排行 List <GoodsStatistical> clist = dal.GetGoodsRanking(userId, entId, "GoodsClick", 3); ///商品详情 List <GoodsList> list = dal.GetGoodDetail(userId, articleId, entId); return(Json(new { success = true, list, slist, clist })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Goods/GoodsDetails", ex.Message.ToString()); return(Json(new { success = false, message = "商品详情加载失败!" })); } }
public JsonResult GoodsCriticisms(string userId, string entId, string articleId, string orderBy = "desc", int pageIndex = 1, int pageSize = 30) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } if (string.IsNullOrEmpty(articleId)) { return(Json(new { success = false, message = "参数获取失败!" })); } else if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "请先登录!" })); } ///商品信息 GoodsInfoDal dal = new GoodsInfoDal(); ///商品评价 List <StairCriticisms> list = dal.GetCriticisms(userId, entId, articleId, pageIndex, pageSize, orderBy, out int pageCount, out int recordCount, out int passSum, out decimal raveReviews); return(Json(new { success = true, list, pageCount, recordCount, passSum, raveReviews })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Goods/GoodsEvaluate", ex.Message.ToString()); return(Json(new { success = false, message = "商品评价失败!" })); } }
public JsonResult LikeCriticism(string userId, string entId, int criticismsId) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } if (criticismsId == 0) { return(Json(new { success = false, message = "参数获取异常!" })); } else if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "请先登录!" })); } ///商品信息 GoodsInfoDal dal = new GoodsInfoDal(); int flag = dal.LikeCriticism(userId, entId, criticismsId, out string message); return(Json(new { success = flag == 1 ? true : false, message })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Goods/RedactCriticism", ex.Message.ToString()); return(Json(new { success = false, message = "商品评价点赞失败!" })); } }
public ActionResult IntegralFloor(string entId, string flootType, int num = 0, int pageIndex = 1, int pageSize = 15) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId.ToString(); } if (flootType == "" && num <= 0) { return(Json(new { success = false, message = "获取所有楼层商品信息时,参数num必须大于0" })); } else if (flootType != "" && num > 0) { return(Json(new { success = false, message = "获取单一楼层所有商品信息时,参数num必须等于0" })); } if (num > 0) { pageIndex = 1; pageSize = num; } IntegralStoreDal interceptDal = new IntegralStoreDal(); List <IndexFloor> integralGoods = interceptDal.IntegralFloor(entId, flootType, num, pageIndex, pageSize, out int pageCount, out int recordCount); return(Json(new { success = true, pageCount = pageCount, recordCount = recordCount, list = integralGoods })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "IntegralStore/IntegralFloor", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
/// <summary> /// 获取商城模板信息 /// </summary> /// <param name="entId">企业Id</param> /// <param name="htmlType">html页面类型</param> /// <returns></returns> public JsonResult HtmlTemplate(string entId) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } List <Template> list = new List <Template>(); Template t = new Template(); ////获取页面配置信息 TemplateDal dal_t = new TemplateDal(); t.List_Sz = dal_t.GetSystemBase(entId); //获取药品分类 ImgInfoDal dal_i = new ImgInfoDal(); t.List_Fl = dal_i.GetCategory(entId, 7); //底部资讯 ArticleDal dal_a = new ArticleDal(); t.List_Zx = dal_a.GetArticle(entId, 11, "Mt"); ///商品轮播图片 t.List_Lb = dal_i.GetImgInfo(10, "LB", entId, "PC", ""); list.Add(t); return(Json(new { success = true, list = list })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Template/HtmlTemplate", ex.Message.ToString()); return(Json(new { success = false, message = "模板信息加载失败!" })); } }
/// <summary> /// 验签 /// </summary> /// <returns></returns> private bool CheckSing() { if (!IsSet("SIGN")) { LogQueue.Write(LogType.Error, "", "ConstructionData签名不存在"); throw new ConstructionException("ConstructionData签名不存在"); } else if (string.IsNullOrEmpty(GetValue("SIGN").ToString())) { LogQueue.Write(LogType.Error, "", "ConstructionData签名存在,但不合法"); throw new ConstructionException("ConstructionData签名存在,但不合法"); } string returnSing = GetValue("SIGN").ToString(); //本地生成签名 string local = MakeSign(); //比对签名 if (returnSing == local) { return(true); } LogQueue.Write(LogType.Error, "", "ConstructionData签名验证错误"); throw new ConstructionException("ConstructionData签名验证错误"); }
/// <summary> /// 积分购车车结算 /// </summary> /// userId:用户,entId:机构,goodsid :','拼接的积分商品id字符串,num:积分商品数量,total:积分商品总积分 /// <returns></returns> public ActionResult SettleAccounts() { try { string result; string userId = Request.Params["userId"].ToString(); string entId = Request.Params["entId"].ToString(); if (string.IsNullOrEmpty(userId)) { return(Content(JsonHelper.GetErrorJson(1, 0, "请登录后再加入礼品车"), "json")); } string address = Request.Params["address"].ToString(); string contact = Request.Params["contact"].ToString(); //联系人 string phone = Request.Params["phone"].ToString(); //联系电话 string remarks = Request.Params["remarks"].ToString(); //备注 string goodsidStr = Request.Params["goodsid"].ToString().Trim(); int num = int.Parse(Request.Params["num"].ToString()); string zjf = Request.Params["total"].ToString().Trim(); IntegralStoreDal integralStoreDal = new IntegralStoreDal(); result = integralStoreDal.SettleAccounts(goodsidStr, num, userId, entId, zjf, address, contact, phone, remarks); return(Content(result, "json")); } catch (Exception ex) { LogQueue.Write(LogType.Error, "IntegralStore/IntegralCart", ex.Message.ToString()); return(Content(JsonHelper.GetErrorJson(1, 0, ex.Message.ToString()), "json")); } }
/// <summary> /// json字符串转为SortedDictionary格式 /// </summary> /// <param name="json">json字符串</param> /// <param name="verify">是否验签 true/false</param> /// <returns>SortedDictionary格式</returns> public Dictionary <string, object> Dictionary(string json, bool verify = true) { if (string.IsNullOrEmpty(json)) { LogQueue.Write(LogType.Error, "ConstrunctionData/Dictionary", "ConstrunctionData内部含有值为null的字段!"); throw new ConstructionException("将空的json串转换为ConstrunctionData不合法!"); } keyValuePairs = JsonConvert.DeserializeObject <Dictionary <string, object> >(json); if (verify) { try { if (!keyValuePairs.Keys.Contains <string>("SIGN")) { return(keyValuePairs); } //验签 CheckSing(); } catch (Exception ex) { throw new ConstructionException(ex.Message); } } return(keyValuePairs); }
/// <summary> /// 华烁打包质检报告下载 /// </summary> /// <param name="picUrls"></param> public void QualityZipDown(List <string> picUrls, ref string filePath) { string newpath = HttpContext.Current.Server.MapPath("/FPImgUpload/") + Guid.NewGuid().ToString("N") + "/";//新图片的物理路径 if (!Directory.Exists(newpath)) { Directory.CreateDirectory(newpath); } filePath = newpath; foreach (string url in picUrls) { try { WebRequest wr = WebRequest.Create(url); HttpWebResponse wresp = (HttpWebResponse)wr.GetResponse(); Stream s = wresp.GetResponseStream(); System.Drawing.Image img = System.Drawing.Image.FromStream(s); img.Save(newpath + url.Substring(url.LastIndexOf("/"))); } catch (Exception ex) { LogQueue.Write(LogType.Error, "QualityInspectionReport/QualityZipDown", ex.ToString()); continue; } } }
/// <summary> /// 会员申请机构 /// </summary> /// <param name="userId">用户Id</param> /// <param name="entId">机构Id</param> /// <param name="status">状态 0/1</param> /// <returns></returns> public JsonResult SaveMerchants(string userId, string entIdList, int status) { try { if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "请登陆后再提交申请" })); } else if (string.IsNullOrEmpty(entIdList)) { return(Json(new { success = false, message = "请选择机构" })); } if (status != 0 && status != 1) { return(Json(new { success = false, message = "status参数错误" })); } MemberDal dal = new MemberDal(); bool flag = dal.SaveMerchantsDal(userId, entIdList, status); string msg = "存盘失败"; if (flag) { msg = "存盘成功"; } return(Json(new { success = flag, message = msg })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Member/SaveMerchants", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
/// <summary> /// 华烁获取质检报告数据列表 /// </summary> /// <param name="type"></param> /// <param name="userId"></param> /// <param name="entId"></param> /// <param name="sqlValue"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public ActionResult GetQualityList(string type, string userId, string entId, string sqlValue, int pageIndex, int pageSize) { try { if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(entId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } QualityInspectionReport qualityInspectionReport = new QualityInspectionReport(); DataSet ds = qualityInspectionReport.GetQualityList(type, userId, entId, sqlValue, pageIndex, pageSize); DataTable data = ds.Tables[1]; int recordCount = Convert.ToInt32(ds.Tables[2].Rows[0]["recordCount"]); int pageCount = Convert.ToInt32(ds.Tables[2].Rows[0]["pageCount"]); string result = App_Code.JsonMethod.GetDataTable(1, recordCount, pageCount, data); //var datalist = new { data = data.AsEnumerable().ToList(), recordCount = recordCount, pageCount = pageCount, success = true }; //JsonSerializerSettings setting = new JsonSerializerSettings() //{ // ReferenceLoopHandling = ReferenceLoopHandling.Ignore //}; //string result = JsonConvert.SerializeObject(datalist,setting); return(Content(result)); } catch (Exception ex) { LogQueue.Write(LogType.Error, "QualityInspectionReport/GetQualityList", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
public JsonResult GetBrandList(string userId, string faType, string billno, string entId, int pageIndex = 1, int pageSize = 3) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } ///获取用户信息 UserInfoDal dal = new UserInfoDal(); List <UserInfo> user = dal.GetUserInfo(userId, entId); bool landing = false; bool staleDated = false; string Pricelevel = ""; string KhType = ""; if (user.Count > 0) { entId = user[0].EntId; Pricelevel = user[0].Pricelevel; KhType = user[0].KhType; landing = true; staleDated = user[0].StaleDated; } BrandDal bdal = new BrandDal(); List <BrandList> list = bdal.GetBrandList(entId, userId, Pricelevel, KhType, landing, staleDated, faType, billno, pageIndex, pageSize, out int recordCount, out int pageCount); return(Json(new { success = true, list = list, recordCount = recordCount, pageCount = pageCount })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Brand/GetBrandList", ex.Message); return(Json(new { success = false, message = ex.Message })); } }
/// <summary> /// 图片数据 /// </summary> /// <param name="userId">用户</param> /// <param name="entId">企业</param> /// <param name="sqlvalue"></param> /// <param name="type"></param> /// <param name="arguments"></param> /// <returns></returns> public ActionResult PicturesDownLoad(string userId, string entId, string sqlvalue, string type, string arguments = "") { try { if (string.IsNullOrEmpty(userId) || string.IsNullOrEmpty(entId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } string str = HttpRuntime.AppDomainAppPath; string path, fileName; if (!string.IsNullOrEmpty(arguments)) { //同一批号图片进行处理 path = str + "FPImgupload\\" + type + "\\" + sqlvalue + "\\" + arguments; fileName = arguments; } else { path = str + "FPImgupload\\" + type + "\\" + sqlvalue; fileName = sqlvalue; } QualityInspectionReport report = new QualityInspectionReport(); var by = report.DlZipDir(path, fileName); return(File(by, "application/zip", "" + fileName + ".zip")); } catch (Exception ex) { LogQueue.Write(LogType.Error, "QualityInspectionReport/PicturesData", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
/// <summary> /// 修改用户密码 /// </summary> /// <param name="entId"></param> /// <param name="userId"></param> /// <param name="pwd"></param> /// <returns></returns> public static bool UpdateUserPwd(string entId, string userId, string pwd) { try { SqlParameter[] sqls = new SqlParameter[] { new SqlParameter("@type", "UpdatePassword"), new SqlParameter("@userId", userId), new SqlParameter("@entId", entId), new SqlParameter("@pwd", pwd) }; SqlRun sql = new SqlRun(SqlRun.sqlstr); int num = sql.ExecuteNonQuery("Proc_UserInfo", sqls); if (num > 0) { return(true); } else { return(false); } } catch (Exception ex) { LogQueue.Write(LogType.Error, "UserInfoDal/UpdateUserPwd", $"{ex.Message}"); return(false); } }
public JsonResult RedactCriticism(string userId, string entId, string orderNo, int id, string articleId, string content, decimal starLevel, int superiorId = 0, int replayId = 0) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } if (string.IsNullOrEmpty(articleId) && string.IsNullOrEmpty(orderNo)) { return(Json(new { success = false, message = "商品和订单编号不能为空" })); } else if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "请先登录!" })); } ///商品信息 GoodsInfoDal dal = new GoodsInfoDal(); int flag = dal.RedactCriticism(userId, entId, orderNo, id, articleId, content, starLevel, superiorId, replayId, out string message); return(Json(new { success = flag == 1 ? true : false, message })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Goods/RedactCriticism", ex.Message.ToString()); return(Json(new { success = false, message = "商品评价编辑失败!" })); } }
public JsonResult GetArticle(int channel_Id, string entId, string type) { if (channel_Id <= 0) { return(Json(new { success = false, message = "参数无效" })); } else { try { if (entId == null || entId == "") { entId = BaseConfiguration.EntId; } ArticleDal dal = new ArticleDal(); List <Article> list = dal.GetArticle(entId, channel_Id, type); return(Json(new { success = true, list = list })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Article/GetArticle", ex.Message); return(Json(new { success = false, message = "文章/咨询加载失败!" })); } } }
/// <summary> /// 更多回复 /// </summary> /// <param name="userId"></param> /// <param name="entId"></param> /// <param name="criticismsId"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public JsonResult MoreRepaly(string userId, string entId, int criticismsId, int pageIndex = 1, int pageSize = 30) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } if (criticismsId == 0) { return(Json(new { success = false, message = "参数获取异常!" })); } else if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "请先登录!" })); } ///商品信息 GoodsInfoDal dal = new GoodsInfoDal(); ///商品评价回复 List <StairCriticisms> list = dal.GetReplay(userId, entId, criticismsId, pageIndex, pageSize, out int pageCount, out int recordCount); return(Json(new { success = true, list, pageCount, recordCount })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Goods/MoreRepaly", ex.Message.ToString()); return(Json(new { success = false, message = "商品评价回复获取失败!" })); } }
/// <summary> /// 获取单位 /// </summary> /// <param name="userId"></param> /// <param name="entId"></param> /// <param name="strWhere"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="isjh"></param> /// <param name="isxs"></param> /// <returns></returns> public JsonResult GetBusiness(string userId, string entId, string strWhere, int pageIndex, int pageSize, string isjh, string isxs) { try { //获取数据 BusinessDal dal = new BusinessDal(); if (userId == "")//注册获取单位 { //所有单位列表 List <Business> businesses = dal.BusnessList(userId, entId, isjh, isxs, strWhere, pageIndex, pageSize, out int pageCount, out int recordCount); return(Json(new { success = true, list = businesses, pageCount = pageCount, recordCount = recordCount })); } else//代课下单获取单位 { //代课下单客户 List <Business> client = dal.ClientList(userId, entId, isjh, isxs, strWhere, pageIndex, pageSize, out int pageCount1, out int recordCount1); var objClient = new { list = client, pageCount = pageCount1, recordCount = recordCount1 }; //代课下单购物车有商品客户 List <Business> cartClient = dal.CartClientList(userId, entId, isjh, isxs, strWhere, pageIndex, pageSize, out int pageCount2, out int recordCount2); var objCartClient = new { list = cartClient, pageCount = pageCount2, recordCount = recordCount2 }; return(Json(new { success = true, client = objClient, cartClient = objCartClient })); } } catch (Exception ex) { LogQueue.Write(LogType.Error, "Business/GetBusinessDal", ex.Message); return(Json(new { success = false, message = "客户列表加载失败!" })); } }
public JsonResult SearchGoodsList(string userId, string entId, string searchValue, string letter, string tags, string isKc, string CategoryId, string Login_Id, int pageIndex, int pageSize) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } ///获取商品分类列表 /// ////获取当前商品分类 List <Category> clist = new List <Category>(); if (CategoryId != "") { ImgInfoDal idal = new ImgInfoDal(); clist = idal.GetCategory(CategoryId, entId); } ///商品信息 GoodsInfoDal dal = new GoodsInfoDal(); List <GoodsList> list = dal.GetGoodsList(userId, Server.UrlDecode(searchValue.Trim()), letter, tags, isKc, CategoryId, Login_Id, pageIndex, pageSize, entId); ///商品分类信息 return(Json(new { success = true, list, clist })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Search/SearchGoodsList", ex.Message.ToString()); return(Json(new { success = false, message = "商品列表加载失败!" })); } }
public JsonResult AppUpdateEdition() { try { SqlRun sql = new SqlRun(SqlRun.sqlstr); StringBuilder strsql = new StringBuilder(); strsql.Append(" select top 1 VersionNo,UpdateDescription,ForceUpdate,DownloadAddress,VersionName from Zzsk_AppUpdate order by UpdateTime desc"); DataTable data = sql.RunSqlDataTable(strsql.ToString()); if (data.Rows.Count != 1) { throw new Exception("系统后台未配置!请暂停自动更新!"); } string web_url = BaseConfiguration.SercerIp; return(Json(new { success = true, obj = new AppUpdate( decimal.Parse(data.Rows[0]["VersionNo"].ToString()), int.Parse(data.Rows[0]["ForceUpdate"].ToString()), data.Rows[0]["UpdateDescription"].ToString(), web_url + data.Rows[0]["DownloadAddress"].ToString(), data.Rows[0]["VersionName"].ToString() ) } )); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Img/AppUpdateEdition", ex.Message.ToString()); return(Json(new { success = false, message = "系统后台未配置!请暂停自动更新!" })); } }
/// <summary> /// 删除购物车商品 /// </summary> /// <param name="entId">企业Id</param> /// <param name="userId">用户id</param> /// <param name="dltType">删除类型(单条one/全部all)</param> /// <param name="cartId">购物车Id</param> /// <returns></returns> public JsonResult DeleteCartGoods(string entId, string userId, string dltType, string cartId, string cartType = "", string ywyId = "") { try { if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } if (dltType == "" || (dltType == "one" && cartId == "")) { return(Json(new { success = false, message = "必传参数不能为空" })); } CartDal dal = new CartDal(); bool flag = dal.DeleteCart(entId, userId, dltType, cartId, cartType, ywyId); if (flag) { return(Json(new { success = true, message = "操作成功" })); } else { return(Json(new { success = false, message = "E006" })); } } catch (Exception ex) { LogQueue.Write(LogType.Error, "Cart/DeleteCartGoods", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
public JsonResult GetImgInfo(int num, string imgType, string entId, string singular = "", string source = "PC") { if (imgType == "") { return(Json(new { success = false, message = "参数无效" })); } else { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } DAL.ImgInfoDal IDal = new DAL.ImgInfoDal(); List <ImgInfo> Imglist = IDal.GetImgInfo(num, imgType, entId, source, singular); return(Json(new { success = true, list = Imglist })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Img/GetImgInfo", ex.Message.ToString()); return(Json(new { success = false, message = "图片加载失败!" })); } } }
/// <summary> /// 购物车商品条目数 /// </summary> /// <param name="entId">企业</param> /// <param name="userId">用户</param> /// <param name="ywyId">业务员</param> /// <returns></returns> public ActionResult NumberOfItems(string entId, string userId, string ywyId = "") { try { if (string.IsNullOrEmpty(userId)) { return(Json(new { success = false, message = "用户未登录,请先登录" })); } ///获取用户信息 UserInfoDal dal = new UserInfoDal(); List <UserInfo> user = dal.GetUserInfo(userId, entId); if (user.Count <= 0) { return(Json(new { success = false, message = "用户未登录,请重新登录" })); } ///获取购物车信息 CartDal cdal = new CartDal(); int num = cdal.GetCartCount(entId, userId, ywyId); return(Json(new { success = true, message = "购物车商品条目数获取成功", num })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Cart/NumberOfItems", ex.Message.ToString()); return(Json(new { success = false, message = ex.Message.ToString() })); } }
public JsonResult GetCategory(int channel_Id, string entId) { if (channel_Id <= 0) { return(Json(new { success = false, message = "参数无效" })); } else { try { if (entId == null || entId == "") { entId = BaseConfiguration.EntId; } DAL.ImgInfoDal CDal = new DAL.ImgInfoDal(); List <Category> Clist = CDal.GetCategory(entId, channel_Id); return(Json(new { success = true, list = Clist })); } catch (Exception ex) { LogQueue.Write(LogType.Error, "Img/GetCategory", ex.Message.ToString()); return(Json(new { success = false, message = "导航/分类加载失败!" })); } } }
public JsonResult GetIndexAdvert(string entId) { try { if (string.IsNullOrEmpty(entId)) { entId = BaseConfiguration.EntId; } DAL.ImgInfoDal dal = new DAL.ImgInfoDal(); var model = dal.GetIndexAdvert(entId); if (model != null) { return(Json(new { success = true, list = model })); } else { return(Json(new { success = false, list = model })); } } catch (Exception ex) { LogQueue.Write(LogType.Error, "Home/GetWebConfig", ex.Message.ToString()); return(Json(new { success = false, message = "网站广告图获取失败!" })); } }
/// <summary> /// 商品点击/搜索统计 /// </summary> /// <returns></returns> public static bool GoodsStatistical(string category, string searchValue, string entId) { bool flag = false; try { SqlParameter[] param = new SqlParameter[] { new SqlParameter("@Type", "GoodsStatistical"), new SqlParameter("@SearchValue", searchValue), new SqlParameter("@Category", category), new SqlParameter("@Entid", entId), }; SqlRun sql = new SqlRun(SqlRun.sqlstr); if (sql.ExecuteNonQuery("Proc_Goods_Statistical", param) > 0) { flag = true; } } catch (Exception ex) { LogQueue.Write(LogType.Error, "StatisticalDal/GoodsStatistical", ex.Message.ToString()); throw ex; } return(flag); }