// GET: RolePermission public async Task <ActionResult> Index() { //ViewBag.Roles = _applicationDbContext.Roles.Where(m => m.Name != "Admin").ToList(); ViewBag.Roles = await APIHelpers.GetAsync <List <RolesViewModel> >("api/RolePermission/GetRoles"); return(View()); }
public async Task <ActionResult> ApproveLeave(Guid id, string email) { try { var data = await APIHelpers.GetAsync <bool>("api/Leave/ApproveLeaves/" + id); if (data == true) { var emp = await APIHelpers.GetAsync <Employee>("api/Employee/GetEmployee?Email=" + email); var leave = await APIHelpers.GetAsync <Leave>("api/Leave/Get/" + id); //emp.AvailableLeaves = emp.AvailableLeaves - (leave.To.Day - leave.From.Day); await APIHelpers.PutAsync <Employee>("api/Employee/Put", emp); var subject = "Leave"; var body = "Congratulations!! Your Leave has been Approved."; //CommonHelper.SendMail(email, subject, body); return(RedirectToAction("GetPendingLeave", "Leave")); } else { return(HttpNotFound()); } } catch (Exception ex) { throw; } }
public async Task <ActionResult> Contact() { try { var temp = CommonHelper.GetUser(); ViewBag.User = this.applicationDbContext.Users.Select(x => new UserViewModel() { Name = x.FirstName + " " + x.LastName, Id = x.Id }).ToList(); //List<Report> Report = new List<Report>(); //var user = CommonHelper.GetUser(); //ViewBag.User = this.applicationDbContext.Users.Select(x => new UserViewModel() { Name = x.FirstName + " " + x.LastName, Id = x.Id }).ToList(); //ReportFilter model = new ReportFilter(); //model.IsSuperAdmin = user.IsSuperAdmin; //model.Report = new List<Report>(); //if (user != null && user.IsSuperAdmin) //{ // return View(model); //} //else //{ // var id = Guid.Parse(user.Id); // var data = this.applicationDbContext.TimeTrackings.Where(_ => _.UserId == id).ToList(); // model = NewMethod(model, data); // return View(model); //} var data = await APIHelpers.GetAsync <ReportFilter>("api/Reports/Contect?admin=" + temp.IsSuperAdmin + "&id1=" + temp.Id); return(View(data)); } catch (Exception ex) { throw; } }
// GET: Dashboard public async Task <ActionResult> Index() { try { var data = await APIHelpers.GetAsync <DashboardCounts>("api/Dashboard/DashboardCounts"); var temp = await APIHelpers.GetAsync <List <MonthBirthdays> >("api/Dashboard/GetMonthBirthdays"); DashboardViewModel model = new DashboardViewModel { TotalEmployee = data.TotalEmployee, TotalDeveloper = data.TotalDeveloper, TotalHR = data.TotalHR, TotalPM = data.TotalPM, TotalSales = data.TotalSales, TotalProjects = data.TotalProjects, MonthBirthdays = temp }; //data.BirthDays = temp.BirthDays; return(View(model)); } catch (Exception ex) { throw; } }
public async Task <ActionResult> Post(IdentityRole role) { try { ModelState.Remove("Id"); if (ModelState.IsValid) { role.Id = Convert.ToString(Guid.NewGuid()); appcontext.Roles.Add(role); await appcontext.SaveChangesAsync(); bool data = await APIHelpers.GetAsync <bool>("api/RolePermission/PostRoles/" + role.Id); TempData["sucess"] = CommonResources.create; return(RedirectToAction("Index")); } else { TempData["error"] = CommonResources.error; return(View(role)); } } catch (Exception ex) { TempData["error"] = CommonResources.error; throw; } }
// GET: State public async Task <ActionResult> Index() { ViewBag.Country = await APIHelpers.GetAsync <List <Countries> >("api/Country/GetCountries"); var data = await APIHelpers.GetAsync <List <States> >("api/State/Getstates"); return(View(data.ToList())); }
// GET: TemplateType public async Task <ActionResult> Index() { var data = await APIHelpers.GetAsync <List <TemplatesType> >("api/TemplateType/GetTemplateTypes"); if (data == null) { data = new List <TemplatesType>(); } return(View(data.ToList())); }
// GET: Interview public async Task <ActionResult> Index() { var data = await APIHelpers.GetAsync <List <DisplayInterviewModel> >("api/Interview/GetInterviewsList"); if (data == null) { data = new List <DisplayInterviewModel>(); } return(View(data.ToList())); }
// GET: Opening public async Task <ActionResult> Index() { var data = await APIHelpers.GetAsync <List <OpeningsViewModel> >("api/Openings/GetOpenings"); if (data == null) { data = new List <OpeningsViewModel>(); } return(View(data)); }
// GET: Candidate public async Task <ActionResult> Index() { var data = await APIHelpers.GetAsync <List <DisplayCandidateViewModel> >("api/Candidate/GetCandidateList"); ViewBag.Technology = await APIHelpers.GetAsync <List <Technologies> >("api/Technology/GetTechnologies"); ViewBag.Skills = await APIHelpers.GetAsync <List <Skills> >("api/Skill/GetSkills"); return(View(data)); }
// GET: Candidate/Create public async Task <ActionResult> Create() { ViewBag.Designation = await APIHelpers.GetAsync <List <Designation> >("api/Designation/GetDesignations"); ViewBag.Skills = await APIHelpers.GetAsync <List <Skills> >("api/Skill/GetSkills"); ViewBag.Technology = await APIHelpers.GetAsync <List <Technologies> >("api/Technology/GetTechnologies"); return(View()); }
public async Task <ActionResult> Profile(EmployeeUserViewModel collection) { try { ViewBag.Department = await APIHelpers.GetAsync <List <Departments> >("api/Department/GetDepartments"); ViewBag.Skills = await APIHelpers.GetAsync <List <Skills> >("api/Skill/GetSkills"); string skills = string.Join(",", Request["Skill"]); collection.Skills = skills; await APIHelpers.PutAsync <Employee>("api/Employee/Put", collection); TempData["sucess"] = EmployeeResources.update; //string dob = Request["BirthDate"]; //string skills = string.Join(",", Request["Skill"]); //ModelState.Remove("BirthDate"); //ModelState.Remove("LeaveBalance"); ////var month = (13 - DateTime.Now.Month) * 1.5; //if (ModelState.IsValid) //{ // collection.BirthDate = DateTime.ParseExact(dob, "dd/MMM/yyyy", null); // collection.LeaveBalance = Convert.ToDecimal(15); // collection.Skills = skills; // // TODO: Add insert logic here // if (collection.Id == Guid.Empty) // { // var user = new ApplicationUser { RoleId = collection.RoleId, UserName = collection.Email, IsSuperAdmin = false, ParentUserID = Guid.Parse("06644856-45f6-4c78-9c19-60781abba7e3"), Email = collection.Email, FirstName = "", LastName = "", UserStatus = 0 }; // collection.UserId = Guid.Parse(user.Id); // var result = await UserManager.CreateAsync(user, collection.Password); // if (result.Succeeded) // { // await APIHelpers.PostAsync<Employee>("api/Employee/Post", collection); // TempData["sucess"] = EmployeeResources.create; // } // } // else // { // await APIHelpers.PutAsync<Employee>("api/Employee/Put", collection); // TempData["sucess"] = EmployeeResources.update; // } return(View("Profile", collection)); //} //else //{ // return View(collection); //} } catch (Exception ex) { TempData["error"] = CommonResources.error; return(RedirectToAction("AccessDenied", "Error")); } }
// GET: Notification/Edit/5 public async Task <ActionResult> Edit(Guid id) { try { return(View("Create", await APIHelpers.GetAsync <Notifications>("api/Notification/Get/" + id))); } catch (Exception ex) { return(RedirectToAction("AccessDenied", "Error")); } }
// GET: Cities public async Task <ActionResult> Index() { //var data2 = await APIHelpers.GetAsync<List<Notifications>>("api/Notification/GetNotifications"); var data2 = await APIHelpers.GetAsync <List <Notifications> >("api/Notification/GetMessage"); ViewBag.States = await APIHelpers.GetAsync <List <States> >("api/State/GetStates"); var data = await APIHelpers.GetAsync <List <City> >("api/City/GetCities"); return(View(data.ToList())); }
// GET: Interview/Create public async Task <ActionResult> Create() { //var data = await APIHelpers.GetAsync<List<Candidates>>("api/Candidate/GetCandidates"); //ViewBag.Candidate = new SelectList(data, "Id", "Name", "Email"); ViewBag.Employee = await APIHelpers.GetAsync <List <Employee> >("api/Employee/GetEmployees"); ViewBag.emp = new Employee(); ViewBag.sdate = DateTime.Now.ToString("MM/dd/yyyy"); ViewBag.stime = DateTime.Now.ToString("HH:mm"); return(View()); }
public async Task <JsonResult> SkillWiseUserData() { try { var data = await APIHelpers.GetAsync <List <ChartViewModel> >("api/Dashboard/SkillWiseUsers"); return(Json(data, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
public async Task <JsonResult> EmployeeDetails(Guid id) { try { var data = await APIHelpers.GetAsync <Employee>("api/Employee/Get/" + id); return(Json(data, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
// GET: Interviews/Create public async Task <ActionResult> Create() { var data = await APIHelpers.GetAsync <List <Employee> >("api/Employee/GetEmployees"); ViewBag.Employee = data; ViewBag.Technology = await APIHelpers.GetAsync <List <Technologies> >("api/Technology/GetTechnologies"); ViewBag.Designation = await APIHelpers.GetAsync <List <Designation> >("api/Designation/GetDesignations"); ViewBag.fromtime = DateTime.Now.ToString("HH:mm"); ViewBag.totime = DateTime.Now.AddHours(1).ToString("HH:mm"); return(View()); }
public async Task <JsonResult> GetCandidateDetail(string name) { try { var data = await APIHelpers.GetAsync <List <Candidates> >("api/Interview/GetCandidateDetail?name=" + name); return(Json(data, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
public async Task <JsonResult> GetMessages() { try { var data = await APIHelpers.GetAsync <List <Notifications> >("api/Notification/GetMessage"); //return Json(data); return(Json(data, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
public async Task <FileResult> Print() { try { var data = await APIHelpers.GetAsync <List <DisplayInterviewerModel> >("api/Interviewer/GetInterviewerList"); var builder = new PdfBuilder <List <DisplayInterviewerModel> >(data, Server.MapPath("/Views/Interviewer/Print.cshtml")); return(builder.GetPdf()); } catch (Exception ex) { return(File("AccessDenied", "Error")); } }
// GET: Leave/Edit/5 /// <summary> /// Edits the specified identifier. /// </summary> /// <param name="id">The identifier.</param> /// <returns></returns> public async Task <ActionResult> Edit(Guid id) { try { var data = await APIHelpers.GetAsync <List <Leave> >("api/Leave/GetLeaves"); ViewBag.Leave = data; return(View("Create", await APIHelpers.GetAsync <Leave>("api/Leave/Get/" + id))); } catch (Exception ex) { return(RedirectToAction("AccessDenied", "Error")); } }
public async Task <FileResult> Print() { try { var data = await APIHelpers.GetAsync <List <TemplatesType> >("api/TemplateType/GetTemplateTypes"); var builder = new PdfBuilder <List <TemplatesType> >(data, Server.MapPath("/Views/Types/Print.cshtml")); return(builder.GetPdf()); } catch (Exception ex) { return(File("AccessDenied", "Error")); } }
// GET: Interviews/Edit/5 public async Task <ActionResult> Edit(Guid id) { var data = await APIHelpers.GetAsync <List <Employee> >("api/Employee/GetEmployees"); ViewBag.Employee = data; ViewBag.Technology = await APIHelpers.GetAsync <List <Technologies> >("api/Technology/GetTechnologies"); ViewBag.Designation = await APIHelpers.GetAsync <List <Designation> >("api/Designation/GetDesignations"); var data1 = await APIHelpers.GetAsync <Interviewers>("api/Interviewer/Get/" + id); ViewBag.fromtime = DateTime.Today.Add(data1.FromTime).ToString("HH:mm"); ViewBag.totime = DateTime.Today.Add(data1.ToTime).ToString("HH:mm"); return(View("create", data1)); }
public async Task <JsonResult> UpdateStatus(string id, string proid) { try { if (id != null && proid != null) { await APIHelpers.GetAsync <string>("api/Project/UpdateWorkingStatus?id=" + id + "&proid=" + proid); } return(Json(true, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
public async Task <ActionResult> GetPendingLeave() { try { FilterViewModel model = new FilterViewModel(); var data = await APIHelpers.GetAsync <List <LeaveViewModel> >("api/Leave/GetPendingLeave"); model.Leaves = data.ToList(); return(View(model)); } catch (Exception ex) { throw; } }
// GET: Interview/Edit/5 public async Task <ActionResult> Edit(Guid id) { var data = await APIHelpers.GetAsync <Interviews>("api/Interview/Get/" + id); var Candidate = await APIHelpers.GetAsync <Candidates>("api/Candidate/Get/" + data.CandidateId); ViewBag.Candidate = Candidate.Name; ViewBag.Employee = await APIHelpers.GetAsync <List <Employee> >("api/Employee/GetEmployees"); ViewBag.emp = await APIHelpers.GetAsync <Employee>("api/Employee/Get/" + data.EmployeeId); ViewBag.stime = data.ScheduleTime.ToString("HH:mm"); ViewBag.sdate = data.ScheduleTime.ToString("MM/dd/yyyy"); return(View("create", data)); }
public async Task <JsonResult> ChangeStatus(string teamid) { try { if (teamid != null) { await APIHelpers.GetAsync <string>("api/Project/ChangeWorkingStatus/" + teamid); } return(Json(true, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
public async Task <JsonResult> DeleteTeamMember(string id, string proid) { try { if (id != null && proid != null) { await APIHelpers.GetAsync <string>("api/Project/DeleteMember?id=" + id + "&proid=" + proid); } return(Json(true, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw; } }
// GET: Project public async Task <ActionResult> Index() { var roleName = EmployeeManagementSystem.Helper.CommonHelper.CurrentRoleName(); var data = new List <ProjectTeamViewModel>(); if (roleName == "Employee") { data = await APIHelpers.GetAsync <List <ProjectTeamViewModel> >("api/Project/GetProjectsByUserId/" + EmployeeManagementSystem.Helper.CommonHelper.GetUserId()); } else { data = await APIHelpers.GetAsync <List <ProjectTeamViewModel> >("api/Project/GetProjects"); } return(View(data.ToList())); }