public JsonResult GetComments(int RFTId, int?Type) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { if (Type == 3 || Type == 2) { string JsonString = empService.SelectEmployeeInfo(RFTId, 54); if (JsonString != string.Empty) { return(Json(JsonString, JsonRequestBehavior.AllowGet)); } } else { string JsonString = empService.SelectEmployeeInfo(RFTId, 50); if (JsonString != string.Empty) { return(Json(JsonString, JsonRequestBehavior.AllowGet)); } } } catch (Exception ex) { return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); } finally { empService.Dispose(); } return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); }
public ActionResult Create(int?hdnId) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { ViewData["AllProjects"] = empService.SelectEmployeeInfo(Convert.ToInt32(System.Web.HttpContext.Current.Session["CompanyId"]), 24); ViewData["filProjects"] = ""; ViewBag.proName = ""; ViewBag.ID = 0; if (!string.IsNullOrEmpty(Convert.ToString(hdnId))) { List <Project> Proj = GetProjectDetails(Convert.ToInt32(hdnId)); ViewData["filProjects"] = Proj; ViewBag.proName = Proj[0].ProjectName; ViewBag.ID = hdnId; ViewData["Resources"] = empService.SelectEmployeeInfo(Convert.ToInt32(hdnId), 17); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } finally { empService.Dispose(); } return(View()); }
public JsonResult GetEmpData(int Id, int Operation) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string jsonString = empService.SelectEmployeeInfo(Id, Operation); if (jsonString != string.Empty) { return(Json(jsonString, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); } finally { empService = null; } return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); }
private int GetManager(int EmpId) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; DataTable dt = new DataTable(); try { dt = JsonConvert.DeserializeObject <DataTable>(empService.SelectEmployeeInfo(EmpId, 57)); if (dt != null && dt.Rows.Count > 0) { return(Convert.ToInt32(dt.Rows[0]["Manager"])); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } finally { empService.Dispose(); dt.Dispose(); } return(0); }
public ActionResult GetCustomResources(string ProjectId) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string JsonString = empService.SelectEmployeeInfo(Convert.ToInt16(ProjectId), 27); if (JsonString != string.Empty) { return(Json(JsonString, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); } finally { empService.Dispose(); } return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); }
public JsonResult getAllowanceInfoforID(int allowanceID) { Dictionary <string, string> outData = new Dictionary <string, string>(); NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string jsonLocation = empService.SelectEmployeeInfo(allowanceID, 26); if (jsonLocation != string.Empty) { return(Json(jsonLocation, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } finally { empService = null; } outData = new Dictionary <string, string>(); outData.Add("Error", "Error"); return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet)); }
public string GetOthers(int projID, int opID, string field) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; string items = string.Empty; DataTable jsonDt = JsonConvert.DeserializeObject <DataTable>(empService.SelectEmployeeInfo(projID, opID)); try { if (jsonDt != null && jsonDt.Rows.Count > 0) { foreach (DataRow row in jsonDt.Rows) { items = items + Convert.ToString(row[field]) + "#" + Convert.ToString(row["FirstName"]) + ","; } return(items.Substring(0, items.Length - 1)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } return("0#"); }
public JsonResult GetEmpInfo(int EmployeeId, int Operation) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string jsonString = empService.SelectEmployeeInfo(EmployeeId, Operation); //0-emp info,1-per info,2-academic,3-identity,4-experience,5-competancy //jsonString = JsonConvert.SerializeObject(jsonString); if (jsonString != string.Empty) { return(Json(jsonString, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } finally { empService = null; } return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); }
public List <Project> GetProjectDetails(int projID) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; DataTable dt = JsonConvert.DeserializeObject <DataTable>(empService.SelectEmployeeInfo(projID, 15)); List <Project> Proj = new List <Project>(); try { if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { Proj.Add(new Project { ProjectName = Convert.ToString(row["Name"]), ProjectID = Convert.ToInt32(row["ProjectId"]), StartDate = Convert.ToDateTime(row["StartDate"]).ToString("MM-dd-yyyy"), EndDate = Convert.ToDateTime(row["EndDate"]).ToString("MM-dd-yyyy"), Status = Convert.ToString(row["ProjectStatus"]), Priority = Convert.ToString(row["Priority"]), ClientName = Convert.ToString(row["CompanyName"]), PlannedHours = Convert.ToDouble(row["PlannedHours"]), DepartmentId = Convert.ToInt32(row["FK_Department"]), ClientContact = Convert.ToString(row["ContactPerson"]), ProjectType = Convert.ToString(row["ProjectType"]), ProjectCategory = Convert.ToString(row["ProjectCategory"]), URL = Convert.ToString(row["URL"]), CostCentre = Convert.ToString(row["CostCenter"]), Technologies = Convert.ToString(row["Technologies"]), Manager = GetOthers(Convert.ToInt32(row["ProjectId"]), 16, "FK_Managers"), Resources = "",// GetOthers(Convert.ToInt32(row["ProjectId"]), 17, "FK_Resources"), ProjectDescription = Convert.ToString(row["Description"]), Attachments = Convert.ToString(row["Attachments"]), ClientId = Convert.ToInt32(row["FK_ClientId"]), CompanyId = Convert.ToInt32(row["FK_CompanyId"]), ContactId = Convert.ToInt32(row["FK_ContactId"]), CreatedDate = Convert.ToDateTime(row["CreatedDate"]), CreatedBy = Convert.ToString(row["CreatedEmpID"]), Department = Convert.ToString(row["DepartmentName"]) }); } } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } finally { empService.Dispose(); dt = null; } return(Proj); }
public JsonResult GetEventById(int EventId) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { return(Json(empService.SelectEmployeeInfo(EventId, 38), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); } finally { empService.Dispose(); } }
public ActionResult ProjectName(int?hdnId) { Project projectname = new Project(); NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string JsonString = empService.SelectEmployeeInfo(Convert.ToInt16(hdnId), 15); if (JsonString != string.Empty) { DataTable data = JsonConvert.DeserializeObject <DataTable>(JsonString); if (data.Rows.Count > 0) { projectname.Status = Convert.ToString(data.Rows[0]["ProjectStatus"]); projectname.Priority = Convert.ToString(data.Rows[0]["Priority"].ToString()); projectname.StartDate = Convert.ToDateTime(data.Rows[0]["StartDate"]).ToString("MM-dd-yyyy"); projectname.EndDate = Convert.ToDateTime(data.Rows[0]["EndDate"]).ToString("MM-dd-yyyy") == "01-01-1753" ? "" : Convert.ToDateTime(data.Rows[0]["EndDate"]).ToString("MM-dd-yyyy"); if (Convert.ToString(data.Rows[0]["PlannedHours"]) != string.Empty) { projectname.Plann = data.Rows[0]["PlannedHours"].ToString() != "0" ? data.Rows[0]["PlannedHours"].ToString() : ""; } projectname.ClientName = Convert.ToString(data.Rows[0]["CompanyName"].ToString()); projectname.ProjectName = Convert.ToString(data.Rows[0]["Name"].ToString()); } //return Json(JsonString, JsonRequestBehavior.AllowGet); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError)); } finally { empService.Dispose(); } return(View(projectname)); }
public ActionResult view(int?hdnId) { try { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; List <Project> Proj = GetProjectDetails(Convert.ToInt32(hdnId)); ViewData["Resources"] = empService.SelectEmployeeInfo(Convert.ToInt32(hdnId), 17); return(View(Proj)); } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } return(View()); }
public JsonResult GetEmployeeDetails(int EmpId) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; DataTable dt = new DataTable(), temp = new DataTable(); try { temp = JsonConvert.DeserializeObject <DataTable>(empService.SelectEmployeeInfo(EmpId, 60)); return(Json(JsonConvert.SerializeObject(temp), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); } finally { empService.Dispose(); dt.Dispose(); temp.Dispose(); } }
public ActionResult DeleteOpenTask(int reqID) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string JsonString = empService.SelectEmployeeInfo(reqID, 28); if (JsonString != string.Empty) { return(Json(JsonString, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(Common_Library.Constants.JsonError)); } finally { empService = null; } return(Json(Common_Library.Constants.JsonError)); }
public ActionResult CancelOpening(int OpenId, int OperationId) { NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { string success = empService.SelectEmployeeInfo(OpenId, OperationId); if (success != string.Empty) { return(Json(success)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; } finally { empService.Dispose(); } return(Json(Common_Library.Constants.JsonError)); }
public ActionResult EmpInfoAdminView(int?hdnId) { List <SelectListItem> items; NuPortal.Models.EmpInfoAdminView empAdmin = new Models.EmpInfoAdminView(); NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService(); NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); dbService.Url = Constants.DBService; empService.Url = Constants.EmpService; DataTable dtDesignation = JsonConvert.DeserializeObject <DataTable>(dbService.GetDDListBox(Convert.ToInt32(Session["CompanyId"]), 0)); DataTable dtLocation = JsonConvert.DeserializeObject <DataTable>(dbService.GetDDListBox(Convert.ToInt32(Session["CompanyId"]), 44)); DataTable dtEmploymentType = JsonConvert.DeserializeObject <DataTable>(dbService.GetDDListBox(Convert.ToInt32(Session["CompanyId"]), 2)); DataTable dtStatus = JsonConvert.DeserializeObject <DataTable>(dbService.GetDDListBox(Convert.ToInt32(Session["CompanyId"]), 39)); items = new List <SelectListItem>(); if (dtDesignation != null && dtDesignation.Rows.Count > 0) { for (int i = 0; i < dtDesignation.Rows.Count; i++) { items.Add(new SelectListItem { Text = dtDesignation.Rows[i]["Designation"].ToString(), Value = dtDesignation.Rows[i]["DesignationId"].ToString() }); } } else { items.Add(new SelectListItem { Text = "", Value = "" }); } empAdmin.designation = items; items = new List <SelectListItem>(); if (dtLocation != null && dtLocation.Rows.Count > 0) { for (int i = 0; i < dtLocation.Rows.Count; i++) { items.Add(new SelectListItem { Text = dtLocation.Rows[i]["Name"].ToString(), Value = dtLocation.Rows[i]["OfficeId"].ToString() }); } } else { items.Add(new SelectListItem { Text = "", Value = "" }); } empAdmin.officeLocation = items; items = new List <SelectListItem>(); if (dtEmploymentType != null && dtEmploymentType.Rows.Count > 0) { for (int i = 0; i < dtEmploymentType.Rows.Count; i++) { items.Add(new SelectListItem { Text = dtEmploymentType.Rows[i]["EmploymentType"].ToString(), Value = dtEmploymentType.Rows[i]["EmptTypeId"].ToString() }); } } else { items.Add(new SelectListItem { Text = "", Value = "" }); } empAdmin.employmentType = items; items = new List <SelectListItem>(); if (dtStatus != null && dtStatus.Rows.Count > 0) { for (int i = 0; i < dtStatus.Rows.Count; i++) { items.Add(new SelectListItem { Text = dtStatus.Rows[i]["EmpStatus"].ToString(), Value = dtStatus.Rows[i]["EmpStatusId"].ToString() }); } } else { items.Add(new SelectListItem { Text = "", Value = "" }); } empAdmin.employmentStatus = items; //Load Visa Type //Load Salary Payment Type items = new List <SelectListItem>(); items.Add(new SelectListItem() { Text = "Mr.", Value = "Mr." }); items.Add(new SelectListItem() { Text = "Ms.", Value = "Ms." }); items.Add(new SelectListItem() { Text = "Mrs.", Value = "Mrs." }); empAdmin.title = items; if (hdnId != null)//For New Joining { string JsonString = empService.SelectEmployeeInfo(Convert.ToInt32(hdnId), 48); if (JsonString != string.Empty) { DataTable data = JsonConvert.DeserializeObject <DataTable>(JsonString); empAdmin.firstName = Convert.ToString(data.Rows[0]["Name"]); empAdmin.applicantId = Convert.ToInt32(hdnId); } } return(View(empAdmin)); }
public JsonResult GetTaskDetails(int TaskId, int operationId, string TaskName, int?Type) { Dictionary <string, string> outData = new Dictionary <string, string>(); NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService(); Dbservice.Url = Constants.DBService; NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService(); empService.Url = Constants.EmpService; try { if (Type == 3 || Type == 2) { if (operationId == 1) { string JsonString = Dbservice.SelectGridInfo(TaskId, 37); if (JsonString != string.Empty) { return(Json(JsonString, JsonRequestBehavior.AllowGet)); } } else if (operationId == 2) { string ResourceDetails = empService.SelectEmployeeInfo(TaskId, 53); if (ResourceDetails != string.Empty) { return(Json(ResourceDetails, JsonRequestBehavior.AllowGet)); } } } else { if (operationId == 1) { string JsonString = Dbservice.SelectGridInfo(TaskId, 3); if (JsonString != string.Empty) { return(Json(JsonString, JsonRequestBehavior.AllowGet)); } } else if (operationId == 2) { string ResourceDetails = empService.SelectEmployeeInfo(TaskId, 29); if (ResourceDetails != string.Empty) { return(Json(ResourceDetails, JsonRequestBehavior.AllowGet)); } } } } catch (Exception ex) { outData = new Dictionary <string, string>(); outData.Add("Error", "Error"); return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet)); } finally { empService = null; } return(Json(Common_Library.Constants.JsonError)); }