public WebDomain GetWebDomain(int id)
        {
            WebDomain            domain   = new WebDomain();
            int                  domainid = GetValueInt("domainid");
            IList <TextAndValue> tv       = new List <TextAndValue>();

            tv.Add(new TextAndValue("@domainid", domainid.ToString()));

            DataSet dsDomain = KinProxyData.GetDataSet(tv, dbname + ".dbo.GetWebDomain");

            domain = (from d in dsDomain.Tables[0].AsEnumerable()
                      select new WebDomain()
            {
                //id,url,descript,imgurl
                id = d.Field <int?>("id") ?? 0,
                url = d.Field <string>("url"),
                descript = d.Field <string>("descript"),
                imgurl = d.Field <string>("imgurl"),
                qq = d.Field <string>("qq"),
                third_party_url = d.Field <string>("third_party_url")
            }).FirstOrDefault();


            return(domain);
        }
Exemple #2
0
        private void service_log_add(long key_id, string title, string content)
        {
            IList <TextAndValue> tv = new List <TextAndValue>();

            tv.Add(new TextAndValue("@key_id", key_id.ToString()));
            tv.Add(new TextAndValue("@title", title));
            tv.Add(new TextAndValue("@content", content));

            KinProxyData.Execute(tv, dbname + ".dbo.service_log_add");
        }
Exemple #3
0
        private void RefundResult(long orderid, string remark, int state)
        {
            IList <TextAndValue> tv = new List <TextAndValue>();

            tv.Add(new TextAndValue("@orderid", orderid.ToString()));
            tv.Add(new TextAndValue("@remark", remark));
            tv.Add(new TextAndValue("@state", state.ToString()));

            KinProxyData.Execute(tv, dbname + ".dbo.s_RefundResult");
        }
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (filterContext != null)
            {
                base.OnActionExecuting(filterContext);
                object s = filterContext.RequestContext.RouteData.Route.GetRouteData(filterContext.HttpContext);
                UserId = SessionManager.GetSessionInstance(filterContext.HttpContext.Request).UserID;
                IList <TextAndValue> tv = new List <TextAndValue>();
                tv.Add(new TextAndValue("@userid", UserId.ToString()));
                DataSet ds = KinProxyData.GetDataSet(tv, dbname + ".dbo.users_GetModel");
                CurrentUser = (from d in ds.Tables[0].AsEnumerable()
                               select new Users()
                {
                    ID = d.Field <int?>("userid") ?? 0,
                    Account = d.Field <string>("account"),
                    Name = d.Field <string>("name"),
                    UserType = d.Field <int>("usertype")
                }).FirstOrDefault();

                if (CurrentUser == null)
                {
                    Response.Redirect("/Login/Index/");
                    return;
                }

                ViewBag.UserID   = UserId;
                UserType         = CurrentUser.UserType;
                ViewBag.UserType = UserType;
                UserName         = CurrentUser.Name;
                ViewData["path"] = filterContext.HttpContext.Request.Url.OriginalString;
                //ViewData["host"] = AppSetting.AppCenter;

                if (this.CurrentUser.ID == 0)
                {
                    Response.Redirect("/Login/Index");
                    return;
                }

                var ss = filterContext.RequestContext.HttpContext.Request.Browser.Type.ToLower().IndexOf("firefox");
                if (Convert.ToInt32(ss) >= 0)
                {
                    var ajaxRequestBeforeRedirect = TempData["__isajaxrequest"] as string;
                    if (ajaxRequestBeforeRedirect != null)
                    {
                        Request.Headers.Add("X-Requested-With", ajaxRequestBeforeRedirect);
                    }
                }
            }
            else
            {
                throw new ArgumentException("filterContext");
            }
        }
        public IList <Category> GetCategoryList()
        {
            IList <TextAndValue> tv      = new List <TextAndValue>();
            DataSet          dsCategory  = KinProxyData.GetDataSet(tv, dbname + ".dbo.Category_GetList");
            IList <Category> categoryLst = (from d in dsCategory.Tables[0].AsEnumerable()
                                            select new Category()
            {
                //cname,cimage,istry,viewtype
                id = d.Field <int?>("id") ?? 0,
                cname = d.Field <string>("cname"),
                cimage = d.Field <string>("cimage"),
                istry = d.Field <int?>("istry") ?? 0,
                viewtype = d.Field <int?>("viewtype") ?? 0
            }).ToList();

            return(categoryLst);
        }
Exemple #6
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        private IList <tbOrder> Get_RefundApply_OrderList()
        {
            IList <tbOrder> lst = new List <tbOrder>();

            IList <TextAndValue> tv = new List <TextAndValue>();
            DataSet ds = KinProxyData.GetDataSet(tv, dbname + ".dbo.s_refundapply_order_getlist");

            lst = ds.Tables[0].AsEnumerable().Select(x => new tbOrder
            {
                //orderid,orderno,cost,paytype
                orderid = x.Field <long>("orderid"),
                orderno = x.Field <string>("orderno"),
                cost    = ParseValueFloat(x["cost"].ToString(), 0),
                paytype = x.Field <int>("paytype")
            }).ToList();

            return(lst);
        }
Exemple #7
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        private IList <MsgBase> GetMsg()
        {
            IList <MsgBase> lst = new List <MsgBase>();

            IList <TextAndValue> tv = new List <TextAndValue>();
            DataSet ds = KinProxyData.GetDataSet(tv, dbname + ".dbo.push_message_send");

            lst = ds.Tables[0].AsEnumerable().Select(x => new MsgBase
            {
                //msgid,device_id,title,content,action,ext
                msgid     = x.Field <long>("msgid"),
                device_id = x.Field <string>("device_id"),
                title     = x.Field <string>("title"),
                content   = x.Field <string>("content"),
                action    = x.Field <int>("action"),
                ext       = ""//x.Field<string>("ext")
            }).ToList();

            return(lst);
        }
        public IList <Channel> GetChannelList(int userid)
        {
            IList <TextAndValue> tv = new List <TextAndValue>();

            tv.Add(new TextAndValue("userid", userid.ToString()));
            DataSet         ds         = KinProxyData.GetDataSet(tv, dbname + ".dbo.Channel_GetList");
            IList <Channel> channelLst = ds.Tables[0].AsEnumerable().Select(x => new Channel
            {
                //id,channelid,passwd,[delay],[role]
                id        = x.Field <int>("id"),
                channelid = x.Field <string>("channelid"),
                passwd    = x.Field <string>("passwd"),
                delay     = x.Field <int>("delay"),
                role      = x.Field <int>("role"),
                discount  = x.Field <int>("discount"),
                contact   = x.Field <string>("contact"),
                remark    = x.Field <string>("remark"),
                ftype     = x.Field <int>("ftype")
            }).ToList();

            return(channelLst);
        }