예제 #1
0
        public object GetList(int pageNo = 1, int pageSize = 10)
        {
            CheckUserLogin();
            var capitalService = ServiceApplication.Create <IMemberCapitalService>();

            var query = new CapitalDetailQuery
            {
                memberId = CurrentUser.Id,
                PageSize = pageSize,
                PageNo   = pageNo
            };
            var pageMode = capitalService.GetCapitalDetails(query);
            var model    = pageMode.Models.ToList().Select(e => new CapitalDetailModel
            {
                Id            = e.Id,
                Amount        = e.Amount + e.PresentAmount,
                PresentAmount = e.PresentAmount,
                CapitalID     = e.CapitalID,
                CreateTime    = e.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
                SourceData    = e.SourceData,
                SourceType    = e.SourceType,
                Remark        = e.SourceType == CapitalDetailInfo.CapitalDetailType.Brokerage ? GetBrokerageRemark(e) : e.Remark,
                PayWay        = e.Remark
            });
            dynamic result = SuccessResult();

            result.rows  = model;
            result.total = pageMode.Total;

            return(result);
        }
예제 #2
0
        public async Task <IActionResult> PutServiceApplication([FromRoute] int id,
                                                                [FromBody] ServiceApplication serviceApplication)
        {
            //if (!ModelState.IsValid)
            //{
            //  return BadRequest(ModelState);
            //}

            var serviceApplicationEdited = serviceApplication;

            serviceApplicationEdited.IsActive = true;

            if (id != serviceApplicationEdited.ServiceApplicationId)
            {
                return(BadRequest());
            }

            _context.Entry(serviceApplicationEdited).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ServiceApplicationExists(id))
                {
                    return(NotFound());
                }
                throw;
            }

            return(NoContent());
        }
예제 #3
0
        public JsonResult GetShopInfo(long shopId)
        {
            var shopinfo = ServiceApplication.Create <IShopService>().GetShop(shopId);
            var model    = new { SenderAddress = shopinfo.SenderAddress, SenderPhone = shopinfo.SenderPhone, SenderName = shopinfo.SenderName };

            return(Json(model));
        }
예제 #4
0
        bool UpdateSession(byte[] image)
        {
            // update the session duration
            using (var command = new OleDbCommand(Program.Settings.CommandUpdateDuration, connection))
            {
                command.Parameters.AddWithValue("@Duration", (int)((DateTime.Now - sessionStart).TotalMinutes));
                command.Parameters.AddWithValue("@Session", session);
                if (command.ExecuteNonQuery() != 1)
                {
                    return(false);
                }
            }

            // update the screenshot
            using (var command = new OleDbCommand(Program.Settings.CommandUpdateScreenshot, connection))
            {
                command.Parameters.AddWithValue("@Screenshot", (object)image ?? DBNull.Value);
                command.Parameters.AddWithValue("@Session", session);
                try { command.ExecuteNonQuery(); }
                catch (OleDbException e) { ServiceApplication.LogEvent(EventLogEntryType.Warning, e.Message); }
            }

            // return success
            return(true);
        }
예제 #5
0
        public JsonResult GetExpressData(string expressCompanyName, string shipOrderNumber)
        {
            if (string.IsNullOrWhiteSpace(expressCompanyName) || string.IsNullOrWhiteSpace(shipOrderNumber))
            {
                throw new MallException("错误的订单信息");
            }
            string         kuaidi100Code = ServiceApplication.Create <IExpressService>().GetExpress(expressCompanyName).Kuaidi100Code;
            HttpWebRequest request       = (HttpWebRequest)HttpWebRequest.Create(string.Format("http://www.kuaidi100.com/query?type={0}&postid={1}", kuaidi100Code, shipOrderNumber));

            request.Timeout = 8000;

            string content = "暂时没有此快递单号的信息";

            try
            {
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    Stream stream = response.GetResponseStream();
                    System.IO.StreamReader streamReader = new StreamReader(stream, System.Text.Encoding.GetEncoding("UTF-8"));

                    // 读取流字符串内容
                    content = streamReader.ReadToEnd();
                    content = content.Replace("&amp;", "");
                    content = content.Replace("&nbsp;", "");
                    content = content.Replace("&", "");
                }
            }
            catch
            {
            }
            return(Json(content));
        }
