public ActionResult getEmpdataById(string EId) { var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { empBasicinfo = emp.GetEmployeeById(clientContext, EId); } return(Json(empBasicinfo, JsonRequestBehavior.AllowGet)); }
public ActionResult EmployeeDetails() { string ViewEmployeeID = Request.Cookies["ViewEmployeeID"].Value; Emp_BasicInfoBal EmpDashBal = new Emp_BasicInfoBal(); List <Emp_BasicInfoModel> empview = new List <Emp_BasicInfoModel>(); var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { empview = EmpDashBal.GetEmployeeById(clientContext, ViewEmployeeID); } ViewBag.name = empview; return(View()); }
public ActionResult EmployeeEdit() { // string items = "": string EditEmployeeID = Request.Cookies["EditEmployeeID"].Value; Emp_BasicInfoBal EmpDashBal = new Emp_BasicInfoBal(); List <Emp_BasicInfoModel> empEdit = new List <Emp_BasicInfoModel>(); var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); using (var clientContext = spContext.CreateUserClientContextForSPHost()) { empEdit = EmpDashBal.GetEmployeeById(clientContext, EditEmployeeID); empBasicinfo = emp.GetAllEmployee(clientContext); emp_Company = company.GetAllCompany(clientContext); emp_designation = designation.GetDesignation(clientContext); emp_department = department.GetAllDepartment(clientContext); emp_division = division.GetDivision(clientContext); emp_Branch = Branch.GetBranch(clientContext); emp_Region = Region.GetRegion(clientContext); user = username.Getusergroup(clientContext); emp_manager = empmanager.GetManager(clientContext); /* emp_Company = company.GetAllCompany(clientContext); * IEnumerable<Emp_CompanyMasterModel> companymodel = company.GetAllCompany(clientContext); * var listToClient = companymodel.Select(p => new { p.CompanyName, p.ID }).ToList(); * var items = listToClient.Select(i => new SelectListItem { Text = i.CompanyName, Value = i.ID.ToString() }); * ViewBag.companyedit = items;*/ } ViewBag.company = emp_Company; ViewBag.designation = emp_designation; ViewBag.department = emp_department; ViewBag.division = emp_division; ViewBag.Branch = emp_Branch; ViewBag.Region = emp_Region; ViewBag.emp = empBasicinfo; Session["manager"] = empBasicinfo; ViewBag.Empdata = empEdit; ViewBag.username = user; ViewBag.empmanager = emp_manager; return(View()); }