Ejemplo n.º 1
0
        /// <summary>
        /// 这个方法在couponWriteOff.js已经不用,Sun@2015-11-03标注
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        public string GetCardVip(string pRequest)
        {
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var vipBLL             = new VipBLL(loggingSessionInfo);

            var rd = new GetCardVipRD();
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetCardVipRP> >();

            rp.Parameters.Validate();

            var ds = vipBLL.GetCardVip(rp.Parameters.Criterion, rp.Parameters.CouponCode, rp.Parameters.PageSize, rp.Parameters.PageIndex);

            if (ds.Tables.Count == 2)
            {
                var vipList = (from d in ds.Tables[0].AsEnumerable()
                               select new BS.Entity.VipEntity()
                {
                    VIPID = d["VIPID"].ToString(),
                    VipCode = d["VipCode"].ToString(),
                    VipRealName = d["VipRealName"].ToString(),
                    VipName = d["VipName"].ToString(),
                    Phone = d["Phone"].ToString(),
                    Col2 = d["Col2"].ToString(),
                    Col4 = d["EndAmount"].ToString()
                }).ToList();

                rd.VipList    = vipList.ToArray();
                rd.TotalPage  = int.Parse(ds.Tables[1].Rows[0][0].ToString());
                rd.TotalCount = int.Parse(ds.Tables[1].Rows[0][1].ToString());
            }

            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取优惠券
            var couponBll    = new CouponBLL(loggingSessionInfo);             //优惠券BLL实例化
            var couponEntity = couponBll.QueryByEntity(new CouponEntity()
            {
                CouponCode = rp.Parameters.CouponCode
            }, null);

            if (couponEntity == null || couponEntity.Length == 0)
            {
                rsp.ResultCode = 103;
                rsp.Message    = "优惠券无效";
                return(rsp.ToJSON());
            }
            if (couponEntity[0].Status == 1)
            {
                rsp.ResultCode = 103;
                rsp.Message    = "优惠券已核销";
                return(rsp.ToJSON());
            }

            return(rsp.ToJSON());
        }
        /// <summary>
        /// 修改提现密码
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        public string SetWithdrawalPwd(string pRequest)
        {
            var rsp = new SuccessResponse <IAPIResponseData>();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rp                    = pRequest.DeserializeJSONTo <APIRequest <SetWithdrawalPwdRP> >();
            var customerId            = loggingSessionInfo.ClientID;
            var Oldpwd                = rp.Parameters.OldWithdrawalPassword; //提现密码
            var NewPwd                = rp.Parameters.NewWithdrawalPassword; //新密码
            var rd                    = new SetWithdrawalPwdRD();
            var bll                   = new CustomerBackBLL(loggingSessionInfo);
            CustomerBackEntity entity = new CustomerBackEntity();

            entity.CustomerId         = customerId; //客户ID
            entity.BackStatus         = 1;          //账户状态
            entity.WithdrawalPassword = rp.Parameters.OldWithdrawalPassword;
            var ds = bll.QueryByEntity(entity, null);

            if (ds.Length > 0)
            {
                entity = (CustomerBackEntity)ds[0];
                string strPwd = string.Empty; //密码
                if (ds.Length > 0 && ds != null)
                {
                    strPwd = ds.FirstOrDefault().WithdrawalPassword;
                    if (!string.IsNullOrWhiteSpace(strPwd) && strPwd == Oldpwd)  //当数据库中存的密码和输入的密码一样,更新密码
                    {
                        entity.WithdrawalPassword = NewPwd;
                        entity.MD5Pwd             = NewPwd.Trim() + MD5Helper.Encryption(customerId.ToString()).Trim();
                        entity.CustomerBackId     = Guid.Parse(ds.FirstOrDefault().CustomerBackId.ToString());
                        bll.Update(entity);//更新密码
                        rsp.ResultCode = 0;
                        rsp.Message    = "OK";
                        return(rsp.ToJSON());
                    }
                }
            }
            else
            {
                rsp.ResultCode = 301;
                rsp.Message    = "提现密码输入错误!请重新输入";
                return(rsp.ToJSON());

                throw new APIException("提现密码输入错误!")
                      {
                          ErrorCode = 301
                      };
            }
            return(rsp.ToJSON());
        }
Ejemplo n.º 3
0
        private string ImportEnrollData(string pRequest)
        {
            HttpFileCollection files        = HttpContext.Current.Request.Files;
            string             errorMessage = "";
            //1. 保存上传的文件
            //string fileName = Utils.SaveUploadAttachment(files, PrivateLoggingSessionInfo.ClientID, PrivateLoggingSessionInfo.UserID, out errorMessage);
            string fileName = Utils.SaveUploadAttachment(files, "PrivateLoggingSessionInfo.ClientID", "PrivateLoggingSessionInfo.UserID", out errorMessage);

            var rp = pRequest.DeserializeJSONTo <APIRequest <JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRP> >();

            rp.Parameters.Validate();

            var    rd = new JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRD();
            int    total = 0, add = 0, update = 0;
            string result = PrivateLEventSignUpBLL.ImportEnrollData(fileName, rp.Parameters, out total, out add, out update);

            var rsp = new SuccessResponse <JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRD>(rd);

            if (!string.IsNullOrEmpty(result))
            {
                rsp.ResultCode  = 201;
                rsp.Message     = result;
                rsp.Data.Total  = total;
                rsp.Data.Add    = add;
                rsp.Data.Update = update;
            }

            return(rsp.ToJSON());
        }