예제 #6
0
        /// <summary>
        /// 获取用户积分明细
        /// </summary>
        /// <param name="id">用户编号</param>
        /// <param name="type"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageNo"></param>
        /// <returns></returns>
        public object GetIntegralRecord(Himall.Entities.MemberIntegralInfo.IntegralType?type = null, int page = 1, int pagesize = 10)
        {
            CheckUserLogin();
            //处理当前用户与id的判断
            var _iMemberIntegralService = ServiceApplication.Create <IMemberIntegralService>();

            var query = new IntegralRecordQuery()
            {
                IntegralType = type, UserId = CurrentUser.Id, PageNo = page, PageSize = pagesize
            };
            var result = _iMemberIntegralService.GetIntegralRecordListForWeb(query);
            var list   = result.Models.Select(item => {
                var actions = _iMemberIntegralService.GetIntegralRecordAction(item.Id);
                return(new UserCenterGetIntegralRecordModel
                {
                    Id = item.Id,
                    RecordDate = item.RecordDate,
                    Integral = item.Integral,
                    TypeId = item.TypeId,
                    ShowType = (item.TypeId == MemberIntegralInfo.IntegralType.WeiActivity) ? item.ReMark : item.TypeId.ToDescription(),
                    ReMark = GetRemarkFromIntegralType(item.TypeId, actions, item.ReMark)
                });
            });
            dynamic pageresult = SuccessResult();

            pageresult.total = result.Total;
            pageresult.data  = list.ToList();
            return(pageresult);
        }
예제 #7
0
 public JsonResult Setting(bool autoAllotOrder)
 {
     try
     {
         ShopApplication.SetAutoAllotOrder(CurrentSellerManager.ShopId, autoAllotOrder);
         ServiceApplication.Create <IOperationLogService>().AddSellerOperationLog(new Entities.LogInfo
         {
             Date        = DateTime.Now,
             Description = string.Format("{0}:订单自动分配到门店", autoAllotOrder ? "开启" : "关闭"),
             IPAddress   = base.Request.HttpContext.Features.Get <IHttpConnectionFeature>()?.RemoteIpAddress.ToString(),
             PageUrl     = "/ShopBranch/Setting",
             UserName    = CurrentSellerManager.UserName,
             ShopId      = CurrentSellerManager.ShopId
         });
         return(Json(new
         {
             success = true
         }));
     }
     catch (Exception e)
     {
         return(Json(new
         {
             success = false,
             msg = e.Message
         }));
     }
 }
예제 #8
0
        public static MvcHtmlString CategoryPath(string path, string pName)
        {
            StringBuilder sb = new StringBuilder("<div class=\"breadcrumb\">");

            try
            {
                pName = pName.Length > 40 ? pName.Substring(0, 40) + " ..." : pName;
                string mian = "", second = "", third = "";
                var    catepath = path.Split('|');
                if (catepath.Length > 0)
                {
                    mian = ServiceApplication.Create <ICategoryService>().GetCategory(long.Parse(catepath[0])).Name;
                }
                if (catepath.Length > 1)
                {
                    second = ServiceApplication.Create <ICategoryService>().GetCategory(long.Parse(catepath[1])).Name;
                }
                if (catepath.Length > 2)
                {
                    third = ServiceApplication.Create <ICategoryService>().GetCategory(long.Parse(catepath[2])).Name;
                }
                sb.AppendFormat("<strong><a href=\"/search/searchAd?cid={0}\">{1}</a></strong>", long.Parse(catepath[0]), mian);
                sb.AppendFormat("<span>{0}{1}&nbsp;&gt;&nbsp;<a href=\"\">{2}</a></span>",
                                string.IsNullOrWhiteSpace(second) ? "" : string.Format("&nbsp;&gt;&nbsp;<a href=\"/search/searchAd?cid={0}\">{1}</a>", long.Parse(catepath[1]), second),
                                string.IsNullOrWhiteSpace(third) ? "" : string.Format("&nbsp;&gt;&nbsp;<a href=\"/search/searchAd?cid={0}\">{1}</a>", long.Parse(catepath[2]), third), pName);

                sb.AppendFormat("</div>");
            }
            catch
            {
                sb.AppendFormat("</div>");
            }
            return(MvcHtmlString.Create(sb.ToString()));
        }
