Пример #1
0
        public void loadroomlist(HttpContext context)
        {
            int curpage = 1;

            if (context.Request["curpage"] != null)
            {
                curpage = int.Parse(context.Request["curpage"]);
            }
            int userId = 0;

            if (context.Request["userid"] != null)
            {
                userId = int.Parse(context.Request["userid"]);
            }
            string type = "";

            if (context.Request["type"] != null)
            {
                type = context.Request["type"];
            }
            int ListPageNum         = 1;
            List <T_RoomModel> list = new T_RoomBLL().GetPageT_RoomModelList(type, userId, 16, curpage, ref ListPageNum);

            list.ForEach(e => e = new RoomLiveBLL().getRoomLive(e));

            RetInfo <List <T_RoomModel> > result = new RetInfo <List <T_RoomModel> >()
            {
                Code = 0, Value = list
            };
            var serializer = new JavaScriptSerializer();
            var json       = serializer.Serialize(result);

            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }
Пример #2
0
        public void GetCollectNum(HttpContext context)
        {
            int roomId = 0;

            if (context.Request["roomId"] != null)
            {
                roomId = int.Parse(context.Request["roomId"]);
            }


            RetInfo <int> result = new RetInfo <int>()
            {
                Code = 0, Value = 0
            };

            T_RoomModel item = new T_RoomBLL().Get(roomId);

            if (item != null)
            {
                result.Value = item.CollectNum;
            }
            var serializer = new JavaScriptSerializer();
            var json       = serializer.Serialize(result);

            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }
Пример #3
0
        public async Task <string> AutoSendInventary830(string Force = "false")
        {
            string Idusr = HttpContext.Session.GetObjSession <string>("Session.CodUsr");

            if (string.IsNullOrEmpty(Idusr))
            {
                return(string.Empty);
            }
            RetInfo RetReporteO = await ApiClientFactory.Instance.AutoSendInventary830(Force, Idusr);

            return("");
        }
Пример #4
0
        public RetInfo <int> Del(int roomId)
        {
            RetInfo <int> ret = new RetInfo <int>()
            {
                Code = 0
            };
            int i = new T_RoomDAL().Del(roomId);

            if (i < 1)
            {
                ret.Code = -1;
            }

            return(ret);
        }
Пример #5
0
        public void bindcomment(HttpContext context)
        {
            int roomId = 0;

            if (context.Request["roomId"] != null)
            {
                roomId = int.Parse(context.Request["roomId"]);
            }

            List <T_CommentModel>            list   = new CommentBLL().GetList(roomId);
            RetInfo <List <T_CommentModel> > result = new RetInfo <List <T_CommentModel> >()
            {
                Code = 0, Value = list
            };
            var serializer = new JavaScriptSerializer();
            var json       = serializer.Serialize(result);

            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }
Пример #6
0
        public RetInfo <string> UploadPic(Stream stream, int roomId, string type = "live")
        {
            var ret = new RetInfo <string> {
                Code = 0, Msg = "success"
            };

            try
            {
                //Log.ErrorFormat("【RpgMapsBll】-【UploadPic】上传文件 start,categoryId:{0}", categoryId);
                //var bytes = new byte[stream.Length];
                //stream.Read(bytes, 0, bytes.Length);

                var param = new Dictionary <string, string> {
                    { "type", type },
                    { "routeId", DateTime.Now.ToString("MMddhhmmss") },
                    { "ext", ".jpg" }
                };

                ret = FileUploadBLL.PostFile(stream, param);

                //Log.ErrorFormat("【RpgMapsBll】-【UploadPic】上传文件 PostFile,bytes.Length:{0}", bytes.Length);
                //var result = HttpFunction.PostFile("http://115.159.106.86:8697/upload.ashx", bytes, param);
                //ret = JsonSerializer.DeserializeFromString<RetInfo<string>>(result);

                if (ret.Code == 0)
                {
                    ret.Value = ret.Value;
                }
            }
            catch (Exception e)
            {
                Log.ErrorFormat("【T_RoomBLL】-【UploadPic】上传文件异常,msg:{0}", e.ToString());
                ret.Code = -1000;
                ret.Msg  = "上传图片异常";
            }
            return(ret);
        }
Пример #7
0
        public void addcomment(HttpContext context)
        {
            RetInfo <string> result = new RetInfo <string>()
            {
                Code = 0
            };

            try
            {
                int roomId = 0;
                if (context.Request["roomId"] != null)
                {
                    roomId = int.Parse(context.Request["roomId"]);
                }
                int userId = 0;
                if (context.Request["userId"] != null)
                {
                    userId = int.Parse(context.Request["userId"]);
                }
                string comment = "";
                if (context.Request["Comment"] != null)
                {
                    comment = context.Request["Comment"];
                }



                bool isSave = new CommentBLL().CheckUserComment(roomId, userId, comment);
                if (isSave == true)
                {
                    result.Msg = "您已提交过当前评论";
                }
                else
                {
                    int i = new CommentBLL().AddComment(new T_CommentUserModel()
                    {
                        CommentTxt = comment, RoomId = roomId, UserId = userId
                    });
                    if (i > 0)
                    {
                        result.Msg = "提交成功";
                    }
                    else
                    {
                        result.Msg = "提交失败";
                    }
                }
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("PageActionRequert.addcomment msg:{0}", ex.Message);
                result.Code = -1;
                result.Msg  = "提交出错";
            }

            var serializer = new JavaScriptSerializer();
            var json       = serializer.Serialize(result);

            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }