Пример #1
0
        public bool RunGetCoinPrice()
        {
            Log.Info("-----------------开始执行RunGetCoinPrice-------------------");
            try
            {
                Vmp_ConfigCollection coinCoinfig = new Vmp_ConfigCollection();
                if (!coinCoinfig.ListByPlatformCode("Coin"))
                {
                    Log.Info("未查询到coinCoinfig");
                    return(false);
                }
                List <VmpConfigModel> list = new List <VmpConfigModel>();
                list = MapProvider.Map <VmpConfigModel>(coinCoinfig.DataTable);

                List <Task> tasks = new List <Task>();

                //循环配置表
                foreach (VmpConfigModel item in list)
                {
                    tasks.Add(Task.Factory.StartNew(() =>
                    {
                        AddLatePrice jobServcie = new AddLatePrice();
                        jobServcie.TaskExecution(item);
                    }));
                }
                Task.WaitAll(tasks.ToArray());
            }
            catch (Exception ex)
            {
                Log.Error("执行失败", ex);
                throw;
            }
            Log.Info("-----------------结束执行RunGetCoinPrice-------------------");
            return(true);
        }
Пример #2
0
        public ActionResult Details(int?id)
        {
            if (!id.HasValue)
            {
                return(RedirectToAction("index"));
            }
            var model  = new FuncResult <BankAccountViewModel>();
            var daAcct = new Tnet_Bank_Account();

            if (!daAcct.SelectByPk(id.Value))
            {
                model.Message    = "未找到银行卡详细信息";
                model.StatusCode = (int)404;
            }
            else
            {
                model.Success    = true;
                model.StatusCode = 1;
                model.Message    = null;
                model.Content    = MapProvider.Map <BankAccountViewModel>(daAcct.DataRow);
                if (string.IsNullOrEmpty(model.Content.BRANCH_NO))
                {
                    model.Content.BRANCH_NO = "请填写联行号";
                }
                if (!string.IsNullOrEmpty(model.Content.REMARKS))
                {
                    model.Content.REMARKS = xUtils.GetValidateRemarks(model.Content.REMARKS);
                }
            }
            return(View(model));
        }
Пример #3
0
        public bool Upgrade()
        {
            Tvip_Order daOrder = new Tvip_Order();

            if (!daOrder.SelectByPk(this._orderId))
            {
                Alert("找不到指定的订单信息[OrderId=" + this._orderId + "]");
                return(false);
            }
            if (daOrder.Status != (int)OrderStatus.支付成功)
            {
                Alert("订单未支付");
                return(false);
            }
            Tvip_Sub_OrderCollection daSubOrderCollection = new Tvip_Sub_OrderCollection();

            if (!daSubOrderCollection.ListByOrder_Id(this._orderId))
            {
                Alert("找不到指定的订单信息[OrderId=" + this._orderId + "]");
                return(false);
            }
            this.Order           = MapProvider.Map <OrderInfo>(daOrder.DataRow);
            this.Order.SubOrders = MapProvider.Map <SubOrder>(daSubOrderCollection.DataTable);

            if (!DoUpgrade())
            {
                return(false);
            }
            return(true);
        }
Пример #4
0
        public JsonResult GetSQLInfo(int SQLId)
        {
            if (SQLId < 1)
            {
                return(FailResult("SQLId不合法"));
            }
            VViewModel vModel = new VViewModel();
            //获取分类列表
            Tsql_ClassifyCollection daclassifyColl = new Tsql_ClassifyCollection();

            daclassifyColl.SelectClassify();
            Tsql_View daview = new Tsql_View();

            daview.SelectSQLBySqlId(SQLId);
            vModel = MapProvider.Map <VViewModel>(daview.DataRow);
            List <Classify> list = new List <Classify>();

            list = MapProvider.Map <Classify>(daclassifyColl.DataTable);
            vModel.classifylist = new List <Classify>();
            foreach (var item in list)
            {
                vModel.classifylist.Add(item);
            }
            return(SuccessResult(vModel));
        }
