public string PaySelectSubmit() { ResultObj _result = new ResultObj(); long _syscode = FormString.LongIntSafeQ("syscode"); int _paytype = FormString.IntSafeQ("paytype"); int _systype = FormString.IntSafeQ("systype"); if (_systype == 0) { _systype = (int)SystemType.B2B; } OrderEntity order = OrderBLL.Instance.GetOrderByCode(_syscode); string payconfirm = ""; if (_paytype == (int)PayType.OutLine) { payconfirm = StringUtils.GetRandomString(12); } PayOrderEntity payen = PayOrderBLL.Instance.GetPayOrderBySysCode(_systype, _syscode.ToString(), _paytype); if (payen.Id > 0 && payen.Status == 1) { _result.Status = (int)CommonStatus.HasPayed; _result.Obj = payen; } else { payen = PayOrderBLL.Instance.CreatePayOrder(_systype, _syscode.ToString(), order.ActPrice, _paytype, memid, payconfirm); _result.Status = (int)CommonStatus.Success; _result.Obj = payen; } return(JsonJC.ObjectToJson(_result)); }
/// <summary> /// 确认收货 /// </summary> /// <returns></returns> public string OrderRecived() { ResultObj _result = new ResultObj(); long _code = FormString.LongIntSafeQ("code"); if (OrderBLL.Instance.OrderRecived(_code, memid) > 0) { //采购系统接口 if (CGOrderBLL.Instance.CGOrderRecived(_code) == 0) { LogUtil.Log("采购系统数据同步出错", "订单确认收货同步,订单号" + _code); } //优惠券发放 int num = MemCouponsBLL.Instance.ProvideCouponsByOrder(_code); if (num > 0) { OrderBLL.Instance.EditOrderCouponsNum(_code, num); } _result.Status = (int)CommonStatus.Success; _result.Obj = OrderBLL.Instance.GetVWOrderByCode(_code); } else { _result.Status = (int)CommonStatus.Fail; } return(JsonJC.ObjectToJson(_result)); }
public AdminLoginEntity GetLoginCookie() { try { AdminLoginEntity MemberCookie; HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[SysCookieName.SysUserCookieName]; if (cookie != null) { MemberCookie = JsonJC.JsonToObject <AdminLoginEntity>(CryptDES.DESDecrypt(cookie.Value)); if (MemberCookie == null) { return(null); } else if (MemberCookie.Member == null || string.IsNullOrEmpty(MemberCookie.Member.UserCode)) { cookie.Expires = DateTime.Now.AddDays(-1); System.Web.HttpContext.Current.Response.Cookies.Add(cookie); return(null); } else { return(MemberCookie); } } else { return(null); } } catch { return(null); } }
public string SelectCGMemPriceSubmit() { ResultObj result = new ResultObj(); string ordercode = FormString.SafeQ("ordercode"); string memprices = FormString.SafeQ("memprices", 8000); memprices = memprices.Trim('|'); InquiryOrderEntity order = InquiryOrderBLL.Instance.GetInquiryOrderByCode(ordercode); if (order.Status == (int)OrderInquiryStatusEnum.Quoting || order.Status == (int)OrderInquiryStatusEnum.WaitAccept || order.Status == (int)OrderInquiryStatusEnum.HasAccept) { int resultrowi = CGQuotedPriceBLL.Instance.InquirySelectQuote(ordercode, memprices); if (resultrowi > 0) { result.Status = (int)CommonStatus.Success; result.Obj = resultrowi; } else { result.Status = (int)CommonStatus.Fail; } } else { result.Status = (int)CommonStatus.OrderCanNotDo; } return(JsonJC.ObjectToJson(result)); }
/// <summary> /// 选择供应商 /// </summary> /// <returns></returns> public string SelectCGMemSubmit() { ResultObj result = new ResultObj(); string ordercode = FormString.SafeQ("ordercode"); int memid = FormString.IntSafeQ("memid"); InquiryOrderEntity order = InquiryOrderBLL.Instance.GetInquiryOrderByCode(ordercode); if (order.Status == (int)OrderInquiryStatusEnum.Quoting || order.Status == (int)OrderInquiryStatusEnum.WaitAccept || order.Status == (int)OrderInquiryStatusEnum.HasAccept) { int resultrowi = CGMemQuotedBLL.Instance.SelectInquiryOrderCGMem(ordercode, memid); if (resultrowi > 0) { result.Status = (int)CommonStatus.Success; result.Obj = resultrowi; } else { result.Status = (int)CommonStatus.Fail; } } else { result.Status = (int)CommonStatus.OrderCanNotDo; } return(JsonJC.ObjectToJson(result)); }
public string UserLogin() { ResultObj _result = new ResultObj(); _result.Status = (int)CommonStatus.Fail; string useraccount = StringUtils.SafeStr(Request.Form["useraccount"]); string password = StringUtils.SafeStr(Request.Form["password"]); string VerCode = StringUtils.SafeStr(FormString.SafeQ("verCode")); int autologin = FormString.IntSafeQ("autologin"); //if (VerCode.Length == 4) //{ // //string svercode = StringUtils.GetDbString(System.Web.HttpContext.Current.Session["verify_login"]); // HttpCookie cookie = Request.Cookies["verify_login"]; // string svercode = ""; // if (cookie != null) // { // svercode = CryptDES.DESDecrypt(cookie.Value); // } // if (svercode != "") // { // if (VerCode.ToLower() != svercode.ToLower()) // { // return "验证码输入错误"; // } // } //} MemberLoginEntity _loginmodel = new MemberLoginEntity(); _result = MemberLoginBLL.Instance.Login("", useraccount, password, (int)ClientTypeEnum.PC, IPAddress.IP); if (_result != null && _result.Obj != null) { _loginmodel = (MemberLoginEntity)_result.Obj; try { if (_result.Status == (int)CommonStatus.Success) { if (_loginmodel.Status == (int)MemberStatus.WaitCheck) { CookieBLL.SetRegisterCookie(_loginmodel.MemId); } else { CookieBLL.SetLoginCookie(_loginmodel, autologin == 1); CookieBLL.ComBineCart(1); CookieBLL.ComBineCartXuQiu(1); } } } catch (Exception ex) { LogUtil.Log(ex); _result.Status = (int)CommonStatus.ServerError; } } return(JsonJC.ObjectToJson(_result)); }
public string SaveLicense() { ResultObj _loginentity = new ResultObj(); int memid = CookieBLL.GetRegisterCookie(); string path = FormString.SafeQ("licensepath"); if (memid > 0) { MemberEntity _mem = new MemberEntity(); _mem = MemberBLL.Instance.GetMember(memid); if (_mem != null && _mem.Status == (int)MemberStatus.WaitCheck) { MemberBLL.Instance.RegisterCompanyLicense(memid, path); _loginentity.Status = (int)CommonStatus.Success; } else { _loginentity.Status = (int)CommonStatus.Fail; } } else { _loginentity.Status = (int)CommonStatus.Fail; } return(JsonJC.ObjectToJson(_loginentity)); }
public static void SetLoginCookie(SuperMarket.Model.Account.MemberLoginEntity member, bool autologin = false) { System.Web.HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies[SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.MemberCookieName]; if (cookie == null) { cookie = new HttpCookie(SuperMarket.Core.ConfigCore.Instance.ConfigCommonEntity.MemberCookieName); } if (!string.IsNullOrEmpty(ConfigCore.Instance.ConfigCommonEntity.CookieDomain)) { cookie.Domain = ConfigCore.Instance.ConfigCommonEntity.CookieDomain; } cookie.Value = CryptDES.DESEncrypt(JsonJC.ObjectToJson(member)); if (autologin) { cookie.Expires = DateTime.Now.AddDays(30); } System.Web.HttpContext.Current.Response.Cookies.Add(cookie); //if (member != null && member.MemId > 0) //{ // System.Web.HttpContext.Current.Response.Cookies[SysCookieName.DefaultLoginId].Value = member.MemId.ToString(); // System.Web.HttpContext.Current.Response.Cookies[SysCookieName.DefaultLoginId].Expires = DateTime.Now.AddDays(30); // System.Web.HttpContext.Current.Response.Cookies[SysCookieName.DefaultCusName].Value = (member == null || string.IsNullOrEmpty(member.NickName)) ? member.MemCode : member.NickName; // System.Web.HttpContext.Current.Response.Cookies[SysCookieName.DefaultCusName].Expires = DateTime.Now.AddDays(30); //} }
public string GetSearchJsonList() { ListObj result = new ListObj(); int classid = QueryString.IntSafeQ("cl"); int brandid = QueryString.IntSafeQ("bd"); int siteid = QueryString.IntSafeQ("s"); int pageindex = QueryString.IntSafeQ("pi"); int jishi = QueryString.IntSafeQ("js", -1); if (jishi == -1) { jishi = (int)JiShiSongEnum.Normal; } if (pageindex < 1) { pageindex = 1; } int pagesize = CommonKey.PageSizeList; string querykey = QueryString.SafeQ("key"); string liststr = JsonJC.ObjectToJson(result); return(liststr); }
public string InquiryOrderListJeson() { ListObj result = new ListObj(); int _status = FormString.IntSafeQ("s", -1); int pagesize = CommonKey.PageSizeCGOrderMobile; int pageindex = FormString.IntSafeQ("px"); if (pageindex == 0) { pageindex = 1; } string key = FormString.SafeQ("k"); if (pageindex == 0) { pageindex = 1; } int record = 0; IList <VWInquiryOrderEntity> list = InquiryOrderBLL.Instance.GetInquiryOrderList(pagesize, pageindex, ref record, memid, _status, -1, key); result.Total = record; result.List = list; ViewBag.Status = _status; return(JsonJC.ObjectToJson(result)); }
/// <summary> /// 用户选择产品 /// </summary> /// <returns></returns> public string OrderProductSelect() { ResultObj result = new ResultObj(); string _ordercode = FormString.SafeQ("code"); string _producselect = FormString.SafeQ("producselect"); VWInquiryOrderEntity order = InquiryOrderBLL.Instance.GetVWInquiryOrderByCode(_ordercode); if (order != null && (order.Status == (int)OrderInquiryStatusEnum.WaitAccept) && order.MemId == memid) { Random rd = new Random(); string confirmcode = XTCodeBLL.Instance.GetCodeFromProc(XTCodeType.OrderDayNo) + rd.Next(100, 999).ToString(); int resulrow = CGQuotedPriceBLL.Instance.UserSelectQuote(_ordercode, confirmcode, _producselect); if (resulrow > 0) { result.Status = (int)CommonStatus.Success; result.Obj = confirmcode; return(JsonJC.ObjectToJson(result)); } } else { result.Status = (int)CommonStatus.Fail; result.Obj = _ordercode; } result.Status = (int)CommonStatus.Fail; result.Obj = _ordercode; return(JsonJC.ObjectToJson(result)); }
//public string GetWeiXinAccessToken() //{ // return WeiXinBLL.GetWeiXinAccessToken(); //} //public string GetWeiXinJsticket() //{ // return WeiXinBLL.GetWeiXinJsticket(); //} //public string GetWeiXinGetSignature() //{ // string ticket = FormString.SafeQ("ticket", 200); // string noncestr = FormString.SafeQ("noncestr", 200); // long times = FormString.LongIntSafeQ("timestamp"); // string url = FormString.SafeQ("url",200 ); // return WeiXinBLL.GetSignature(ticket, noncestr, times, url); //} //public string GetWeiXinAPPId() //{ // return WeiXinBLL.APPId; //} #endregion #region 询价 public string GetXunJiaMsg() { ResultObj result = new ResultObj(); int _pdid = FormString.IntSafeQ("pdid"); MemberLoginEntity member = CookieBLL.GetLoginCookie(); if (member != null && member.MemId > 0) { VWXunJiaObj _obj = new VWXunJiaObj(); VWProductEntity vwp = ProductBLL.Instance.GetProVWByDetailId(_pdid); VWProductNomalParamEntity vwpa = ProductExtBLL.Instance.GetProductNormalParamById(vwp.ProductId); MemStoreEntity store = StoreBLL.Instance.GetStoreByMemId(member.MemId); _obj.Product = vwp; _obj.ProductExt = vwpa; _obj.MobilePhone = store.MobilePhone; _obj.MemId = store.MemId; result.Status = (int)CommonStatus.Success; result.Obj = _obj; } else { result.Status = (int)CommonStatus.NeedLogin; } string liststr = JsonJC.ObjectToJson(result); return(liststr); }
public string SaveBasicMsg() { ResultObj _loginentity = new ResultObj(); int memid = CookieBLL.GetRegisterCookie(); string mobile = FormString.SafeQ("mobile"); string nikename = FormString.SafeQ("nikename"); if (memid > 0) { VWMemberEntity _mem = new VWMemberEntity(); _mem.MemId = memid; _mem.MemNikeName = nikename; int rei = MemberBLL.Instance.BasicMsgUpdate(_mem); if (rei > 0) { _loginentity.Status = (int)CommonStatus.Success; } else { _loginentity.Status = (int)CommonStatus.Fail; } } else { _loginentity.Status = (int)CommonStatus.Fail; } return(JsonJC.ObjectToJson(_loginentity)); }
/// <summary> /// 选择供应的产品,新版选择供应商 /// </summary> /// <returns></returns> public string SelCGMemForConfirm() { ResultObj result = new ResultObj(); string ordercode = FormString.SafeQ("ordercode"); string memprices = FormString.SafeQ("memprices", 8000); ConfirmOrderEntity order = ConfirmOrderBLL.Instance.GetConfirmOrderByCode(ordercode); if (order.Status == (int)OrderConfirmStatusEnum.WaitSelectCGMem) { int resultrowi = CGMemQuotedBLL.Instance.SelConfirmOrderCGMem(order.InquiryOrderCode, ordercode, memprices); if (resultrowi > 0) { //选择后直接到支付(暂时省),通知送货员或调用物流接口 WeiXinInQuiryOrderBLL.Instance.NoteToDeliveryman(ordercode); ////通知供应商备货 WeiXinInQuiryOrderBLL.Instance.CGMemStockNote(ordercode); result.Status = (int)CommonStatus.Success; result.Obj = resultrowi; } else { result.Status = (int)CommonStatus.Fail; } } else { result.Status = (int)CommonStatus.OrderCanNotDo; } return(JsonJC.ObjectToJson(result)); }
public string AddToLineConfirm() { ResultObj result = new ResultObj(); long _ordercode = FormString.LongIntSafeQ("ordercode"); if (OrderPayLineConfirmBLL.Instance.IsExist(_ordercode, (int)PayLineConfirm.Default)) { result.Status = (int)CommonStatus.HasAddToLineConfirm; } else { OrderPayLineConfirmEntity confirmentity = new OrderPayLineConfirmEntity(); confirmentity.OrderCode = _ordercode; confirmentity.Reason = "待付款订单线下确认"; confirmentity.CreateManId = memid; confirmentity.Status = (int)PayLineConfirm.Default; if (OrderPayLineConfirmBLL.Instance.AddOrderPayLineConfirm(confirmentity) > 0) { result.Status = (int)CommonStatus.Success; } else { result.Status = (int)CommonStatus.Fail; } } return(JsonJC.ObjectToJson(result)); }
public string Reg3Submit() { ResultObj _obj = new ResultObj(); string stamp = FormString.SafeQ("stamp"); int memid = FormString.IntSafeQ("memid"); string path = FormString.SafeQ("licensepath"); MemberEntity mem = MemberBLL.Instance.GetMemByMethod(memid.ToString(), LoginMethodEnum.MemId); if (mem != null && mem.Id > 0 && mem.Status == (int)MemberStatus.Register2 && mem.TimeStampTab == stamp) { if (MemberBLL.Instance.RegisterCompanyLicense(memid, path) > 0) { _obj.Status = (int)CommonStatus.Success; _obj.Obj = MemberBLL.Instance.GetMember(memid); return(JsonJC.ObjectToJson(_obj)); } _obj.Status = (int)CommonStatus.Fail; return(JsonJC.ObjectToJson(_obj)); } else { _obj.Status = (int)CommonStatus.RegisterNoModify; return(JsonJC.ObjectToJson(_obj)); } }
///// <summary> ///// 找回密码 ///// </summary> ///// <returns></returns> //public ActionResult FindPwd() //{ // return View(); //} /// <summary> /// 确认个人信息,忘记密码 /// </summary> /// <returns></returns> public string ConfirmPersonalInfo() { ResultObj result = new ResultObj(); string _mobile = FormString.SafeQ("mobile"); string _vCode = FormString.SafeQ("vCode"); if (System.Web.HttpContext.Current.Session[CommonKey.MobileNo] != null && System.Web.HttpContext.Current.Session[CommonKey.MobileNo].ToString() == _mobile && System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode] != null && System.Web.HttpContext.Current.Session[CommonKey.MobileYZCode].ToString() == _vCode) { MemberEntity _entity = MemberBLL.Instance.GetMemByMobile(_mobile); if (_entity.Id > 0) { if (MemberBLL.Instance.UpdateMember(_entity) > 0) { MemberEntity _upbehinden = MemberBLL.Instance.GetMember(_entity.Id); System.Web.HttpContext.Current.Session.Add(CommonKey.FindPwdID, _entity.Id); result.Status = (int)CommonStatus.Success; result.Obj = _upbehinden.TimeStampTab; } else { result.Status = (int)CommonStatus.Fail; } } else { result.Status = (int)CommonStatus.PhoneNotExist; } } else { result.Status = (int)CommonStatus.VerCodeIsError; } return(JsonJC.ObjectToJson(result)); }
public string GetStyleIdByProperties() { Hashtable _hashresult = new Hashtable(); int _productid = QueryString.IntSafeQ("p"); int _pageindex = QueryString.IntSafeQ("pi"); if (_pageindex == 0) { _pageindex = 1; } int pagesize = CommonKey.PageSizeCommentShow; int _record = 0; IList <SuperMarket.Model.CommentEntity> _list = CommentBLL.Instance.GetCommentListByProductId(pagesize, 1, ref _record, _productid); var listfilter = _list.Select( p => new { Days = ((TimeSpan)(p.CreateTime - p.OrderDate)).Days, CreateTime = p.CreateTime, Title = p.ProductName, CommentContent = p.CommentContent, PicUrlContent = p.PicUrlContent, MemCode = p.MemCode, MemLevelName = p.MemLevelName, }); _hashresult.Add("ListObj", listfilter); _hashresult.Add("PageStr", SuperMarket.Core.HTMLPage.GetDiscusssListDivPage(_record, SuperMarket.Model.CommonKey.PageSizeCommentShow, _pageindex, "/DisCuss/GetStyleIdByProperties?p" + _productid)); string liststr = JsonJC.ObjectToJson(_hashresult); return(liststr); }
public string CreateInquiry() { ResultObj result = new ResultObj(); int _pdid = FormString.IntSafeQ("pdid"); string memphone = FormString.SafeQ("memphone"); string remark = FormString.SafeQ("remark", 500); InquiryRecordsEntity inquiry = new InquiryRecordsEntity(); inquiry.MobilePhone = memphone; inquiry.Remark = remark; inquiry.ProductDetailId = _pdid; inquiry.CreatTime = DateTime.Now; inquiry.Status = (int)InquiryStatus.WaitDeal; int inid = InquiryRecordsBLL.Instance.AddInquiryRecords(inquiry); if (inid > 0) { result.Status = (int)CommonStatus.Success; result.Obj = inid; } else { result.Status = (int)CommonStatus.Fail; } string liststr = JsonJC.ObjectToJson(result); return(liststr); }
public string GetProductSList() { ListObj result = new ListObj(); int sid = QueryString.IntSafeQ("sid"); int pageindex = QueryString.IntSafeQ("pageindex"); int pagesize = CommonKey.PageSizeProductMobile; int isactive = 1; int recordcount = 0; IList <VWProductSpecialDetailsEntity> sdlist = ProductSpecialDetailsBLL.Instance.GetProductSpecialDetailsList(pageindex, pagesize, ref recordcount, sid, isactive); MemberLoginEntity member = CookieBLL.GetLoginCookie(); if (member != null && member.MemId > 0) { ViewBag.MemId = member.MemId; ViewBag.MemStatus = member.Status; if (sdlist != null && sdlist.Count > 0) { foreach (VWProductSpecialDetailsEntity entity in sdlist) { if (entity.ProductDetail != null && entity.ProductDetail.ProductId > 0) { entity.Price = Calculate.GetPrice(member.Status, member.IsStore, member.StoreType, member.MemGrade, entity.ProductDetail.TradePrice, entity.ProductDetail.Price, entity.ProductDetail.IsBP, entity.ProductDetail.DealerPrice); } } } } result.Total = recordcount; result.List = sdlist; string liststr = JsonJC.ObjectToJson(result); return(liststr); }
public string GetNextStore() { int _preid = FormString.IntSafeQ("preid"); VWShowStoreEntity list = StoreBLL.Instance.GetNextStore(_preid); string liststr = JsonJC.ObjectToJson(list); return(liststr); }
/// <summary> /// 获取产品信息 /// </summary> /// <returns></returns> public string GetProductDetails() { int _productid = FormString.IntSafeQ("productid"); VWProductStyleEntity _entity = ProductStyleBLL.Instance.GetProduct(_productid); string liststr = JsonJC.ObjectToJson(_entity); return(liststr); }
/// <summary> /// 获取CMS模板 /// </summary> /// <returns></returns> public string GetCmsTemplet() { int _cmstempletid = FormString.IntSafeQ("cmstempletid"); CmsTempletEntity entity = CmsTempletBLL.Instance.GetCmsTemplet(_cmstempletid); string str = JsonJC.ObjectToJson(entity); return(str); }
/// <summary> /// 获取CMS模板标题 /// </summary> /// <returns></returns> public string GetCmsTempletTitles() { int _cmstype = FormString.IntSafeQ("cmstype"); IList <CmsTempletEntity> _entitylist = CmsTempletBLL.Instance.GetCmsTempletListByType(_cmstype); string liststr = JsonJC.ObjectToJson(_entitylist); return(liststr); }
public string GetSpecsShowByStyle() { int _styleid = FormString.IntSafeQ("styleid"); //IList<VWBasicSitePropertiesEntity> _list = BasicSitePropertiesBLL.Instance.GetSpecsByClass(_styleid, _pid); IList <VWBasicSitePropertiesEntity> _list = null;// ProductStyleProBLL.Instance.GetSpecsByStyle(_styleid); string liststr = JsonJC.ObjectToJson(_list); return(liststr); }
/// <summary> /// 获取帮助表的列表 /// </summary> /// <returns></returns> public string GetClassLevelList() { int _parentid = FormString.IntSafeQ("parentid", 0); IList <IssueClassEntity> entitylist = IssueClassBLL.Instance.GetIssueClassByParentId(_parentid); var listfilter = entitylist.Select(s => new { Id = s.Id, Name = s.ClassName }).ToList(); string liststr = JsonJC.ObjectToJson(listfilter); return(liststr); }
/// <summary> /// 获取品牌列表(模糊查询) /// </summary> /// <returns></returns> public string GetBrandListByBrand() { string _brand = FormString.SafeQ("brand"); IList <BrandEntity> entitylist = BrandBLL.Instance.GetBrandListByBrand(_brand); var listfilter = entitylist.Select(s => new { Id = s.Id, Name = s.Name }).ToList(); string liststr = JsonJC.ObjectToJson(listfilter); return(liststr); }
public string GetDicProductSubDetail() { int _producttypeid = FormString.IntSafeQ("producttypeid"); IList <DicInquiryOrderEntity> list = new List <DicInquiryOrderEntity>(); list = DicInquiryOrderBLL.Instance.GetDicFromCode(_producttypeid.ToString(), InquiryDicMenuCode.InquiryProductTypeEnum, false); string liststr = JsonJC.ObjectToJson(list); return(liststr); }
/// <summary> /// 获取产品详情 /// </summary> /// <returns></returns> public string GetContentCmsByStyleId() { int _styleId = FormString.IntSafeQ("styleId"); ProductStyleExtEntity _entity = new ProductStyleExtEntity(); _entity = ProductStyleExtBLL.Instance.GetStyleExtByStyleId(_styleId); string liststr = JsonJC.ObjectToJson(_entity); return(liststr); }
///<summary> /// 根据styleid获取图片路径列表 /// <summary> /// <returns></returns> public string GetStylePicsById() { int _styleid = FormString.IntSafeQ("styleid"); IList <ProductStylePicsEntity> list = new List <ProductStylePicsEntity>(); list = ProductStylePicsBLL.Instance.GetListByStyleId(_styleid); string liststr = JsonJC.ObjectToJson(list); return(liststr); }