Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindPage();
                if (Request.QueryString["roomId"] != null)
                {
                    int.TryParse(Request.QueryString["roomId"], out roomId);

                    T_RoomModel model = new T_RoomBLL().Get(roomId);
                    ActiveUrlTxt.Value = model.ActiveUrl;
                    if (model.IsHot == 1)
                    {
                        cbxIsHot.Checked = true;
                    }
                    OrderNumTxt.Value  = model.OrderNum.ToString();
                    OwnerInfoTxt.Value = model.OwnerInfo;
                    OwnerNameTxt.Value = model.OwnerName;
                    PlatTypeSelet.Items.FindByValue(model.PlatType.ToString()).Selected = true;
                    PlayTimeTxt.Value = model.PlayTime;
                    PlayUrlTxt.Value  = model.PlayUrl;
                    RoomNameTxt.Value = model.RoomName;
                    RoomTypeSelect.Items.FindByValue(model.RoomType.ToString()).Selected = true;

                    StatusSelet.Items.FindByValue(model.Status.ToString()).Selected = true;

                    if (model.RoomBG != "")
                    {
                        ImgRoomBG.Src           = model.RoomBG;
                        HiddenFieldRoomBG.Value = model.RoomBG;
                    }
                }
            }
        }
Esempio n. 2
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);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        public void DelRoom(HttpContext context)
        {
            int roomId = 0;

            if (context.Request["roomId"] != null)
            {
                roomId = int.Parse(context.Request["roomId"]);
            }
            RetInfo <int> result     = new T_RoomBLL().Del(roomId);
            var           serializer = new JavaScriptSerializer();
            var           json       = serializer.Serialize(result);

            context.Response.ContentType = "application/json";
            context.Response.Write(json);
        }
Esempio n. 5
0
        public void uploadRoomBGFile(HttpContext context)
        {
            int roomId = 0;

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

            HttpPostedFile   postedFile = context.Request.Files["Filedata"];
            Stream           _stream    = postedFile.InputStream;
            RetInfo <string> ret        = new T_RoomBLL().UploadPic(_stream, roomId);

            var serializer = new JavaScriptSerializer();
            var json       = serializer.Serialize(new { result = 1, url = ret.Value + "?stamp=" + DateTime.Now.Ticks });

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