Пример #5
0
        protected override List <GrantScope> LoadData()
        {
            Tauth_ScopeCollection daScopeColl = new Tauth_ScopeCollection();

            daScopeColl.ListAll();
            var list = MapProvider.Map <GrantScope>(daScopeColl.DataTable);

            return(list);
        }
Пример #6
0
        /// <summary>
        /// 获取作用域权限列表,GROUP转换为API,仅返回API
        /// </summary>
        /// <param name="scopeIds"></param>
        /// <returns></returns>
        public static List <ScopeApi> GetScopeApis(params int[] scopeIds)
        {
            Vauth_Scope_RightCollection daRightCollection = new Vauth_Scope_RightCollection();

            daRightCollection.ListByScope(scopeIds);
            List <ScopeApi> list = MapProvider.Map <ScopeApi>(daRightCollection.DataTable);

            return(list);
        }
Пример #7
0
        protected override List <OAuthApp> LoadData()
        {
            Tauth_AppCollection daAppCollection = new Tauth_AppCollection();

            daAppCollection.ListAll();
            var list = MapProvider.Map <OAuthApp>(daAppCollection.DataTable);

            return(list);
        }
Пример #8
0
 private void Init(bool force = false)
 {
     if (_verCollection == null || force)
     {
         Tvc_VersionCollection daVerCollection = new Tvc_VersionCollection();
         daVerCollection.ListEffectiveAll();
         _verCollection = MapProvider.Map <AppVersion>(daVerCollection.DataTable);
     }
 }
Пример #9
0
        public JsonResult Index(FormCollection form)
        {
            Tsql_ClassifyCollection daClassifyColl = new Tsql_ClassifyCollection();

            daClassifyColl.ChangePage = this.ChangePage();
            daClassifyColl.SelectClassify();
            List <VclassifyModel> list = MapProvider.Map <VclassifyModel>(daClassifyColl.DataTable);

            return(SuccessResultList(list, daClassifyColl.ChangePage));
        }
Пример #10
0
 public ActionResult LoadMailType()
 {
     NSMPT.DataAccess.Tnsmtp_MailtypeCollection tnsmtp_MailtypeCollection = new DataAccess.Tnsmtp_MailtypeCollection();
     if (tnsmtp_MailtypeCollection.ListMailtype())
     {
         var list = MapProvider.Map <Mailtype>(tnsmtp_MailtypeCollection.DataTable);
         return(SuccessResultList(list, tnsmtp_MailtypeCollection.ChangePage));
     }
     return(FailResult("加载邮箱类型失败!"));
 }
Пример #11
0
        /// <summary>
        /// 获取指定的收货地址列表,分页使用 IChangePage
        /// </summary>
        /// <param name="ownerId">拥有者ID</param>
        /// <param name="ownerType">拥有者类型</param>
        /// <param name="includeDel">是否包含已删除的数据</param>
        /// <returns></returns>
        public List <AddressInfo> List(int ownerId, Address_Owner_Type ownerType, bool includeDel = false)
        {
            var daAddressCollection = new Vnet_Full_AddressCollection();

            daAddressCollection.ChangePage = this.ChangePage;
            daAddressCollection.ListByOwnerId_OwnerType(ownerId, ownerType, includeDel);
            var list = MapProvider.Map <AddressInfo>(daAddressCollection.DataTable);

            return(list);
        }
Пример #12
0
        public List <UserShippingAddress> List(int userId, IChangePage changePage = null)
        {
            Vnet_User_ConsigneeCollection daAddressCollection = new Vnet_User_ConsigneeCollection();

            daAddressCollection.ChangePage = changePage;
            daAddressCollection.ListByUserId(userId);
            var list = MapProvider.Map <UserShippingAddress>(daAddressCollection.DataTable);

            return(list);
        }
Пример #13
0
        // GET: SQLManager
        public ActionResult Index()
        {
            Tsql_ClassifyCollection daClassifyColl = new Tsql_ClassifyCollection();

            daClassifyColl.SelectClassify();
            List <Classify> classifyList = MapProvider.Map <Classify>(daClassifyColl.DataTable);

            ViewBag.JsonClassify = JsonProvider.ToJson(classifyList);
            return(View());
        }