예제 #9
0
 public GiftsController()
 {
     _iGiftService        = ServiceApplication.Create <IGiftService>();
     _iGiftsOrderService  = ServiceApplication.Create <IGiftsOrderService>();
     _iMemberService      = ServiceApplication.Create <IMemberService>();
     _iMemberGradeService = ServiceApplication.Create <IMemberGradeService>();
 }
예제 #10
0
        private string GetFreightStr(long productId, decimal discount, string skuId, int addressId)
        {
            string freightStr = "免运费";
            //if (addressId <= 0)//如果用户的默认收货地址为空,则运费没法计算
            //    return freightStr;
            bool isFree = false;

            if (addressId > 0)
            {
                isFree = ProductManagerApplication.IsFreeRegion(productId, discount, addressId, 1, skuId);//默认取第一个规格
            }
            if (isFree)
            {
                freightStr = "免运费";//卖家承担运费
            }
            else
            {
                decimal freight = ServiceApplication.Create <IProductService>().GetFreight(new List <long>()
                {
                    productId
                }, new List <int>()
                {
                    1
                }, addressId);
                freightStr = freight <= 0 ? "免运费" : string.Format("运费 {0}元", freight.ToString("f2"));
            }
            return(freightStr);
        }
예제 #11
0
        void HandleRequest(object state)
        {
            // try to logon the user and create the response
            var request = (Request)state;
            int timeout;

            try { timeout = LogonAndCreateSession(request.UserName, request.Password, request.Address); }
            catch (OleDbException e)
            {
                ServiceApplication.LogEvent(EventLogEntryType.Error, e.Message);
                return;
            }
            var response = new RadiusPacket(timeout < 0 ? PacketCode.AccessReject : PacketCode.AccessAccept);

            response.Identifier = request.Identifier;
            if (timeout > 0)
            {
                response.Attribute(RadiusAttribute.SessionTimeout).Add(timeout);
            }
            response.Attribute(RadiusAttribute.ProxyState).AddRange(request.ProxyStates);
            response.SignResponse(request.Authenticator, sharedSecred);
            try { socket.SendTo(response.GetBuffer(), 0, response.Length, SocketFlags.None, request.Client); }
            catch (ObjectDisposedException) { }
            catch (SocketException e) { ServiceApplication.LogEvent(EventLogEntryType.Error, e.Message); }
        }
예제 #12
0
파일: Program.cs 프로젝트: xorkrus/vk_wm
        /// <summary>
        /// Перехват системных сообщений для обработки сервисом
        /// </summary>
        /// <param name="message"></param>
        static void ServiceApplication_OnRegisteredMessage(ref Microsoft.WindowsCE.Forms.Message message)
        {
            switch (message.Msg)
            {
            case Interprocess.WM_QUIT_SERVICE:
                try
                {
                    if (_notification != null)
                    {
                        _notification.Visible = false;
                    }
                }
                catch (Exception)
                { }
                ServiceApplication.Exit();
                break;

            case Interprocess.WM_TIMER_TICK:
                if ((SystemState.PhoneRoaming && _baseLogic.IDataLogic.GetInRoumingValue() == "1") || !SystemState.PhoneRoaming)
                {
                    OnTimerTick();
                }
                break;
            }
        }
예제 #13
0
        /// <summary>
        /// Records the perfromance for the service app.
        /// </summary>
        /// <param name="appName">Name of the application.</param>
        /// <param name="performance">The performance.</param>
        public void RecordPerfromance(string appName, AppPerformance performance)
        {
            ServiceApplication appEntity = this.GetServiceApplication(appName);

            if (appEntity == null)
            {
                throw new KeyNotFoundException("ServiceApplication to log performance against could not be found");
            }

            var perfEntity = this.FindAll <ServiceApplicationPerfomance>(p => p.Guid == performance.Guid).FirstOrDefault();

            if (perfEntity == null)
            {
                perfEntity = new ServiceApplicationPerfomance
                {
                    ServiceApplication = appEntity,
                    Source             = this.GetType().Name,
                    Guid = performance.Guid
                };
                this.Insert <ServiceApplicationPerfomance>(perfEntity);
            }

            perfEntity.StartTime = performance.StartTime;
            perfEntity.EndTime   = performance.EndTime;
            perfEntity.Failed    = performance.Failed;
            perfEntity.Message   = performance.Message;

            this.SubmitChanges();
        }
