Exemple #1
0
 /// <summary>
 ///  查询用户信息
 /// </summary>
 /// <param name="context"></param>
 public void GetUserInfo(HttpContext context)
 {
     try
     {
         Hashtable ht = new Hashtable();
         if (!string.IsNullOrEmpty(context.Request["LoginName"]))
         {
             ht.Add("LoginName", context.Request["LoginName"].ToString());
         }
         if (!string.IsNullOrEmpty(context.Request["Name"]))
         {
             ht.Add("Name", context.Request["Name"].ToString());
         }
         if (!string.IsNullOrEmpty(context.Request["Phone"]))
         {
             ht.Add("Phone", context.Request["Phone"].ToString());
         }
         ht.Add("PageIndex", context.Request["PageIndex"].ToString());
         ht.Add("PageSize", context.Request["PageSize"].ToString());
         jsonModel = new Bll.MeetingWebBll().GetUserInfo(ht);
     }
     catch (Exception ex)
     {
         LogHelper.Debug(ex.Message);
     }
     finally
     {
         context.Response.Write("({\"result\":" + jss.Serialize(jsonModel) + "})");
     }
 }
Exemple #2
0
        public Bll.jsonModel.JsonModel GetMeeting(Hashtable ht)
        {
            try
            {
                //增加起始条数、结束条数
                ht = common.AddStartEndIndex(ht);
                int PageIndex = Convert.ToInt32(ht["PageIndex"]);
                int PageSize  = Convert.ToInt32(ht["PageSize"]);

                DataTable dt = new DLL.MeetingWebDll().GetMeeting(ht);
                //定义分页数据实体
                PagedDataModel <Dictionary <string, object> > pagedDataModel = null;
                //定义JSON标准格式实体中
                Bll.jsonModel.JsonModel jsonModel = null;
                if (dt.Rows.Count <= 0)
                {
                    jsonModel = new Bll.jsonModel.JsonModel()
                    {
                        Status = "no",
                        Msg    = "无数据"
                    };
                    return(jsonModel);
                }
                List <Dictionary <string, object> > list = new List <Dictionary <string, object> >();
                list = common.DataTableToList(dt);
                //总条数
                int RowCount = Convert.ToInt32(ht["RowCount"].ToString());
                //总页数
                int PageCount = (int)Math.Ceiling(RowCount * 1.0 / PageSize);
                //将数据封装到PagedDataModel分页数据实体中
                pagedDataModel = new PagedDataModel <Dictionary <string, object> >()
                {
                    PageCount = PageCount,
                    PagedData = list,
                    PageIndex = PageIndex,
                    PageSize  = PageSize,
                    RowCount  = RowCount
                };
                //将分页数据实体封装到JSON标准实体中
                jsonModel = new Bll.jsonModel.JsonModel()
                {
                    Data    = pagedDataModel,
                    Msg     = "",
                    Status  = "ok",
                    BackUrl = ""
                };
                return(jsonModel);
            }
            catch (Exception ex)
            {
                Bll.jsonModel.JsonModel jsonModel = new Bll.jsonModel.JsonModel();
                jsonModel.Status = "error";
                jsonModel.Msg    = ex.ToString();
                return(jsonModel);
            }
        }
Exemple #3
0
 /// <summary>
 /// 根据ID查询人员信息
 /// </summary>
 /// <param name="context"></param>
 public void BindUserInfo(HttpContext context)
 {
     try
     {
         string id = context.Request["id"];
         jsonModel = new Bll.MeetingWebBll().BindUserInfo(id);
     }
     catch (Exception ex)
     {
         LogHelper.Debug(ex.Message);
     }
     finally
     {
         context.Response.Write("({\"result\":" + jss.Serialize(jsonModel) + "})");
     }
 }
Exemple #4
0
 /// <summary>
 /// 查询会议室
 /// </summary>
 /// <param name="context"></param>
 public void GetMeeting(HttpContext context)
 {
     try
     {
         Hashtable ht = new Hashtable();
         if (!string.IsNullOrEmpty(context.Request["MeetingName"]))
         {
             ht.Add("MeetingName", context.Request["MeetingName"].ToString());
         }
         ht.Add("PageIndex", context.Request["PageIndex"].ToString());
         ht.Add("PageSize", context.Request["PageSize"].ToString());
         jsonModel = new Bll.MeetingWebBll().GetMeeting(ht);
     }
     finally
     {
         context.Response.Write("({\"result\":" + jss.Serialize(jsonModel) + "})");
     }
 }