Пример #14
0
 public ActionResult Select()
 {
     CPQaunt.DataAccess.Tcp_ClscriptCollection clscriptCollection = new CPQaunt.DataAccess.Tcp_ClscriptCollection();
     if (clscriptCollection.ListAll())
     {
         var list = MapProvider.Map <DataScriptModel>(clscriptCollection.DataTable);
         return(SuccessResultList(list, clscriptCollection.ChangePage));
     }
     return(FailResult("查询失败!"));
 }
Пример #15
0
 public static BankInfo GetBankInfoById(int bankid)
 {
     if (_bankinfoList == null || _bankinfoList.Count == 0)
     {
         Tnet_BankinfoCollection daBankinfoCOll = new Tnet_BankinfoCollection();
         daBankinfoCOll.ListAll();
         _bankinfoList = MapProvider.Map <BankInfo>(daBankinfoCOll.DataTable);
     }
     return(_bankinfoList.Find(it => it.BankId == bankid));
 }
Пример #16
0
        public static int ForceLoadUserGrantRight(int appId, int userId, string scope, out IEnumerable <int>[] value)
        {
            value = new List <int> [2];
            try
            {
                Tauth_Token daToken = new Tauth_Token();
                if (!daToken.SelectByAppId_UserId(appId, userId))
                {
                    Log.Info("未找到授权记录");
                    return(-1);
                }
                string[] scopeArray = null;
                if (scope.Contains(","))
                {
                    scopeArray = scope.Split(',');
                }
                else
                {
                    scopeArray = new string[] { scope };
                }
                var scopeRights = ScopeRightProvider.GetScopeApis(scopeArray);
                //如果作用域不包含任何权限(仅OpenID),返回已经授权过
                if (scopeRights == null || scopeRights.Count <= 0)
                {
                    Log.Info("授权作用域不包含任何权限");
                    return(1);
                }
                Log.Info("授权作用域包含权限数量{0}", scopeRights.Count);
                var tmp = new List <int>();
                foreach (var sr in scopeRights)
                {
                    tmp.Add(sr.Api_Id);
                }
                value[0] = tmp;
                //value[0] = scopeRights.Select(it => it.Api_Id);
                Tauth_Token_RightCollection daRightCollection = new Tauth_Token_RightCollection();
                daRightCollection.ListEffectiveByTokenId(daToken.Token_Id);

                List <TokenRightApi> apis = MapProvider.Map <TokenRightApi>(daRightCollection.DataTable);
                Log.Info("已经获得的权限有{0}个", apis?.Count);
                var tmp2 = new List <int>();
                foreach (var a in apis)
                {
                    tmp2.Add(a.Api_Id);
                }
                value[1] = tmp2;
                return(0);
            }
            catch (Exception ex)
            {
                Log.Error("检查是否已授权出现错误", ex);
                return(-1);
            }
        }
Пример #17
0
        public ActionResult GetAttchmentList(int recid)
        {
            DataAccess.Tnsmtp_ReceivefileCollection tnsmtp_ReceivefileCollection = new DataAccess.Tnsmtp_ReceivefileCollection();
            if (!tnsmtp_ReceivefileCollection.ListByRecid(recid))
            {
                return(FailResult("查询失败!"));
            }
            var list = MapProvider.Map <Tnsmtp_ReceivefileMap>(tnsmtp_ReceivefileCollection.DataTable);

            return(SuccessResultList(list, tnsmtp_ReceivefileCollection.ChangePage));
        }
Пример #18
0
        public ActionResult ListContact(string keyword, int?Gid)
        {
            DataAccess.Tnsmtp_ContactCollection tnsmtp_ContactgroupCollection = new DataAccess.Tnsmtp_ContactCollection();
            tnsmtp_ContactgroupCollection.ChangePage = this.ChangePage();
            if (!tnsmtp_ContactgroupCollection.ListByUserid(SysUser.UserId, keyword, Gid))
            {
                return(FailResult());
            }
            var list = MapProvider.Map <Tnsmtp_ContactMap>(tnsmtp_ContactgroupCollection.DataTable);

            return(SuccessResultList(list, tnsmtp_ContactgroupCollection.ChangePage));
        }
