public static List <ServiceDirectoryDetail> GetServiceDirDetails(ServiceDirDetail serv)
        {
            try
            {
                var serviceDirId = new MySqlParameter("?serviceDirId", serv.serviceDirId);

                var Result = _DBTouchbase.ExecuteStoreQuery <ServiceDirectoryDetail>("CALL V3_USPGetServiceDirectoryDetail(?serviceDirId)", serviceDirId).ToList();

                foreach (ServiceDirectoryDetail service in Result)
                {
                    if (!string.IsNullOrEmpty(service.serviceImage))
                    {
                        string profile_Image = service.serviceImage.ToString();
                        string path          = ConfigurationManager.AppSettings["imgPath"] + "Documents/servicedirectory/Group" + serv.groupId + "/";

                        service.serviceImage      = path + profile_Image;            //actual image URL
                        service.serviceThumbimage = path + "thumb/" + profile_Image; //thumb image URL
                    }
                    else
                    {
                        service.serviceThumbimage = "";
                    }
                }

                return(Result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public object GetServiceDirectoryDetails(ServiceDirDetail serv)
        {
            dynamic       TBServiceDirectoryListResult;
            List <object> ServiceDirectoryListResult = new List <object>();

            try
            {
                //string a = HttpContext.Current.Request.HttpMethod;
                List <ServiceDirectoryDetail> Result = ServiceDirectory.GetServiceDirDetails(serv);
                for (int i = 0; i < Result.Count; i++)
                {
                    ServiceDirectoryListResult.Add(new { ServiceDirList = Result[i] });
                }

                if (Result != null && Result.Count != 0)
                {
                    TBServiceDirectoryListResult = new { status = "0", message = "success", ServiceDirListResult = ServiceDirectoryListResult };
                }
                else
                {
                    TBServiceDirectoryListResult = new { status = "1", message = "Record not found", ServiceDirListResult = ServiceDirectoryListResult };
                }
            }
            catch
            {
                TBServiceDirectoryListResult = new { status = "1", message = "failed" };
            }

            return(new { TBServiceDirectoryListResult });
        }