Esempio n. 1
0
        public HttpResponseMessage PackageDetial(dynamic SearchForm)
        {
            try
            {
                string PackageId = string.Empty;
                PackageId = (string)SearchForm.PackageId;
                string    OutMsg = "No records found";
                UserClass CLE    = new UserClass();
                DataTable DT     = new DataTable();
                DT = CLE.Fn_PackageDetial(PackageId);

                List <PackageEntity> UserList = new List <PackageEntity>();
                if (DT.Rows.Count > 0)
                {
                    UserList = (from DataRow dr in DT.Rows
                                select new PackageEntity()
                    {
                        srno = dr["srno"].ToString(),
                        Pname = dr["Pname"].ToString(),
                        Amount = dr["Amount"].ToString(),
                        JoinFor = dr["JoinFor"].ToString(),
                        Points = (dr["Points"]).ToString(),
                    }).ToList();
                    return(Request.CreateResponse(HttpStatusCode.OK, UserList));
                }

                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, OutMsg));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "500_Internal_Server_Error"));
            }
        }