Пример #19
0
        public ActionResult ListAccount()
        {
            DataAccess.Tnsmtp_AccountCollection tnsmtp_AccountCollection = new DataAccess.Tnsmtp_AccountCollection();
            if (!tnsmtp_AccountCollection.ListByUserId(SysUser.UserId))
            {
                return(FailResult("获取账户失败!"));
            }

            var list = MapProvider.Map <AccountListModel>(tnsmtp_AccountCollection.DataTable);

            return(SuccessResultList(list, tnsmtp_AccountCollection.ChangePage));
        }
Пример #20
0
        public JsonResult Index(FormCollection form)
        {
            int ViewId = form["ViewId"].Safe().ToInt32();
            Tsql_View_RightCollection daViewRight = new Tsql_View_RightCollection();

            daViewRight.ChangePage = this.ChangePage();
            daViewRight.GetViewRightByViewId(ViewId);
            List <VViewRightModel> list = MapProvider.Map <VViewRightModel>(daViewRight.DataTable);

            ViewBag.ViewId = ViewId;
            return(SuccessResultList(list, daViewRight.ChangePage));
        }
Пример #21
0
        /// <summary>
        /// 根据收货地址ID获取收货地址信息
        /// </summary>
        /// <param name="addressId"></param>
        /// <returns></returns>
        public AddressInfo GetAddressById(int addressId)
        {
            Vnet_Full_Address daAddress = new Vnet_Full_Address();

            if (!daAddress.SelectByAddressId(addressId))
            {
                return(null);
            }
            AddressInfo address = MapProvider.Map <AddressInfo>(daAddress.DataRow);

            return(address);
        }
Пример #22
0
        public static Merchant GetMerchant(string code)
        {
            Tgw_Merchant daMer = new Tgw_Merchant();

            if (!daMer.SelectByMerchantCode(code))
            {
                return(null);
            }
            Merchant merchant = MapProvider.Map <Merchant>(daMer.DataRow);

            return(merchant);
        }
Пример #23
0
        /// <summary>
        /// 装载MODEL
        /// </summary>
        /// <param name="configModel"></param>
        /// <param name="priceModel"></param>
        /// <returns></returns>
        private LatePriceCacheBase InsertPrice(VmpConfigModel configModel, LatePriceModel priceModel)
        {
            ///默认交易深度50条
            int specifiedQuantity = 50;
            int askscount         = priceModel.Asks.Count;
            int bidscount         = priceModel.Bids.Count;

            if (askscount > specifiedQuantity)
            {
                askscount = specifiedQuantity;
            }
            if (bidscount > specifiedQuantity)
            {
                askscount = specifiedQuantity;
            }

            List <PriceModel> ListAsks = priceModel.Asks.OrderBy(p => p.price).Take(specifiedQuantity).ToList();
            List <PriceModel> ListBids = priceModel.Bids.OrderByDescending(p => p.price).Take(specifiedQuantity).ToList();

            List <TickModel> bidTick = new List <TickModel>();

            for (int i = 0; i < bidscount; i++)
            {
                TickModel bidMode = new TickModel();
                bidMode.Amount = ListBids[i].amount;
                bidMode.Price  = ListBids[i].price;
                bidMode.Sort   = i;
                bidTick.Add(bidMode);
            }

            List <TickModel> askTick = new List <TickModel>();

            for (int k = 0; k < askscount; k++)
            {
                TickModel askModel = new TickModel();
                askModel.Amount = ListAsks[k].amount;
                askModel.Price  = ListAsks[k].price;
                askModel.Sort   = k;
                askTick.Add(askModel);
            }
            LatePriceCacheBase priceCache = new LatePriceCacheBase();
            LatePriceCacheBase tempPrice  = MapProvider.Map(priceCache, configModel);

            tempPrice.LateTime  = DateTime.Now;
            tempPrice.BuyPrice  = ListBids.FirstOrDefault().price;
            tempPrice.BuyCount  = ListBids.FirstOrDefault().amount;
            tempPrice.SellPrice = ListAsks.FirstOrDefault().price;
            tempPrice.SellCount = ListAsks.FirstOrDefault().amount;
            tempPrice.Asks      = askTick;
            tempPrice.Bids      = bidTick;

            return(tempPrice);
        }
