Example #1
0
 public JsonResult GetCities()
 {
     try
     {
         var cities   = CommonBusiness.GetCities();
         var response = new ApiRespnoseWrapper {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 cities
             }
         };
         return(new JsonResult {
             Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
 public JsonResult AddEmployeeExperience(EmployeeExperienceModel model)
 {
     try
     {
         var result   = EmployeeBusiness.AddEmployeeExperience(model);
         var response = new ApiRespnoseWrapper {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult {
             Data = response
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
Example #3
0
 public JsonResult GetStudentInfoForEdit(int id)
 {
     try
     {
         var result   = StudentBusiness.GetStudentInfoForEdit(id);
         var response = new ApiRespnoseWrapper {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult {
             Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
 public JsonResult GetApplications(int id)
 {
     try
     {
         var jobs = CorporateBusiness.GetAppliedPosts(id);
         //var internships = CorporateBusiness.GetInternships(new PostFilterModel() { postType = 2, userId = id });
         var response = new ApiRespnoseWrapper {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 jobs
             }
         };
         return(new JsonResult {
             Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
 public JsonResult GetSingleBlog(int Id)
 {
     try
     {
         var results  = BlogBusiness.GetSingleBlog(Id);
         var response = new ApiRespnoseWrapper {
             Status = ApiRespnoseStatus.Success, Results = new ArrayList()
             {
                 results
             }
         };
         return(new JsonResult {
             Data = response
         });
     }
     catch (Exception ex)
     {
         CommonFunctions.LogDetails(ex, null);
         return(CommonBusiness.GetErrorResponse());
     }
 }
 public JsonResult GetAllBlogs()
 {
     try
     {
         var results  = BlogBusiness.GetAllBlogs();
         var response = new ApiRespnoseWrapper {
             Status = ApiRespnoseStatus.Success, Results = new ArrayList()
             {
                 results
             }
         };
         return(new JsonResult {
             Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         CommonFunctions.LogDetails(ex, null);
         return(CommonBusiness.GetErrorResponse());
     }
 }
 public JsonResult DoLogin(LoginViewModel model)
 {
     try
     {
         var result   = AccountBusiness.ValidateUser(model);
         var response = new ApiRespnoseWrapper {
             Status = ApiRespnoseStatus.Success, Results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult {
             Data = response
         });
     }
     catch (Exception ex)
     {
         CommonFunctions.LogDetails(ex, null);
         return(CommonBusiness.GetErrorResponse());
     }
 }
Example #8
0
 public JsonResult DeleteNotice(int id)
 {
     try
     {
         var result = NoticeBusiness.DeleteNotice(id);
         var data   = new ApiRespnoseWrapper()
         {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult()
         {
             Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
Example #9
0
 public JsonResult AddOrUpdateNotice(NoticeModel model)
 {
     try
     {
         var result = NoticeBusiness.AddOrUpdateNotice(model);
         var data   = new ApiRespnoseWrapper()
         {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult()
         {
             Data = data
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
Example #10
0
 public JsonResult Login(LoginRequestModel model)
 {
     try
     {
         var result = AccountBusiness.Login(model);
         var data   = new ApiRespnoseWrapper()
         {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result
             }
         };
         return(new JsonResult()
         {
             Data = data
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
Example #11
0
 public JsonResult GetCommonDataForFilters()
 {
     try
     {
         var cities         = CommonBusiness.GetCities();
         var skills         = CommonBusiness.GetSkills();
         var tags           = CommonBusiness.GetTags();
         var salaryDivision = CommonBusiness.GetSalaryDivision();
         var response       = new ApiRespnoseWrapper {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 cities, skills, tags, salaryDivision
             }
         };
         return(new JsonResult {
             Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
Example #12
0
 public JsonResult GetNotices(NoticeFilterModel model)
 {
     try
     {
         int recordsCount = 0;
         var result       = NoticeBusiness.GetNotices(model, ref recordsCount);
         var pages        = CommonBusiness.GetPages(recordsCount);
         var data         = new ApiRespnoseWrapper()
         {
             status = ApiRespnoseStatus.Success, results = new ArrayList()
             {
                 result, pages
             }
         };
         return(new JsonResult()
         {
             Data = data
         });
     }
     catch (Exception ex)
     {
         return(CommonBusiness.GetErrorResponse(ex.Message));
     }
 }
Example #13
0
 public JsonResult LoadAllComments(int blogId)
 {
     try
     {
         if (blogId != 0)
         {
             var result   = CommentBusiness.LoadAllComments(blogId);
             var response = new ApiRespnoseWrapper {
                 Status = ApiRespnoseStatus.Success, Results = new ArrayList()
                 {
                     result
                 }
             };
             return(new JsonResult {
                 Data = response
             });
         }
         else
         {
             var response = new ApiRespnoseWrapper {
                 Status = ApiRespnoseStatus.Failed, Results = new ArrayList()
                 {
                     "No Blog found"
                 }
             };
             return(new JsonResult {
                 Data = response
             });
         }
     }
     catch (Exception ex)
     {
         CommonFunctions.LogDetails(ex, null);
         return(CommonBusiness.GetErrorResponse());
     }
 }
Example #14
0
 public JsonResult AddNewComment(CommentModelDTO model)
 {
     try
     {
         var addStatus = CommentBusiness.AddNewComment(model);
         if (addStatus == "Success")
         {
             var response = new ApiRespnoseWrapper {
                 Status = ApiRespnoseStatus.Success, Results = new ArrayList()
                 {
                     addStatus
                 }
             };
             return(new JsonResult {
                 Data = response
             });
         }
         else
         {
             var response = new ApiRespnoseWrapper {
                 Status = ApiRespnoseStatus.Failed, Results = new ArrayList()
                 {
                     addStatus
                 }
             };
             return(new JsonResult {
                 Data = response
             });
         }
     }
     catch (Exception ex)
     {
         CommonFunctions.LogDetails(ex, null);
         return(CommonBusiness.GetErrorResponse());
     }
 }