예제 #14
0
        public ContentResult ShopEnterpriseNotify_Post(string id, string outid)
        {
            Log.Info("[SENP]" + Core.Helper.WebHelper.GetRawUrl());
            id = DecodePaymentId(id);
            string errorMsg = string.Empty;
            string response = string.Empty;
            var    _iOperationLogService = ServiceApplication.Create <IOperationLogService>();
            var    withdrawId            = long.Parse(outid);
            var    withdrawData          = BillingApplication.GetShopWithDrawInfo(withdrawId);

            if (withdrawData == null)
            {
                Log.Info("[ShopEnterpriseNotify_Post]" + id + " ^ " + outid);
                throw new HimallException("参数错误");
            }
            try
            {
                var payment = Core.PluginsManagement.GetPlugin <IPaymentPlugin>(id);
                var payInfo = payment.Biz.ProcessEnterprisePayNotify(HttpContext.Request);
                if (withdrawData.Status == Himall.CommonModel.WithdrawStaus.PayPending)
                {
                    BillingApplication.ShopApplyWithDrawCallBack(withdrawId, Himall.CommonModel.WithdrawStaus.Succeed, payInfo, "支付宝提现成功", Request.UserHostAddress, "异步回调");
                }
                response = payment.Biz.ConfirmPayResult();
            }
            catch (Exception ex)
            {
                BillingApplication.ShopApplyWithDrawCallBack(withdrawId, Himall.CommonModel.WithdrawStaus.Fail, null, "支付宝提现失败", Request.UserHostAddress, "异步回调");
                errorMsg = ex.Message;
                Log.Error("ShopEnterpriseNotify_Post", ex);
            }
            return(Content(response));
        }
예제 #15
0
        /// <summary>
        /// 初始化缓存
        /// </summary>
        public static void InitCache()
        {
            //加载移动端当前首页模版
            var curr = ServiceApplication.Create <ITemplateSettingsService>().GetCurrentTemplate(0);

            Core.Cache.Insert <TemplateVisualizationSettingInfo>(CacheKeyCollection.MobileHomeTemplate("0"), curr);
        }
        public async Task <IActionResult> PostProjectSubstitute([FromBody] ProjectSubstitute projectSubstitute)
        {
            //if (!ModelState.IsValid)
            //{
            //  return BadRequest(ModelState);
            //}
            var postProjectSubstitute = projectSubstitute;

            postProjectSubstitute.CreatedUserId = 1;
            postProjectSubstitute.IsActive      = false;

            var serviceApplication = new ServiceApplication();

            serviceApplication.InvestorId      = projectSubstitute.InvestorId;
            serviceApplication.ProjectId       = projectSubstitute.ProjectId;
            serviceApplication.CaseNumber      = "1";
            serviceApplication.ServiceId       = projectSubstitute.ServiceId;
            serviceApplication.CurrentStatusId = 44446;
            serviceApplication.IsSelfService   = true;
            serviceApplication.IsPaid          = true;
            serviceApplication.StartDate       = DateTime.Now;
            serviceApplication.CreatedUserId   = 1;
            serviceApplication.IsActive        = false;

            var serviceWorkflow = new ServiceWorkflow
            {
                StepId             = 9,
                ActionId           = 3,
                FromStatusId       = 3,
                ToStatusId         = 5,
                PerformedByRoleId  = 1,
                NextStepId         = 1015,
                GenerateEmail      = true,
                GenerateLetter     = true,
                IsDocumentRequired = true,
                ServiceId          = projectSubstitute.ServiceId,
                LegalStatusId      = 3,
                CreatedUserId      = 1,
                IsActive           = false
            };

            serviceApplication.ServiceWorkflow.Add(serviceWorkflow);
            _context.ServiceApplication.Add(serviceApplication);
            await _context.SaveChangesAsync();

            postProjectSubstitute.ServiceApplicationId = serviceApplication.ServiceApplicationId;

            _context.ProjectSubstitute.Add(postProjectSubstitute);

            //ServiceApplication.Add(serviceApplication);
            //postProjectSubstitute.ServiceApplication = serviceApplication;
            //_context.Project.Add(editedProject);

            //_context.ProjectSubstitute.Add(postProjectSubstitute);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProjectSubstitute", new { id = postProjectSubstitute.ProjectSubstituteId },
                                   postProjectSubstitute));
        }