Пример #24
0
        private ConsigneeInfo GetConsigneeInfo(int consigneeId)
        {
            Tnet_Consignee daConsignee = new Tnet_Consignee();

            if (!daConsignee.SelectByPk(consigneeId))
            {
                return(null);
            }
            ConsigneeInfo consignee = MapProvider.Map <ConsigneeInfo>(daConsignee.DataRow);

            return(consignee);
        }
Пример #25
0
        public ActionResult ListTemp()
        {
            DataAccess.Tnsmtp_MailtemplateCollection collection = new DataAccess.Tnsmtp_MailtemplateCollection();
            collection.ChangePage = this.ChangePage();
            if (!collection.ListByUserid(SysUser.UserId))
            {
                return(FailResult("查询失败"));
            }
            var list = MapProvider.Map <Entites.Tnsmtp_MailtemplateMap>(collection.DataTable);

            return(SuccessResultList(list, collection.ChangePage));
        }
Пример #26
0
        public ActionResult List()
        {
            DataAccess.Tnsmtp_SpidermailCollection tnsmtp_SpidermailCollection = new DataAccess.Tnsmtp_SpidermailCollection();
            tnsmtp_SpidermailCollection.ChangePage = this.ChangePage();

            if (!tnsmtp_SpidermailCollection.ListByAllSp())
            {
                return(FailResult("查询失败!"));
            }
            var list = MapProvider.Map <Tnsmtp_SpidermailMap>(tnsmtp_SpidermailCollection.DataTable);

            return(SuccessResultList(list, tnsmtp_SpidermailCollection.ChangePage));
        }
Пример #27
0
        public ActionResult List(string keywords)
        {
            DataAccess.Tnsmtp_EmailCollection tnsmtp_EmailCollection = new DataAccess.Tnsmtp_EmailCollection();
            tnsmtp_EmailCollection.ChangePage = this.ChangePage();

            if (!tnsmtp_EmailCollection.ListDraftByUserid(SysUser.UserId, keywords))
            {
                return(FailResult("查询失败!"));
            }
            var list = MapProvider.Map <Tnsmtp_EmailMap>(tnsmtp_EmailCollection.DataTable);

            return(SuccessResultList(list, tnsmtp_EmailCollection.ChangePage));
        }
Пример #28
0
        public ActionResult ListGroup()
        {
            DataAccess.Tnsmtp_ContactgroupCollection collection = new DataAccess.Tnsmtp_ContactgroupCollection();
            collection.ChangePage = this.ChangePage();

            if (!collection.ListByUserid(SysUser.UserId))
            {
                return(FailResult("获取列表信息失败! "));
            }

            var list = MapProvider.Map <Tnsmtp_ContactgroupMap>(collection.DataTable);

            return(SuccessResultList(list, collection.ChangePage));
        }
Пример #29
0
        public ActionResult Load()
        {
            int lid = int.Parse(Request.Form["lid"]);

            Tcp_Clscript tcp = new Tcp_Clscript();

            if (tcp.SelectByPK(lid))
            {
                var model = MapProvider.Map <DataScriptModel>(tcp.DataRow);
                return(JsonResult(model));
            }

            return(FailResult("查询失败!"));
        }
Пример #30
0
        /// <summary>
        /// 获取作用域权限列表,GROUP转换为API,仅返回API
        /// </summary>
        /// <param name="scopeCodes"></param>
        /// <returns></returns>
        public static List <ScopeApi> GetScopeApis(params string[] scopeCodes)
        {
            Tauth_ScopeCollection daScopeCollection = new Tauth_ScopeCollection();

            daScopeCollection.ListByScopes(scopeCodes);
            if (daScopeCollection.Count <= 0)
            {
                return(null);
            }
            List <GrantScope> list = MapProvider.Map <GrantScope>(daScopeCollection.DataTable);
            var scopeids           = list.Select(it => it.SCOPE_ID);

            return(GetScopeApis(scopeids.ToArray()));
        }