コード例 #1
0
        /// <summary>
        /// 通过锁号找到房间号,开房方式,房型,开房时间,离开时间
        /// </summary>
        private void GetInfoBySuo()
        {
            string SuoMa = context.Request.QueryString["SuoMa"];

            BLL.SysParameter  bllsys    = new BLL.SysParameter();
            Model.SysParamter modelsyts = bllsys.GetModel(1);
            string            suo       = modelsyts.MarkSuo;

            BLL.SuoRoom          bllss  = new BLL.SuoRoom();
            List <Model.SuoRoom> listss = bllss.GetModelList("SuoType='" + suo + "' and SuoMa='" + SuoMa + "'");
            string roomNumber           = "";
            string res = string.Empty;

            if (listss.Count > 0)
            {
                Model.SuoRoom modelss = listss[0];
                roomNumber = modelss.RoomNumber;
                BLL.occu_infor          blloc   = new BLL.occu_infor();
                List <Model.occu_infor> listocc = blloc.GetModelList("state_id=0 and room_number='" + roomNumber + "'");
                if (listocc.Count > 0)
                {
                    Model.occu_infor modelocc = listocc[0];
                    var obj = new { state = "0", occ_name = modelocc.occ_name.ToString(), occ_time = modelocc.occ_time.ToString(), depar_time = modelocc.depar_time.ToString(), fxxs = RealModel(modelocc.real_mode_id) };
                    res = js.Serialize(obj);
                }
                else
                {
                    var obj = new { state = "1" };
                }
            }
            context.Response.Write(res);
        }