예제 #17
0
        /// <summary>
        /// Validate that all configuration properties are set.
        /// </summary>
        public void Validate(string parentProperty)
        {
            // If any of ApplicationRegistration properties is provided,
            // then we will require that all are provided.

            if (null == ServiceApplication)
            {
                throw new Exception($"{parentProperty}.ServiceApplication" +
                                    " configuration property is missing.");
            }

            ServiceApplication.Validate($"{parentProperty}.ServiceApplication");

            if (null == ServiceApplicationSP)
            {
                throw new Exception($"{parentProperty}.ServiceApplicationSP" +
                                    " configuration property is missing.");
            }

            ServiceApplicationSP.Validate($"{parentProperty}.ServiceApplicationSP");

            if (null == ClientApplication)
            {
                throw new Exception($"{parentProperty}.ClientApplication" +
                                    " configuration property is missing.");
            }

            ClientApplication.Validate($"{parentProperty}.ClientApplication");

            if (null == ClientApplicationSP)
            {
                throw new Exception($"{parentProperty}.ClientApplicationSP" +
                                    " configuration property is missing.");
            }

            ClientApplicationSP.Validate($"{parentProperty}.ClientApplicationSP");

            if (null == AksApplication)
            {
                throw new Exception($"{parentProperty}.AksApplication" +
                                    " configuration property is missing.");
            }

            AksApplication.Validate($"{parentProperty}.AksApplication");

            if (null == AksApplicationSP)
            {
                throw new Exception($"{parentProperty}.AksApplicationSP" +
                                    " configuration property is missing.");
            }

            AksApplicationSP.Validate($"{parentProperty}.AksApplicationSP");

            if (string.IsNullOrEmpty(AksApplicationRbacSecret))
            {
                throw new Exception($"{parentProperty}.AksApplicationRbacSecret" +
                                    " configuration property is missing or is empty.");
            }
        }
예제 #18
0
            public void ReturnsInstance()
            {
                // Arrange -> Act
                var app = new ServiceApplication <ISettings>(worker, serviceBase);

                // Assert
                Assert.IsAssignableFrom <ServiceApplication <ISettings> >(app);
            }
예제 #19
0
 public object GetPayOrderByIntegral(string orderIds)
 {
     CheckUserLogin();
     var orderIdArr = orderIds.Split(',').Select(item => long.Parse(item));
     var service = ServiceApplication.Create<IOrderService>();
     service.ConfirmZeroOrder(orderIdArr, CurrentUser.Id);
     return SuccessResult();
 }
예제 #20
0
 /// <summary>
 /// 更改限时购销售量
 /// </summary>
 public static void IncreaseSaleCount(List <long> orderid)
 {
     if (orderid.Count == 1)
     {
         var service = ServiceApplication.Create <ILimitTimeBuyService>();
         service.IncreaseSaleCount(orderid);
     }
 }
        public async Task <IActionResult> PostProject([FromBody] ProjectRenewal projectRenewal)
        {
            //if (!ModelState.IsValid)
            //{
            //  return BadRequest(ModelState);
            //}

            var editProjectRenewal = projectRenewal;

            //editProjectRenewal.ServiceApplicationId = projectRenewal.ServiceApplicationId;
            editProjectRenewal.ProjectStatus = 1;
            editProjectRenewal.ApprovedBy    = 1;
            editProjectRenewal.SiteId        = 3;
            editProjectRenewal.CreatedUserId = 1;
            editProjectRenewal.ApprovedDate  = DateTime.Now;

            var serviceApplication = new ServiceApplication();

            serviceApplication.InvestorId      = editProjectRenewal.InvestorId;
            serviceApplication.ProjectId       = editProjectRenewal.ProjectId;
            serviceApplication.CaseNumber      = "1";
            serviceApplication.ServiceId       = editProjectRenewal.ServiceId;
            serviceApplication.CurrentStatusId = 44446;
            serviceApplication.IsSelfService   = true;
            serviceApplication.IsPaid          = true;
            serviceApplication.StartDate       = DateTime.Now;
            serviceApplication.CreatedUserId   = 1;
            serviceApplication.IsActive        = false;

            var serviceWorkflow = new ServiceWorkflow
            {
                StepId             = 9,
                ActionId           = 3,
                FromStatusId       = 3,
                ToStatusId         = 5,
                PerformedByRoleId  = 1,
                NextStepId         = 1015,
                GenerateEmail      = true,
                GenerateLetter     = true,
                IsDocumentRequired = true,
                ServiceId          = editProjectRenewal.ServiceId,
                LegalStatusId      = 3,
                CreatedUserId      = 1,
                IsActive           = false
            };

            serviceApplication.ServiceWorkflow.Add(serviceWorkflow);
            context.ServiceApplication.Add(serviceApplication);
            await context.SaveChangesAsync();

            editProjectRenewal.ServiceApplicationId = serviceApplication.ServiceApplicationId;

            context.ProjectRenewal.Add(editProjectRenewal);

            await context.SaveChangesAsync();

            return(CreatedAtAction("GetProjectRenewals", new { id = projectRenewal.ProjectRenewalId }, projectRenewal));
        }
예제 #22
0
 static void Main()
 {
     // hook up all event handlers and run the service application
     ServiceApplication.Start += Session.Start;
     ServiceApplication.Start += RadiusServer.Start;
     ServiceApplication.Stop  += Session.Stop;
     ServiceApplication.Stop  += RadiusServer.Stop;
     ServiceApplication.Run();
 }
예제 #23
0
 bool System.ServiceModel.Dispatcher.IErrorHandler.HandleError(Exception error)
 {
     // ignore expected fault exceptions and log all other types
     if (!(error is FaultException))
     {
         ServiceApplication.LogEvent(EventLogEntryType.Error, error.Message);
     }
     return(false);
 }
예제 #24
0
        public JsonResult GetShopInfo(long sid, long productId = 0)
        {
            string cacheKey = CacheKeyCollection.CACHE_SHOPINFO(sid, productId);

            if (Cache.Exists(cacheKey))
            {
                return(Cache.Get <JsonResult>(cacheKey));
            }

            string  brandLogo    = string.Empty;
            long    brandId      = 0L;
            decimal cashDeposits = 0M;

            if (productId != 0)
            {
                var product = ServiceApplication.Create <IProductService>().GetProduct(productId);
                if (product != null)
                {
                    var brand = ServiceApplication.Create <IBrandService>().GetBrand(product.BrandId);
                    brandLogo = brand == null ? string.Empty : brand.Logo;
                    brandId   = brand == null ? brandId : brand.Id;
                }
            }
            var shop             = ServiceApplication.Create <IShopService>().GetShop(sid);
            var mark             = Framework.ShopServiceMark.GetShopComprehensiveMark(sid);
            var cashDepositsInfo = ServiceApplication.Create <ICashDepositsService>().GetCashDepositByShopId(sid);

            if (cashDepositsInfo != null)
            {
                cashDeposits = cashDepositsInfo.CurrentBalance;
            }

            var cashDepositModel = ServiceApplication.Create <ICashDepositsService>().GetCashDepositsObligation(productId);
            var model            = new
            {
                CompanyName              = shop.CompanyName,
                Id                       = sid,
                PackMark                 = mark.PackMark,
                ServiceMark              = mark.ServiceMark,
                ComprehensiveMark        = mark.ComprehensiveMark,
                Phone                    = shop.CompanyPhone,
                Name                     = shop.ShopName,
                Address                  = ServiceApplication.Create <IRegionService>().GetFullName(shop.CompanyRegionId),
                ProductMark              = 3,
                IsSelf                   = shop.IsSelf,
                BrandLogo                = Core.MallIO.GetImagePath(brandLogo),
                BrandId                  = brandId,
                CashDeposits             = cashDeposits,
                IsSevenDayNoReasonReturn = cashDepositModel.IsSevenDayNoReasonReturn,
                IsCustomerSecurity       = cashDepositModel.IsCustomerSecurity,
                TimelyDelivery           = cashDepositModel.IsTimelyShip
            };
            JsonResult result = Json(model, true);

            Cache.Insert(cacheKey, result, 600);
            return(result);
        }
        public async Task <IActionResult> GetBillOfmaterialAndFinalizeAsync([FromRoute] int id)
        {
            IncentiveBoMRequestItem incentiveBoMRequestItem = _context.IncentiveBoMRequestItem.First(p => p.IncentiveBoMRequestItemId == id);

            if (incentiveBoMRequestItem.IsApproved)
            {
                incentiveBoMRequestItem.IsApproved = false;

                _context.Entry(incentiveBoMRequestItem).State = EntityState.Modified;
            }
            else
            {
                incentiveBoMRequestItem.IsApproved = true;


                _context.Entry(incentiveBoMRequestItem).State = EntityState.Modified;

                ServiceApplication serviceApplication = _context.ServiceApplication.First(p => p.ServiceApplicationId == incentiveBoMRequestItem.ServiceApplicationId);
                serviceApplication.IsActive              = true;
                serviceApplication.EndDate               = DateTime.Now;
                serviceApplication.CurrentStatusId       = 44447;
                _context.Entry(serviceApplication).State = EntityState.Modified;

                ServiceWorkflowHistory serviceWorkflowHistory = new ServiceWorkflowHistory();
                serviceWorkflowHistory.ActionId             = 3;
                serviceWorkflowHistory.StepId               = 8;
                serviceWorkflowHistory.FromStatusId         = 3;
                serviceWorkflowHistory.ToStatusId           = 3;
                serviceWorkflowHistory.PerformedByRoleId    = 3;
                serviceWorkflowHistory.NextStepId           = 9;
                serviceWorkflowHistory.ServiceId            = 1040;
                serviceWorkflowHistory.LegalStatusId        = 3;
                serviceWorkflowHistory.CreatedUserId        = 1;
                serviceWorkflowHistory.IsActive             = true;
                serviceWorkflowHistory.ServiceApplicationId = incentiveBoMRequestItem.ServiceApplicationId;
                _context.ServiceWorkflowHistories.Add(serviceWorkflowHistory);
            }
            try
            {
                await _context.SaveChangesAsync();

                return(CreatedAtAction("GetIncentiveBoMRequestItem", incentiveBoMRequestItem));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IncentiveBoMRequestItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
        }
예제 #26
0
 protected override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     if (IsInstalled())
     {
         var    route    = filterContext.RouteData;
         string allowUrl = Core.Helper.WebHelper.GetRawUrl().ToLower();
         string area     = string.Empty;
         if (route != null)
         {
             area = (route.DataTokens["area"] == null ? "" : route.DataTokens["area"].ToString().ToLower());
         }
         //PC端手动输入移动端地址+wap端+微信端
         if (area == "mobile" || visitorTerminalInfo.Terminal == EnumVisitorTerminal.WeiXin || visitorTerminalInfo.Terminal == EnumVisitorTerminal.Moblie || visitorTerminalInfo.Terminal == EnumVisitorTerminal.PAD)
         {
             if (!allowUrl.Contains("/shopregisterjump/") && !allowUrl.Contains("/shopregister/") && !allowUrl.Contains("/topic/detail/") &&
                 !allowUrl.Contains("/bigwheel/") && !allowUrl.Contains("/scratchcard/") && !allowUrl.Contains("/payment/"))//商家入驻,专题页,大转盘,刮刮卡,移动端支付控制器(小程序支付后异步处理需权限)
             {
                 if (!SiteSettings.IsOpenH5)
                 {
                     var erroView = "~/Areas/Mobile/Views/Shared/Authorize.cshtml";
                     var result   = new ViewResult()
                     {
                         ViewName = erroView
                     };
                     filterContext.Result = result;
                     filterContext.HttpContext.Response.StatusCode = 200;
                     ServiceApplication.DisposeService(filterContext);
                     return;
                 }
             }
         }
         if (visitorTerminalInfo.Terminal == EnumVisitorTerminal.PC && area == "web" && (!allowUrl.Contains("login")) && (!allowUrl.Contains("seleradmin")) && (!allowUrl.Contains("findpassword"))) //不应处理商家后台,登录,找回密码
         {
             if (!allowUrl.Contains("/pay/"))                                                                                                                                                        //支付不需验证
             {
                 if (!SiteSettings.IsOpenPC)
                 {
                     var erroView = "~/Areas/Web/Views/Shared/Authorize.cshtml";
                     var result   = new ViewResult()
                     {
                         ViewName = erroView
                     };
                     filterContext.Result = result;
                     filterContext.HttpContext.Response.StatusCode = 200;
                     ServiceApplication.DisposeService(filterContext);
                     return;
                 }
             }
         }
     }
     //跳转移动端
     JumpMobileUrl(filterContext);
     base.OnActionExecuting(filterContext);
 }