Ejemplo n.º 4
0
        private string DownEnrollTpl(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRP> >();

            rp.Parameters.Validate();

            var       rd        = new EmptyRD(); // new JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRD();
            DataTable dataTable = PrivateLEventSignUpBLL.DownEnrollTpl(rp.Parameters.EventID, rp.Parameters.Status);

            //数据获取
            Workbook wb       = DataTableExporter.WriteXLS(dataTable, 0);
            string   savePath = HttpContext.Current.Server.MapPath(@"~/File/Excel");

            if (!System.IO.Directory.Exists(savePath))
            {
                System.IO.Directory.CreateDirectory(savePath);
            }
            savePath = savePath + "\\报名人员模板-" + dataTable.TableName + ".xls";
            wb.Save(savePath);//保存Excel文件
            new ExcelCommon().OutPutExcel(HttpContext.Current, savePath);
            HttpContext.Current.Response.End();

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            if (dataTable == null || !(dataTable.Columns.Count > 0))
            {
                rsp.ResultCode = 201;
                rsp.Message    = "生成失败!";
            }

            return(rsp.ToJSON());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 销售(服务)订单
        /// </summary>
        public string GetMenusByPMenuCode(string pRequest)
        {
            var    rp         = pRequest.DeserializeJSONTo <APIRequest <GetMenusByPMenuCodeRP> >();//不需要参数
            string userId     = rp.UserID;
            string customerId = rp.CustomerID;

            var menu_code = rp.Parameters.menu_code;

            var           loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            AppSysService appSysService      = new AppSysService(loggingSessionInfo);
            string        errMsg             = "";
            MenuModel     Menu = appSysService.GetRoleMenusByPMenuCode(loggingSessionInfo,
                                                                       loggingSessionInfo.CurrentUserRole.RoleId, menu_code, out errMsg);//根据当前用户的角色,来取他拥有的页面

            if (errMsg != "")
            {
                throw new APIException("errMsg:" + errMsg)
                      {
                          ErrorCode = 135
                      };
            }
            var rd = new GetMenusByPMenuCodeRD();

            rd.currentMenu = Menu;
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据CustomerId获取成为经销商条件
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        private string GetVipMultiLevelSalerConfig(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <EmptyRequestParameter> >();

            if (string.IsNullOrEmpty(rp.UserID))
            {
                throw new APIException("缺少参数【UserID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }
            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");
            var RetailTraderBLL    = new RetailTraderBLL(loggingSessionInfo);
            var ds = RetailTraderBLL.GetVMultiLevelSalerConfigByCId(rp.CustomerID);

            var rd = new VipMultiLevelSalerConfigRP();

            rd.config = new VipMultiLevelSalerConfigEntity();
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                rd.config.Id            = ds.Tables[0].Rows[0]["Id"].ToString();
                rd.config.MustBuyAmount = ds.Tables[0].Rows[0]["MustBuyAmount"].ToString();
                rd.config.Agreement     = ds.Tables[0].Rows[0]["Agreement"].ToString();
                rd.config.CustomerId    = ds.Tables[0].Rows[0]["CustomerId"].ToString();
            }
            var rsp = new SuccessResponse <VipMultiLevelSalerConfigRP>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 7
0
        //修改分销商密码
        private string RetailSetPassWord(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <RetailSetPassWordRP> >();
            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);

            string pNewPass = MD5Helper.Encryption(rp.Parameters.pNewPWD);

            //pOldPWD = MD5Helper.Encryption(pOldPWD);
            rp.Parameters.pOldPWD = EncryptManager.Hash(rp.Parameters.pOldPWD, HashProviderType.MD5);

            //组装参数
            var rd         = new RetailSetPassWordRD();
            var rsp        = new SuccessResponse <IAPIResponseData>(rd);
            var serviceBll = new RetailTraderBLL(loggingSessionInfo);
            var entity     = serviceBll.GetByID(rp.Parameters.pID);//获取分销商实体

            //if (pOldPWD == entity.User_Password)
            if (rp.Parameters.pOldPWD == entity.RetailTraderPass)
            {
                entity.RetailTraderPass = pNewPass;
                entity.LastUpdateBy     = "1";
                entity.LastUpdateTime   = DateTime.Now;
                //new cUserService(CurrentUserInfo).SetUserInfo(entity, entity.userRoleInfoList, out error);
                serviceBll.Update(entity);
                rsp.Message = "";
            }
            else
            {
                rsp.ResultCode = 135;
                rsp.Message    = "旧密码不正确";
            }
            return(rsp.ToJSON());
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 删除
        /// </summary>
        public string DeleteInnerGroupNews(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <DeleteInnerGroupNewsRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new DeleteInnerGroupNewsRD();//返回值

            var TypeId = rp.Parameters.GroupNewsId;

            if (string.IsNullOrEmpty(TypeId))
            {
                throw new APIException("缺少参数【GroupNewsId】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }
            InnerGroupNewsBLL _InnerGroupNewsBLL = new InnerGroupNewsBLL(loggingSessionInfo);

            //     TagsTypeEntity TagsTypeEn = TagsTypeBLL.GetByID(TypeId);

            //虚拟删除标签类型和下面的标签
            _InnerGroupNewsBLL.DeleteInnerGroupNews(rp.Parameters.GroupNewsId);
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 9
0
        public string GetCard(string pRequest)
        {
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var cardDepositBLL     = new CardDepositBLL(loggingSessionInfo);

            var rd = new GetCardRD();
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetCardRP> >();

            rp.Parameters.Validate();

            var ds = cardDepositBLL.PagedSearch(rp.Parameters, loggingSessionInfo.ClientID);

            if (ds.Tables.Count == 2)
            {
                var cardInfoList = (from d in ds.Tables[0].AsEnumerable()
                                    select new BLL.Card()
                {
                    CardID = d["CardDepositId"].ToString(),
                    CardNo = d["CardNo"].ToString(),
                    ChannelTitle = d["ChannelTitle"].ToString(),
                    Amount = decimal.Parse(d["Amount"].ToString()),
                    Bonus = decimal.Parse(d["Bonus"].ToString()),
                    CardStatus = int.Parse(d["CardStatus"].ToString()),
                    UseStatus = int.Parse(d["UseStatus"].ToString())
                });

                rd.CardList   = cardInfoList.ToArray();
                rd.TotalPage  = int.Parse(ds.Tables[1].Rows[0][0].ToString());
                rd.TotalCount = int.Parse(ds.Tables[1].Rows[0][1].ToString());
            }

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 10
0
        public string CategorySort(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <CategorySortRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new SaveSkuRD();//返回值


            var service = new ItemCategoryService(loggingSessionInfo);//保存到商品分类表

            //  var skuPropServer = new SkuPropServer(loggingSessionInfo);//保存到T_Sku_Property

            if (rp.Parameters.CategoryList == null)
            {
                throw new APIException("缺少参数【CategoryList】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }


            foreach (var item in rp.Parameters.CategoryList)
            {
                service.SetItemCategoryDisplayIndex(loggingSessionInfo, item.Item_Category_Id, item.DisplayIndex == null ? 0 : (int)item.DisplayIndex);
            }



            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
        /// <summary>
        /// 提现确认/完成操作
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        public string UpdateWDApply(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <UpdateWDApplyRP> >();
            //var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var vipWDApplyBll      = new VipWithdrawDepositApplyBLL(loggingSessionInfo); //提现申请BLL实例化

            string[] applyIdArray = rp.Parameters.ApplyID.Split(',');
            if (applyIdArray.Length > 0)
            {
                foreach (var applyId in applyIdArray)
                {
                    var vipWDApplyEntity = vipWDApplyBll.GetByID(applyId);     //获取提现申请对象
                    if (vipWDApplyEntity != null)
                    {
                        switch (rp.Parameters.Status)
                        {
                        case 1:    //已确认
                            vipWDApplyEntity.Status      = 1;
                            vipWDApplyEntity.ConfirmDate = DateTime.Now;
                            break;

                        case 2:    //已完成
                            vipWDApplyEntity.Status       = 2;
                            vipWDApplyEntity.CompleteDate = DateTime.Now;
                            break;
                        }
                        vipWDApplyBll.Update(vipWDApplyEntity); //修改
                    }
                }
            }
            var rsp = new SuccessResponse <IAPIResponseData>();

            return(rsp.ToJSON());
        }
Ejemplo n.º 12
0
        public string ToggleRetailStatus(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <ToggleRetailStatusRP> >();

            if (string.IsNullOrEmpty(rp.Parameters.RetailTraderID))
            {
                throw new APIException("缺少参数【RetailTraderID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }
            if (string.IsNullOrEmpty(rp.Parameters.Status))
            {
                throw new APIException("缺少参数【Status】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var bll = new RetailTraderBLL(loggingSessionInfo);

            RetailTraderEntity en = new RetailTraderEntity();

            en.RetailTraderID = rp.Parameters.RetailTraderID;
            en.Status         = rp.Parameters.Status;
            bll.Update(en, null, false);

            var rd  = new EmptyRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);


            return(rsp.ToJSON());
        }
Ejemplo n.º 13
0
        public string SaveRetailTraderItemMapping(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <RetailTraderItemMappingRP> >();

            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
            var bll = new RetailTraderItemMappingBLL(loggingSessionInfo);
            var rd  = new EmptyRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            var itemService  = new ItemService(loggingSessionInfo);
            var bllTrader    = new RetailTraderBLL(loggingSessionInfo);
            var entityTrader = bllTrader.GetByID(rp.Parameters.RetailTraderId);

            entityTrader.SalesType = "Sales";
            bllTrader.Update(entityTrader, null, false);


            bll.DeleteData(rp.Parameters.RetailTraderId);
            if (rp.Parameters.ItemList.Count() > 0)
            {
                foreach (var item in rp.Parameters.ItemList)
                {
                    RetailTraderItemMappingEntity entityRTIM = new RetailTraderItemMappingEntity();
                    entityRTIM.ItemId         = item.ItemId;
                    entityRTIM.RetailTraderId = rp.Parameters.RetailTraderId;
                    entityRTIM.CustomerID     = rp.CustomerID;
                    bll.Create(entityRTIM);
                    itemService.CreateTraderQRCode(rp.CustomerID, item.ItemId, item.ItemName, rp.Parameters.RetailTraderId, entityRTIM.MappingId.ToString());
                }
            }
            return(rsp.ToJSON());
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 增加下载记录
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        private string AddVersionDownLoadLog(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <AppVersionDownloadLogRP> >();
            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");

            if (rp.Parameters.Channel == 0 || string.IsNullOrEmpty(rp.CustomerID +  rp.Parameters.Plat + rp.Parameters.Version + rp.Parameters.DownloadURL))
            {
                throw new APIException("缺少请求参数。")
                      {
                          ErrorCode = ERROR_CODES.INVALID_REQUEST_LACK_REQUEST_PARAMETER
                      }
            }
            ;
            var appVersionLogBLL = new APPVersionDownloadVIPLogBLL(loggingSessionInfo);
            var entity           = new APPVersionDownloadVIPLogEntity
            {
                Channel     = rp.Parameters.Channel,
                Plat        = rp.Parameters.Plat, Version = rp.Parameters.Version,
                DownloadUrl = rp.Parameters.DownloadURL, CustomerId = rp.CustomerID,
                VipId       = rp.Parameters.VipId
            };

            try
            {
                appVersionLogBLL.AddAppVersionDownloadLog(entity);
                var result = new EmptyResponseData();
                var rsp    = new  SuccessResponse <IAPIResponseData>(result);
                return(rsp.ToJSON());
            }
            catch (APIException ex)
            {
                throw new APIException("添加过程中出错.");
            }
        }
Ejemplo n.º 15
0
 /// <summary>
 /// 获取我的卡包
 /// </summary>
 /// <param name="pRequest"></param>
 /// <returns></returns>
 public string GetCardBag(string pRequest)
 {
     try
     {
         string cloudCustomerId = ConfigurationManager.AppSettings["CloudCustomerId"];//云店标识
         var    rp = pRequest.DeserializeJSONTo <APIRequest <EmptyRequestParameter> >();
         var    loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
         var    vipBll             = new VipBLL(loggingSessionInfo);
         var    vipInfo            = vipBll.GetByID(rp.UserID);
         string userId             = string.Empty;
         var    rd = new CardBagRD();
         if (vipInfo != null)
         {
             if (!string.IsNullOrEmpty(vipInfo.WeiXinUserId))
             {
                 DataSet dsVip = vipBll.GetCardBag(vipInfo.WeiXinUserId, cloudCustomerId);
                 if (dsVip.Tables[0].Rows.Count > 0)
                 {
                     rd.CardBagList = DataTableToObject.ConvertToList <CardBag>(dsVip.Tables[0]);
                 }
             }
         }
         var rsp = new SuccessResponse <IAPIResponseData>(rd);
         return(rsp.ToJSON());
     }
     catch (Exception ex)
     {
         throw new APIException(ex.Message);
     }
 }
Ejemplo n.º 16
0
        public string GetVipCount15Days(string pRequest)
        {
            var rp   = pRequest.DeserializeJSONTo <APIRequest <GeneralRP> >();
            var para = rp.Parameters;
            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");

            var bll = new SysRetailRewardRuleBLL(loggingSessionInfo);
            var rd  = new VipCountRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            rd.VipCountList = DataTableToObject.ConvertToList <VipCountInfo>(bll.GetRetailTraderVipCountByDays(rp.Parameters.RetailTraderId, 15).Tables[0]).ToArray();

            var dsMain = bll.GetRetailTraderEarnings(para.RetailTraderId, "All", 0, 0);

            if (dsMain.Tables[0].Rows.Count > 0)
            {
                rd.Bonus      = Convert.ToDecimal(dsMain.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney = Convert.ToDecimal(dsMain.Tables[0].Rows[0]["SalesMoney"]);
            }
            var dsMonth = bll.GetRetailTraderEarnings(para.RetailTraderId, "Month", 0, 0);

            if (dsMonth.Tables[0].Rows.Count > 0)
            {
                rd.Bonus_Month      = Convert.ToDecimal(dsMonth.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney_Month = Convert.ToDecimal(dsMonth.Tables[0].Rows[0]["SalesMoney"]);
            }
            var dsDaily = bll.GetRetailTraderEarnings(para.RetailTraderId, "Daily", 0, 0);

            if (dsDaily.Tables[0].Rows.Count > 0)
            {
                rd.Bonus_Day      = Convert.ToDecimal(dsDaily.Tables[0].Rows[0]["Bonus"]);
                rd.SalesMoney_Day = Convert.ToDecimal(dsDaily.Tables[0].Rows[0]["SalesMoney"]);
            }
            return(rsp.ToJSON());
        }
Ejemplo n.º 17
0
        /// 内部消息
        /// </summary>
        public string GetInnerGroupNewsList(string pRequest)
        {
            var    rp         = pRequest.DeserializeJSONTo <APIRequest <GetInnerGroupNewsListRP> >();//不需要参数
            string userId     = rp.UserID;
            string customerId = rp.CustomerID;
            var    pageSize   = rp.Parameters.PageSize;
            var    pageIndex  = rp.Parameters.PageIndex;

            LoggingSessionInfo loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
            // var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            InnerGroupNewsBLL bll = new InnerGroupNewsBLL(loggingSessionInfo);

            var rd = new GetInnerGroupNewsListRD();
            var ds = bll.GetInnerGroupNewsList(pageIndex ?? 1, pageSize ?? 15, rp.Parameters.OrderBy, rp.Parameters.OrderType, rp.UserID, loggingSessionInfo.ClientID, rp.Parameters.DeptID);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                rd.InnerGroupNewsList = DataTableToObject.ConvertToList <InnerGroupNewsInfo>(ds.Tables[1]);//直接根据所需要的字段反序列化
                rd.TotalCount         = ds.Tables[1].Rows.Count;
                rd.TotalPages         = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(ds.Tables[0].Rows.Count * 1.00 / (pageSize ?? 15) * 1.00)));
            }

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 18
0
        public string GetTCTWPanicbuyingEventKV(string pRequest)
        {
            TCTWPanicbuyingEventKVRD rd = new TCTWPanicbuyingEventKVRD();

            try
            {
                var rp = pRequest.DeserializeJSONTo <APIRequest <GetTCTWPanicbuyingEventKVRP> >();

                //var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
                var     loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
                var     bll = new PanicbuyingEventSkuMappingBLL(loggingSessionInfo);
                DataSet ds  = bll.GetTCTWPanicbuyingEventKV(rp.Parameters.CTWEventId);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null && ds.Tables[0].Rows.Count != 0)
                {
                    rd.TCTWPanicbuyingEventKVInfo = DataTableToObject.ConvertToObject <T_CTW_PanicbuyingEventKVEntity>(ds.Tables[0].Rows[0]);
                }
                var rsp = new SuccessResponse <IAPIResponseData>(rd);
                return(rsp.ToJSON());
            }
            catch (Exception ex)
            {
                throw new APIException(ex.Message);
            }
            //return "{\"ResultCode\":0,\"Message\":\"OK\",\"Data\":{\"ItemList\":[{\"ItemID\":\"22\",\"ItemName\":\"美的\",\"ImageUrl\":\"http://www.o2omarketing.cn: 8400/Framework/Javascript/Other/kindeditor/attached/image/lzlj/album1.jpg\",\"SkuList\":[{\"kuID\":\"1111\",\"SkuName\":\"138L(银灰色)\",\"Qty\":\"250\",\"KeepQty\":\"200\",\"SoldQty\":\"30\",\"InverTory\":\"20\"}]}]}}";
        }
Ejemplo n.º 19
0
        public string GetTypeList(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetTypeListRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new GetTypeListRD();//返回值

            var          t_TypeBLL = new T_TypeBLL(loggingSessionInfo);
            T_TypeEntity en        = new T_TypeEntity();

            en.customer_id = loggingSessionInfo.ClientID;
            var typeList = t_TypeBLL.QueryByEntity(en, null).Where(p => p.type_code != "OnlineShopping").OrderBy(p => p.type_Level).ToList();

            rd.HasSave = 1;//默认已经保存
            if (typeList != null && typeList.Count != 0)
            {
                int type_Level = (int)typeList[typeList.Count - 1].type_Level;
                //   var userDefineTypeList = typeList.Where(p => p.type_system_flag != 1).ToList();
                if (type_Level == 99)
                // if(userDefineTypeList.Count==0)
                {
                    rd.HasSave = 0;//默认已经保存
                }
            }
            rd.TypeList   = typeList;
            rd.LevelCount = typeList.Count;

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 20
0
        public string GetOptionsStatus(string pRequest)
        {
            OptionStatusRD rd = new OptionStatusRD();

            try
            {
                var             loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
                ReqOptionStatus entity             = pRequest.DeserializeJSONTo <ReqOptionStatus>();
                OptionsBLL      server             = new OptionsBLL(loggingSessionInfo);
                OrderBy[]       orders             = new OrderBy[1];
                orders[0] = new OrderBy()
                {
                    FieldName = "Sequence", Direction = OrderByDirections.Asc
                };
                OptionsEntity[] options = server.QueryByEntity(new OptionsEntity {
                    OptionName = entity.Parameters.statusName, IsDelete = 0
                }, orders);
                rd.listOptionStatus = options;
                var rsp = new SuccessResponse <IAPIResponseData>(rd);
                return(rsp.ToJSON());
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 21
0
        public string GetRetailTraders(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SellUserMainAchieveRP> >();

            var pageSize  = rp.Parameters.PageSize;
            var pageIndex = rp.Parameters.PageIndex;


            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var bll = new RetailTraderBLL(loggingSessionInfo);
            var rd  = new GetRetailTradersBySellUserRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取分销商的信息,loggingSessionInfo.ClientID
            var ds = bll.GetRetailTraders(rp.Parameters.RetailTraderName, rp.Parameters.RetailTraderAddress, rp.Parameters.RetailTraderMan,
                                          rp.Parameters.Status, rp.Parameters.CooperateType, rp.Parameters.UnitID, "", loggingSessionInfo.ClientID, loggingSessionInfo.UserID, pageIndex ?? 1, pageSize ?? 15, rp.Parameters.OrderBy, rp.Parameters.OrderType); //获取



            //判断账号是否存在
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var tempDt = ds.Tables[1];
                rd.RetailTraderList = DataTableToObject.ConvertToList <RetailTraderInfo>(tempDt);//直接根据所需要的字段反序列化
                rd.TotalCount       = Convert.ToInt32(ds.Tables[0].Rows[0]["TotalCount"]);
                rd.TotalPages       = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(Convert.ToInt32(ds.Tables[0].Rows[0]["TotalCount"]) * 1.00 / (pageSize ?? 15) * 1.00)));
            }

            return(rsp.ToJSON());
        }
Ejemplo n.º 22
0
        public string DynamicVipPropertySave(string pRequest)
        {
            var clientBussinessDefinedBLL = new ClientBussinessDefinedBLL(PrivateLoggingSessionInfo);

            var rd = new EmptyRD();
            var rp = pRequest.DeserializeJSONTo <APIRequest <JIT.CPOS.BS.BLL.ClientBussinessDefinedBLL.DynamicVipPropertySaveRP> >();

            rp.Parameters.Validate();

            string result = clientBussinessDefinedBLL.DynamicVipPropertySave(rp.Parameters);

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            if (result == "3")
            {
                rsp.Message    = "添加属性失败,属性名称已经存在.";
                rsp.ResultCode = 201;
            }
            else if (result == "2")
            {
                rsp.Message    = "添加属性失败,最多添加50个.";
                rsp.ResultCode = 201;
            }
            return(rsp.ToJSON());
        }
Ejemplo n.º 23
0
        public string GetRetailMonthRewardList(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetSellUserRewardListRP> >();

            var pageSize  = rp.Parameters.PageSize;
            var pageIndex = rp.Parameters.PageIndex;


            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var bll = new RetailTraderBLL(loggingSessionInfo);
            var rd  = new GetRetailMonthRewardListRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取分销商的信息,loggingSessionInfo.ClientID,必须要传customerID
            var ds = bll.GetRetailMonthRewardList(rp.Parameters.UnitID, rp.Parameters.SellerOrRetailName, rp.Parameters.Year,
                                                  rp.Parameters.Month, loggingSessionInfo.ClientID, loggingSessionInfo.UserID, pageIndex ?? 1, pageSize ?? 15, rp.Parameters.OrderBy, rp.Parameters.OrderType); //获取

            //判断账号是否存在
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var tempDt = ds.Tables[1];
                rd.RetailMonthRewardList = DataTableToObject.ConvertToList <RetailMonthRewards>(tempDt);//直接根据所需要的字段反序列化
                rd.TotalCount            = ds.Tables[0].Rows.Count;
                rd.TotalPages            = Convert.ToInt32(Math.Ceiling(Convert.ToDecimal(ds.Tables[0].Rows.Count * 1.00 / (pageSize ?? 15) * 1.00)));
            }

            return(rsp.ToJSON());
        }
Ejemplo n.º 24
0
        public string ActiveCard(string pRequest)
        {
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var cardDepositBLL     = new CardDepositBLL(loggingSessionInfo);

            var rp = pRequest.DeserializeJSONTo <APIRequest <ActiveCardRP> >();

            rp.Parameters.Validate();

            var rd  = new EmptyRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            int result = cardDepositBLL.ActiveCard(rp);

            if (result >= 1)
            {
                rsp.ResultCode = 0;
                rsp.Message    = result.ToString();
            }
            else
            {
                rsp.ResultCode = 300;
                rsp.Message    = "密码错误或卡已被使用!";
            }

            return(rsp.ToJSON());
        }
Ejemplo n.º 25
0
        public string GetSkuList(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetSkuListRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new GetSkuListRD();//返回值

            var propService = new JIT.CPOS.BS.BLL.PropService(loggingSessionInfo);
            //sku部分
            var SKUDomain      = "SKU";
            var skuPropService = new JIT.CPOS.BS.BLL.SkuPropServer(loggingSessionInfo);
            var skuList        = skuPropService.GetSkuPropList();//获取了所有的规格(T_SKU_PROPerty a  和  T_Prop关联有数据的),T_SKU_PROPerty只存T_Prop表里prop_type为2(即属性级别的)并且domain为sku的

            foreach (var sku in skuList)
            {
                sku.Children = propService.GetPropListByParentId(SKUDomain, sku.prop_id);//sku的明细项,暂时用不到就不要加上了。
                if (sku.Children != null && sku.Children.Count != 0)
                {
                    sku.SkuValues = "";
                    foreach (var child in sku.Children)
                    {
                        if (sku.SkuValues != "")
                        {
                            sku.SkuValues += ",";
                        }
                        sku.SkuValues += child.Prop_Name;
                    }
                }
            }
            rd.SKUPropList = skuList;

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 26
0
        public string GetMonthVipList(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SellUserMainAchieveRP> >();

            if (string.IsNullOrEmpty(rp.UserID))
            {
                throw new APIException("缺少参数【UserID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, "1");
            var bll = new RetailTraderBLL(loggingSessionInfo);
            var rd  = new GetMonthVipListRD();
            var rsp = new SuccessResponse <IAPIResponseData>(rd);
            //获取分销商的信息,loggingSessionInfo.ClientID
            int year  = DateTime.Now.Year;
            int month = DateTime.Now.Month;
            var ds    = bll.GetMonthVipList(rp.UserID, loggingSessionInfo.ClientID, month, year); //获取

            //判断账号是否存在
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                var tempDt = ds.Tables[0];
                rd.VipList = DataTableToObject.ConvertToList <VipInfo>(tempDt);//直接根据所需要的字段反序列化
            }

            return(rsp.ToJSON());
        }
Ejemplo n.º 27
0
        protected string GetEventCommentList(string pRequest)
        {
            EventCommentListRD rd = new EventCommentListRD();

            try
            {
                var rp = pRequest.DeserializeJSONTo <APIRequest <EventCommentListRP> >();

                var loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
                QuestionnaireBLL bll   = new QuestionnaireBLL(loggingSessionInfo);
                var ds = bll.GetCommentList(rp.Parameters.QuestionnaireID, rp.UserID);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    string VIPName        = ds.Tables[0].Rows[0]["VipName"].ToString();
                    var    list1          = ds.Tables[0].AsEnumerable().Where(t => t["QuestionType"].ToString() == "3"); //查内容
                    var    list2          = ds.Tables[0].AsEnumerable().Where(t => t["QuestionType"].ToString() == "6"); //查询评分
                    var    Grade          = list2.Aggregate(0, (a, b) => a + Convert.ToInt32(b["OptionsText"])) / list2.Count();
                    var    Commentcontent = list1.Aggregate("", (a, b) => a + b["Content"].ToString() + "\r\n ");
                    rd.VipName        = VIPName;
                    rd.Grade          = Grade;
                    rd.Commentcontent = Commentcontent;
                }
                var rsp = new SuccessResponse <IAPIResponseData>(rd);
                return(rsp.ToJSON());
            }
            catch (Exception ex)
            {
                throw new APIException(ex.Message);
            }
        }
Ejemplo n.º 28
0
        public string SaveAgentCustomer(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SaveAgentCustomerRP> >();
            LoggingSessionInfo loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);


            if (rp.Parameters.AgentCustomerInfo == null)
            {
                throw new APIException("缺少参数【AgentCustomerInfo】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            if (string.IsNullOrEmpty(rp.Parameters.AgentCustomerInfo.AgentName))
            {
                throw new APIException("缺少参数【AgentName】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }


            AgentCustomerBLL _AgentCustomerBLL = new AgentCustomerBLL(loggingSessionInfo);


            var AgentCustomerInfo = rp.Parameters.AgentCustomerInfo;

            if (string.IsNullOrEmpty(AgentCustomerInfo.FromSource))//如果没有标识来源,则默认为微信
            {
                AgentCustomerInfo.FromSource = "WeiXin";
            }

            //如果该标签的id为空//创建一条记录
            if (string.IsNullOrEmpty(AgentCustomerInfo.AgentID))
            {
                //TagsEntity en = new TagsEntity();
                AgentCustomerInfo.AgentID        = Guid.NewGuid().ToString();
                AgentCustomerInfo.CreateTime     = DateTime.Now;
                AgentCustomerInfo.CreateBy       = rp.UserID;
                AgentCustomerInfo.LastUpdateTime = DateTime.Now;
                AgentCustomerInfo.LastUpdateBy   = rp.UserID;
                AgentCustomerInfo.IsDelete       = 0;
                AgentCustomerInfo.CustomerID     = rp.CustomerID;
                _AgentCustomerBLL.Create(AgentCustomerInfo);
            }
            else
            {
                AgentCustomerInfo.LastUpdateTime = DateTime.Now;
                AgentCustomerInfo.LastUpdateBy   = rp.UserID;
                AgentCustomerInfo.IsDelete       = 0;
                AgentCustomerInfo.CustomerID     = rp.CustomerID;
                _AgentCustomerBLL.Update(AgentCustomerInfo, null, false);
            }
            var rd  = new EmptyRD();//返回值
            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 获取客户提现信息
        /// </summary>
        /// <param name="pRequest"></param>
        /// <returns></returns>
        public string GetCustomerWithdrawal(string pRequest)
        {
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;

            var rp         = pRequest.DeserializeJSONTo <APIRequest <GetCustomerWithdrawalInfoRP> >();
            var customerId = loggingSessionInfo.ClientID;

            var rd = new GetCustomerWithdrawalInfoRD();


            var bll = new CustomerWithdrawalBLL(loggingSessionInfo);
            var ds  = bll.GetCustomerWithrawalInfo(customerId);

            if (ds.Tables[0].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0)
            {
                GetCustomerWithdrawalInfo customerWithdrawalInfo = new GetCustomerWithdrawalInfo();
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    customerWithdrawalInfo.CustomerName  = row["CustomerName"].ToString();  //客户名称
                    customerWithdrawalInfo.ReceivingBank = row["ReceivingBank"].ToString(); //收款银行
                    if (row["BankAccount"] != DBNull.Value)
                    {
                        int    i = 4;
                        string strBankAccount = row["BankAccount"].ToString();
                        string strLeft        = strBankAccount.Substring(0, i);
                        string strRight       = strBankAccount.Substring(strBankAccount.Length - i, i);
                        customerWithdrawalInfo.BankAccount = strLeft + "**********" + strRight; //收款账号
                    }
                    customerWithdrawalInfo.OpenBank = row["OpenBank"].ToString();               //开户行
                }
                foreach (DataRow row in ds.Tables[2].Rows)
                {
                    customerWithdrawalInfo.CountWithdrawalAmount = row["CountWithdrawalAmount"] != DBNull.Value ? Convert.ToDecimal(row["CountWithdrawalAmount"].ToString()) : 0; //提现总金额
                    customerWithdrawalInfo.BeenAmount            = row["BeenAmount"] != DBNull.Value ? Convert.ToDecimal(row["BeenAmount"].ToString()) : 0;                       //已到账金额
                    customerWithdrawalInfo.WaitForAmount         = row["WaitForAmount"] != DBNull.Value ? Convert.ToDecimal(row["WaitForAmount"].ToString()) : 0;                 //待出账金额
                    customerWithdrawalInfo.CanWithdrawalAmount   = row["WithdrawalAmount"] != DBNull.Value ? Convert.ToDecimal(row["WithdrawalAmount"].ToString()) : 0;           //可提现金额
                    if (row["LastWithdrawalTime"] != DBNull.Value)
                    {
                        customerWithdrawalInfo.LastWithdrawalTime = DateTimeExtensionMethods.To19FormatString(Convert.ToDateTime(row["LastWithdrawalTime"])); //上次提现时间 ;
                    }
                    customerWithdrawalInfo.CautionMoney = row["CautionMoney"] != DBNull.Value ? Convert.ToDecimal(row["CautionMoney"].ToString()) : 0;        //保证金
                    customerWithdrawalInfo.RefundAmount = row["RefundAmount"] != DBNull.Value ? Convert.ToDecimal(row["RefundAmount"].ToString()) : 0;        //退款金额
                }
                //结算信息
                foreach (DataRow row in ds.Tables[1].Rows)
                {
                    customerWithdrawalInfo.PaypalRate = row["PaypalRate"] != DBNull.Value ? Convert.ToDecimal(row["PaypalRate"].ToString()) : 0;
                    customerWithdrawalInfo.CUPRate    = row["CUPRate"] != DBNull.Value ? Convert.ToDecimal(row["CUPRate"].ToString()) : 0;
                    customerWithdrawalInfo.OffPeriod  = row["OffPeriod"] != DBNull.Value ? Convert.ToInt32(row["OffPeriod"].ToString()) : 0;
                    customerWithdrawalInfo.MinAmount  = row["MinAmount"] != DBNull.Value ? Convert.ToInt32(row["MinAmount"].ToString()) : 0;
                    customerWithdrawalInfo.PayRemark  = row["PayRemark"].ToString();
                }
                rd.GetCustomerWithdrawal = customerWithdrawalInfo;
            }

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
Ejemplo n.º 30
0
        /// 内部消息
        /// </summary>
        public string GetGroupNewsByID(string pRequest)
        {
            var    rp         = pRequest.DeserializeJSONTo <APIRequest <GetGroupNewsByIDRP> >();//不需要参数
            string userId     = rp.UserID;
            string customerId = rp.CustomerID;

            if (string.IsNullOrEmpty(rp.Parameters.GroupNewsID))
            {
                throw new APIException("缺少参数【GroupNewsID】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }

            LoggingSessionInfo loggingSessionInfo = Default.GetBSLoggingSession(rp.CustomerID, rp.UserID);
            // var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            InnerGroupNewsBLL bll = new InnerGroupNewsBLL(loggingSessionInfo);

            var rd = new GetGroupNewsByIDRD();
            var ds = bll.GetByID(rp.Parameters.GroupNewsID);   //

            if (ds != null && !string.IsNullOrEmpty(ds.CreateBy))
            {
                //t_user从取创建用户
                T_UserBLL bll2 = new T_UserBLL(loggingSessionInfo);
                //更新为已读
                T_UserEntity t_user = bll2.GetByID(ds.CreateBy);
                if (t_user != null)
                {
                    ds.CreateBy = t_user.user_name;
                }
                else
                {
                    ds.CreateBy = "";
                }
                //把该条信息设置为已经读过

                NewsUserMappingBLL    bll3 = new NewsUserMappingBLL(loggingSessionInfo);
                NewsUserMappingEntity en   = new NewsUserMappingEntity();
                en.UserID      = rp.UserID;
                en.GroupNewsID = rp.Parameters.GroupNewsID;
                NewsUserMappingEntity[] lsen = bll3.QueryByEntity(en, null);
                if (lsen != null && lsen.Length != 0)
                {
                    en         = lsen[0];
                    en.HasRead = 1;
                    bll3.Update(en, null);
                }
            }

            rd.InnerGroupNewsInfo = ds;

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }