Exemple #1
0
        public HttpResponseMessage bd03s(int CurrPage, int PageSize, string Select_Org, string Select_Dept, string Select_Id, string Select_Name)
        {
            try
            {
                //總數量
                int TotalRow = 0;
                if (Select_Id == null || Select_Id == "")
                {
                    Select_Id = "all";
                }
                if (Select_Name == null || Select_Name == "")
                {
                    Select_Name = "all";
                }
                //向BLL取得資料
                var datas = service.Get(CurrPage, PageSize, Select_Org, Select_Dept, Select_Id, Select_Name, out TotalRow);

                //回傳一個JSON Object
                var Rvl = new { Total = TotalRow, Data = datas };
                return(Request.CreateResponse(HttpStatusCode.OK, Rvl));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message.ToString()));
            }
        }
Exemple #2
0
 //取得所有使用者資料
 public HttpResponseMessage Get()
 {
     try
     {
         BD03Service BD03      = new BD03Service();
         var         bd03datas = BD03.Get();
         return(Request.CreateResponse(HttpStatusCode.OK, bd03datas));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message.ToString()));
     }
 }