Пример #1
0
        protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <ApplyForBuyUnitRP> pRequest)
        {
            var rd   = new EmptyResponseData();
            var para = pRequest.Parameters;

            var     loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var     bllAPCommon        = new APCommonBLL(loggingSessionInfo);
            DataSet dsCustomer         = bllAPCommon.GetCustomerInfo(loggingSessionInfo.ClientID);

            if (dsCustomer.Tables.Count > 0 && dsCustomer.Tables[0].Rows.Count > 0)
            {
                string      strSupportType = "30";
                string      strSubject     = "商户购买门店申请";
                string      strBody        = "申请时间:" + DateTime.Now.ToShortDateString() + "<br/>商户名称:" + dsCustomer.Tables[0].Rows[0]["customer_name"] + "<br/>产品套餐:集客宝" + "<br/>申请人名称:" + loggingSessionInfo.CurrentUser.User_Name + "<br/>购买数量:" + para.ByeUnitCount.ToString();
                SendMailBLL bllSendMail    = new SendMailBLL();
                bllSendMail.SendMail(loggingSessionInfo, strSubject, strBody, strSupportType);

                T_UnitNumApplyOrderBLL    bll    = new T_UnitNumApplyOrderBLL(loggingSessionInfo);
                T_UnitNumApplyOrderEntity entity = new T_UnitNumApplyOrderEntity();
                entity.ApplyUnitNum         = para.ByeUnitCount;
                entity.ApplyUnitsPrice      = para.ApplyUnitsPrice;
                entity.UnitNumLimitConfigId = new Guid(bllAPCommon.GetSysUnitNumLimitConfigId());
                entity.CustomerId           = loggingSessionInfo.ClientID;
                bll.Create(entity);
            }
            return(rd);
        }
Пример #2
0
        protected override GetVersionRD ProcessRequest(DTO.Base.APIRequest <EmptyRequestParameter> pRequest)
        {
            var rd = new GetVersionRD();

            var para        = pRequest.Parameters;
            var bllAPCommon = new APCommonBLL(this.CurrentUserInfo);

            rd.VersionId = bllAPCommon.GetCustomerVersion(this.CurrentUserInfo.ClientID);
            return(rd);
        }
Пример #3
0
        protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <EmptyRequestParameter> pRequest)
        {
            var     rd = new EmptyResponseData();
            var     loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var     bllAPCommon        = new APCommonBLL(loggingSessionInfo);
            DataSet dsCustomer         = bllAPCommon.GetCustomerInfo(loggingSessionInfo.ClientID);

            if (dsCustomer.Tables.Count > 0 && dsCustomer.Tables[0].Rows.Count > 0)
            {
                string      strSupportType = "40";
                string      strSubject     = "商户权限升级申请";
                string      strBody        = "申请时间:" + DateTime.Now.ToShortDateString() + "<br/>商户名称:" + dsCustomer.Tables[0].Rows[0]["customer_name"] + "<br/>产品套餐:集客宝" + "<br/>申请人名称:" + loggingSessionInfo.CurrentUser.User_Name;
                SendMailBLL bllSendMail    = new SendMailBLL();
                bllSendMail.SendMail(loggingSessionInfo, strSubject, strBody, strSupportType);
            }
            return(rd);
        }
Пример #4
0
        protected override GetUnitPriceRD ProcessRequest(DTO.Base.APIRequest <EmptyRequestParameter> pRequest)
        {
            var rd   = new GetUnitPriceRD();
            var para = pRequest.Parameters;
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var bllAPCommon        = new APCommonBLL(loggingSessionInfo);

            var unitService = new UnitService(CurrentUserInfo);

            DataSet ds = bllAPCommon.GetCustomerLimtUnitCount(loggingSessionInfo.ClientID);


            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[1].Rows.Count > 0)
            {
                rd.LimitCount = Convert.ToInt16(ds.Tables[0].Rows[0]["units"]);
                rd.Price      = Convert.ToDouble(ds.Tables[1].Rows[0]["SingleUnitPrice"]);
                rd.UnitCount  = unitService.GetUnitCountByCustomerId(loggingSessionInfo.ClientID);
            }
            return(rd);
        }