예제 #27
0
        static void Main(string[] args)
        {
            ServiceApplication app = new ServiceApplication();

            app.Init();
            app.StartServices();

            Console.WriteLine("Service is start. Press ENTER key to exit");
            Console.ReadLine();

            app.StopServices();
        }
예제 #28
0
        /// <summary>
        /// 获取轮播图
        /// </summary>
        /// <returns></returns>
        public List <Entities.SlideAdInfo> GetSlideAds()
        {
            ISlideAdsService _ISlideAdsService = ServiceApplication.Create <ISlideAdsService>();
            var sql    = _ISlideAdsService.GetSlidAds(0, Entities.SlideAdInfo.SlideAdType.AppGifts);
            var result = sql.ToList();

            foreach (var item in result)
            {
                item.ImageUrl = HimallIO.GetRomoteImagePath(item.ImageUrl);
            }
            return(result);
        }
예제 #29
0
        public ApplicationRegistrationDefinition ToApplicationRegistrationDefinition()
        {
            var appRegDef = new ApplicationRegistrationDefinition(
                ServiceApplication.ToApplication(),
                ServiceApplicationSP.ToServicePrincipal(),
                ClientApplication.ToApplication(),
                ClientApplicationSP.ToServicePrincipal(),
                AksApplication.ToApplication(),
                AksApplicationSP.ToServicePrincipal(),
                AksApplicationRbacSecret
                );

            return(appRegDef);
        }
예제 #30
0
        public ContentResult EnterpriseNotify_Post(string id, string outid)
        {
            Log.Info("[ENP]" + Core.Helper.WebHelper.GetRawUrl());
            id = DecodePaymentId(id);
            string errorMsg = string.Empty;
            string response = string.Empty;
            var    _iOperationLogService = ServiceApplication.Create <IOperationLogService>();
            var    withdrawId            = long.Parse(outid);
            var    withdrawData          = MemberCapitalApplication.GetApplyWithDrawInfo(withdrawId);

            if (withdrawData == null)
            {
                Log.Info("[EnterpriseNotify]" + id + " ^ " + outid);
                throw new HimallException("参数错误");
            }
            try
            {
                var payment = Core.PluginsManagement.GetPlugin <IPaymentPlugin>(id);
                var payInfo = payment.Biz.ProcessEnterprisePayNotify(HttpContext.Request);
                if (withdrawData.ApplyStatus == Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.PayPending)
                {
                    withdrawData.ApplyStatus = Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess;
                    withdrawData.PayTime     = DateTime.Now;
                    MemberCapitalApplication.ConfirmApplyWithDraw(withdrawData);
                }
                response = payment.Biz.ConfirmPayResult();
            }
            catch (Exception ex)
            {
                //支付失败
                withdrawData.ApplyStatus = Himall.Entities.ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail;
                withdrawData.Remark      = "异步通知失败,请查看日志";
                withdrawData.ConfirmTime = DateTime.Now;
                MemberCapitalApplication.ConfirmApplyWithDraw(withdrawData);
                //操作日志
                _iOperationLogService.AddPlatformOperationLog(new Entities.LogInfo
                {
                    Date        = DateTime.Now,
                    Description = string.Format("会员提现审核失败,提现编号:{0}", outid),
                    IPAddress   = Request.UserHostAddress,
                    PageUrl     = "/Pay/EnterpriseNotify",
                    UserName    = "******",
                    ShopId      = 0
                });
                errorMsg = ex.Message;
                Log.Error("EnterpriseNotify_Post", ex);
            }
            return(Content(response));
        }