Пример #5
0
        protected override GetZMBACourseRD ProcessRequest(DTO.Base.APIRequest <EmptyRequestParameter> pRequest)
        {
            //基础数据初始化
            GetZMBACourseRD            ZMBACourseRD   = new GetZMBACourseRD();
            T_ZMBA_CourseBLL           bll            = new T_ZMBA_CourseBLL(this.CurrentUserInfo);
            List <T_ZMBA_CourseEntity> ZMBACourseList = new List <T_ZMBA_CourseEntity>();

            //查询条件初始化
            T_ZMBA_CourseEntity pT_ZMBA_CourseEntity = new T_ZMBA_CourseEntity();

            OrderBy[] pOrderBy = new OrderBy[1];
            pOrderBy[0] = new OrderBy()
            {
                FieldName = "DisplayIndex", Direction = OrderByDirections.Asc
            };

            var bllAPCommon = new APCommonBLL(CurrentUserInfo);
            var VersionId   = bllAPCommon.GetCustomerVersion(CurrentUserInfo.ClientID);

            if (VersionId == 3)
            {
                List <IWhereCondition> complexCondition = new List <IWhereCondition> {
                };
                complexCondition.Add(new DirectCondition(" CourseName in('新手开店','新干线讲师','员工管理','集客吸粉','在线客服','会员服务','经营数据','卡券核销')"));

                ZMBACourseList = bll.Query(complexCondition.ToArray(), pOrderBy).ToList();
            }
            else
            {
                //执行查询
                ZMBACourseList = bll.QueryByEntity(pT_ZMBA_CourseEntity, pOrderBy).ToList();
            }
            ZMBACourseRD.ZMBACourseList = ZMBACourseList;

            return(ZMBACourseRD);
        }
        protected override SetCustomerModuleMappingRD ProcessRequest(APIRequest <SetCustomerModuleMappingRP> pRequest)
        {
            SetCustomerModuleMappingRD rd = new SetCustomerModuleMappingRD();
            var para = pRequest.Parameters;

            //获取当前商户的数据库链接信息
            var customerCurrentUserInfo = this.CurrentUserInfo;

            if (string.IsNullOrEmpty(this.CurrentUserInfo.Conn))
            {
                customerCurrentUserInfo = Default.GetBSLoggingSession(para.CustomerID, "system");
            }

            //获取主库数据库链接信息
            var userInfo = this.CurrentUserInfo;

            userInfo.CurrentLoggingManager.Connection_String = System.Configuration.ConfigurationManager.AppSettings["Conn_ap"];
            CustomerModuleMappingBLL    bll    = new CustomerModuleMappingBLL(userInfo);
            CustomerModuleMappingEntity entity = new CustomerModuleMappingEntity();

            SysVocationVersionMappingBLL vocationVersionMappingBLL = new SysVocationVersionMappingBLL(userInfo); //行业版本关系业务逻辑层
            T_MenuBLL menuBLL = new T_MenuBLL(customerCurrentUserInfo);                                          //菜单业务逻辑层


            string strArrVocaverMappingID = para.VocaVerMappingID.ToString();
            // string[] strArrVocaverMappingID = str.Split(',');
            var tran = bll.GetTran();

            using (tran.Connection)
            {
                try
                {
                    //for (int i = 0; i < strArrVocaverMappingID.Length; i++)
                    //{
                    //var tempList = bll.QueryByEntity(new CustomerModuleMappingEntity { CustomerID = para.CustomerID, VocaVerMappingID = Guid.Parse(strArrVocaverMappingID[i].ToString()) }, null);  //之前是判断只有一个套餐。现在可以有多个套餐
                    if (strArrVocaverMappingID.Contains(','))
                    {
                        throw new APIException(string.Format("不能应用到多个套餐。"))
                              {
                                  ErrorCode = 301
                              };
                    }
                    else
                    {
                        var tempList = bll.QueryByEntity(new CustomerModuleMappingEntity {
                            CustomerID = para.CustomerID
                        }, null);
                        if (tempList.Length > 0)  //如果存在该客户的信息。则更新
                        {
                            string MappingId = tempList[0].MappingID.ToString();
                            entity                  = new CustomerModuleMappingEntity();
                            entity.MappingID        = Guid.Parse(MappingId);
                            entity.VocaVerMappingID = Guid.Parse(strArrVocaverMappingID.ToString());
                            entity.CustomerID       = para.CustomerID;
                            bll.Update(entity);
                        }
                        else
                        {
                            entity                  = new CustomerModuleMappingEntity();
                            entity.MappingID        = Guid.NewGuid();
                            entity.VocaVerMappingID = Guid.Parse(strArrVocaverMappingID.ToString());
                            entity.CustomerID       = para.CustomerID;
                            bll.Create(entity);
                        }
                    }

                    /////针对集客宝版本,更新CustomerEx中的限制门店数(建仙代码,稍后他合并上来)
                    var bllAPCommon = new APCommonBLL(userInfo);
                    bllAPCommon.UpdateCustomerEx(para.CustomerID, userInfo.CurrentLoggingManager.User_Name);
                    ////}

                    //更新菜单和可操作权限
                    var vocationVersionMappingInfo = vocationVersionMappingBLL.GetByID(para.VocaVerMappingID);
                    if (vocationVersionMappingInfo != null)
                    {
                        if (vocationVersionMappingInfo.VersionID != 3)//版本不等于集客宝版本时更新
                        {
                            //批量修改菜单操作权限
                            menuBLL.UpdateIsCanAccess(para.CustomerID);
                            //设置隐藏的菜单可用(紧急方案:集客宝中只包含发送通知隐藏)
                            menuBLL.UpgradeMenu(para.CustomerID, vocationVersionMappingInfo.VocaVerMappingID.ToString());
                        }
                    }
                    tran.Commit();
                }
                catch (Exception ex)
                {
                    tran.Rollback();//回滚事物

                    throw new APIException(ex.Message);
                }
            }
            return(rd);
        }