Exemple #1
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));
 }
Exemple #2
0
 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());
 }
Exemple #3
0
        public ActionResult removeDocument(int EmpId, string Operation)
        {
            NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
            empService.Url = Constants.EmpService;
            try
            {
                string jsonString = empService.UpdateExitInterview(EmpId, DateTime.Now, string.Empty, Convert.ToString(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));
            }
            finally
            {
                empService = null;
            }

            return(Json(Common_Library.Constants.JsonError));
        }
        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));
        }
Exemple #5
0
 public ActionResult SavePerInfo(int EmployeeId, string address1, string city1, string state1, string country1, string zipcode1, string phone1, string address2, string city2,
                                 string state2, string country2, string zipcode2, string phone2, string EmergencyPhone, string Email, string Dob, string BloodGroup, string Nationality,
                                 string Gender)
 {
     NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
     empService.Url = Constants.EmpService;
     try
     {
         bool IsSuccess = empService.SetPersonalInfo(EmployeeId, address1, city1, state1, country1, zipcode1,
                                                     phone1, address2, city2, state2, country2, zipcode2, phone2, EmergencyPhone, Email, Convert.ToDateTime(Dob), Gender, Nationality, BloodGroup,
                                                     DateTime.Now, DateTime.Now, Convert.ToInt32(Session["EmpID"]), Convert.ToInt32(Session["EmpID"]));
         if (IsSuccess)
         {
             return(Json(Common_Library.Constants.JsonSuccess));
         }
     }
     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));
 }
Exemple #6
0
        public ActionResult SaveAcademic(int EmployeeId, string jsonData)
        {
            DataTable data = JsonConvert.DeserializeObject <DataTable>(jsonData);

            NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
            empService.Url = Constants.EmpService;
            try
            {
                bool IsSuccess = empService.SetAcademic(EmployeeId, jsonData);
                if (IsSuccess)
                {
                    return(Json(Common_Library.Constants.JsonSuccess));
                }
            }
            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));
        }
Exemple #7
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));
 }
Exemple #8
0
 //[HttpGet]
 //public JsonResult GetEmployeeRatings()
 //{
 //    NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
 //    Dbservice.Url = Constants.DBService;
 //    try
 //    {
 //        string jsonString = Dbservice.SelectGridInfo(Convert.ToInt32(Session["EmpId"]), 25);
 //        if (jsonString != string.Empty)
 //            return Json(jsonString, JsonRequestBehavior.AllowGet);
 //    }
 //    catch (Exception ex)
 //    {
 //        return Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet);
 //    }
 //    finally
 //    {
 //        Dbservice = null;
 //    }
 //    return Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet);
 //}
 public JsonResult AutoCompleteEmployee(string EmpName)
 {
     try
     {
         Dictionary <string, string> oItems = new Dictionary <string, string>();
         NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
         empService.Url = Constants.EmpService;
         DataTable dtAutoComplete = JsonConvert.DeserializeObject <DataTable>(empService.ManagerAutoComplete(Convert.ToInt32(Session["CompanyId"]),
                                                                                                             EmpName, Convert.ToInt32(Session["EmpId"]), 3));
         if (dtAutoComplete != null && dtAutoComplete.Rows.Count > 0)
         {
             for (int i = 0; i < dtAutoComplete.Rows.Count; i++)
             {
                 oItems.Add(dtAutoComplete.Rows[i]["EmpId"].ToString(), dtAutoComplete.Rows[i]["FirstName"].ToString());
             }
         }
         return(Json(oItems.ToList()));
     }
     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(null);
     }
 }
Exemple #9
0
 public JsonResult SaveEmployeeRatings(int ratedto, int rating, int RatingFactorId)
 {
     NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
     empService.Url = Constants.EmpService;
     try
     {
         string jsonString = empService.UpdateEmployeeRating(0, ratedto, Convert.ToInt32(Session["EmpId"]),
                                                             rating, Convert.ToInt32(Session["EmpId"]), Convert.ToInt32(Session["EmpId"]), 1, RatingFactorId, 1);
         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));
 }
Exemple #10
0
 public ActionResult UpdateEmpInfo(int EmployeeId, string title, string fname, string lname, string empCode, int designation, string officeEmail, int empType, int location,
                                   string workLocation, string joinDate, string confirmDate, int manager, string relDate, string profilePic, string passportPic, string bgPic, int powerval,
                                   string StartTime, string EndTime, string quotes, int EmpStatus)
 {
     NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
     empService.Url = Constants.EmpService;
     try
     {
         bool IsSuccess = empService.UpdateEmployee(EmployeeId, fname, lname, title, empCode, designation, manager, profilePic,
                                                    passportPic, bgPic, Convert.ToDateTime(joinDate), Convert.ToDateTime(confirmDate), officeEmail, location,
                                                    workLocation, empType, Convert.ToDateTime(relDate), DateTime.Now,
                                                    Convert.ToInt32(Session["EmpID"]), powerval, StartTime, EndTime, quotes, EmpStatus);
         if (IsSuccess)
         {
             return(Json(Common_Library.Constants.JsonSuccess));
         }
     }
     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));
 }
Exemple #11
0
 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));
 }
Exemple #12
0
 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));
 }
Exemple #13
0
 public JsonResult SaveOppReason(int OppId, string Reason, int Operation)
 {
     NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
     empService.Url = Constants.EmpService;
     try
     {
         string jsonString = empService.ManagerAutoComplete(OppId, Reason, Convert.ToInt32(Session["EmpId"]), 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));
 }
Exemple #14
0
        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#");
        }
Exemple #15
0
        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);
        }
Exemple #16
0
        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 AutoComplete(string Name, int Operation, string IdVal, string NameVal)
        {
            Dictionary <string, string> oItems = new Dictionary <string, string>();

            NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
            empService.Url = Constants.EmpService;
            DataTable dtAutoComplete = JsonConvert.DeserializeObject <DataTable>(empService.ManagerAutoComplete(Convert.ToInt32(Session["CompanyId"]), Name, 0, Operation));

            if (dtAutoComplete != null && dtAutoComplete.Rows.Count > 0)
            {
                for (int i = 0; i < dtAutoComplete.Rows.Count; i++)
                {
                    oItems.Add(dtAutoComplete.Rows[i][IdVal].ToString(), dtAutoComplete.Rows[i][NameVal].ToString());
                }
            }
            return(Json(oItems.ToList()));
        }
Exemple #18
0
 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(); }
 }
Exemple #19
0
        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));
        }
Exemple #20
0
        public JsonResult AutoCompleteResources(int Project, string EmpName)
        {
            Dictionary <string, string> oItems = new Dictionary <string, string>();

            NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
            empService.Url = Constants.EmpService;
            DataTable dtAutoComplete = JsonConvert.DeserializeObject <DataTable>(empService.ManagerAutoComplete(Project, EmpName, 0, 2));

            if (dtAutoComplete != null && dtAutoComplete.Rows.Count > 0)
            {
                for (int i = 0; i < dtAutoComplete.Rows.Count; i++)
                {
                    oItems.Add(dtAutoComplete.Rows[i]["EmpId"].ToString(), dtAutoComplete.Rows[i]["FirstName"].ToString());
                }
            }


            return(Json(oItems.ToList()));
        }
 public JsonResult UpdateNewEmployeeMail(string JsonStr, string Email)
 {
     NuPortalRecruitmentService.Recruitment     recService = new NuPortalRecruitmentService.Recruitment();
     NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
     recService.Url = Constants.RecruitmentService;
     empService.Url = Constants.EmpService;
     Common_Library.GeneralFunctions general = new Common_Library.GeneralFunctions();
     try
     {
         DataTable NewEmpDetails = JsonConvert.DeserializeObject <DataTable>(JsonStr);
         string    jsonString    = recService.UspUpdateJoinedEmpolyee(Email, Convert.ToInt32(Session["EmpID"]), Convert.ToInt32(NewEmpDetails.Rows[0]["FK_NewAppId"]), 1);
         if (jsonString != string.Empty)
         {
             string JsonData = empService.CreateEmployee(Convert.ToString(NewEmpDetails.Rows[0]["FirstName"]), Convert.ToString(NewEmpDetails.Rows[0]["LastName"]), Convert.ToString(NewEmpDetails.Rows[0]["Title"]), Convert.ToString(NewEmpDetails.Rows[0]["EmployeeCode"]),
                                                         Convert.ToInt32(NewEmpDetails.Rows[0]["FK_DesignationId"]), Convert.ToInt32(NewEmpDetails.Rows[0]["Manager"]), Convert.ToString(NewEmpDetails.Rows[0]["ProfilePicUrl"]), Convert.ToString(NewEmpDetails.Rows[0]["QuotesPictureUrl"]),
                                                         Convert.ToString(NewEmpDetails.Rows[0]["BackGroundPicUrl"]), general.SetDateVal(Convert.ToString(NewEmpDetails.Rows[0]["HireDate"])), general.SetDateVal(Convert.ToString(NewEmpDetails.Rows[0]["ConfirmationDate"])), Email, Convert.ToInt32(NewEmpDetails.Rows[0]["OfficeLocation"]),
                                                         Convert.ToString(NewEmpDetails.Rows[0]["WorkLocation"]), Convert.ToInt32(NewEmpDetails.Rows[0]["FK_EmptTypeId"]), general.SetDateVal(Convert.ToString(NewEmpDetails.Rows[0]["RelievingDate"])), Convert.ToInt32(NewEmpDetails.Rows[0]["FK_CompanyId"]),
                                                         Convert.ToInt32(NewEmpDetails.Rows[0]["Fk_EmpStatus"]), DateTime.Now, DateTime.Now, Convert.ToInt32(Session["EmpID"]), Convert.ToInt32(Session["EmpID"]), Convert.ToInt32(NewEmpDetails.Rows[0]["WeekOffDays"]), Convert.ToString(NewEmpDetails.Rows[0]["StartTime"]),
                                                         Convert.ToString(NewEmpDetails.Rows[0]["EndTime"]), Convert.ToString(NewEmpDetails.Rows[0]["QuotesText"]));
             if (!string.IsNullOrEmpty(JsonData))
             {
                 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
     {
         recService.Dispose(); empService.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
Exemple #22
0
 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));
 }
Exemple #23
0
        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(); }
        }
Exemple #24
0
        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 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));
 }
Exemple #26
0
        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));
        }
        public ActionResult EmpInfoAdminView(HttpPostedFileBase file, NuPortal.Models.EmpInfoAdminView empDetails, int?hdnId)
        {
            string path = string.Empty;

            Common_Library.GeneralFunctions            general    = new Common_Library.GeneralFunctions();
            NuPortalEmpService.NuPortalEmployeeService empService = new NuPortalEmpService.NuPortalEmployeeService();
            NuPortalRecruitmentService.Recruitment     recService = new NuPortalRecruitmentService.Recruitment();
            empService.Url = Constants.EmpService;
            recService.Url = Constants.RecruitmentService;
            Dictionary <string, int> dictEmpData = new Dictionary <string, int>();

            try
            {
                if (hdnId == null)
                {
                    //DateTime JDate= Convert.ToDateTime(DateTime.ParseExact(empDetails.joiningDate, "yyyy/MM/dd", null).ToString("dd/MM/yyyy"));
                    DateTime      JDate         = Convert.ToDateTime(DateTime.ParseExact(empDetails.joiningDate, "MM/dd/yyyy", null).ToString("yyyy/MM/dd"));
                    bool          IsSuccess     = false;
                    string[]      imageUrlArray = new string[] { };
                    string[]      quoteArray    = new string[] { };
                    StringBuilder sb            = new StringBuilder();
                    if (empDetails.applicantId == 0)
                    {
                        string JsonData = empService.CreateEmployee(empDetails.firstName, empDetails.lastName == null ? "" : empDetails.lastName, empDetails.titleId == null ? "" : empDetails.titleId,
                                                                    empDetails.employeeCode,
                                                                    Convert.ToInt32(empDetails.designationId), empDetails.reportingTo, empDetails.profilePicUrl == null ? "" : empDetails.profilePicUrl,
                                                                    empDetails.passPicUrl == null ? "" : empDetails.passPicUrl, empDetails.bgPicUrl == null ? "" : empDetails.bgPicUrl,
                                                                    JDate, general.SetDateVal(empDetails.confirmationDate), empDetails.officeEmailId,
                                                                    Convert.ToInt32(empDetails.officeLocationId), empDetails.workLocation == null ? "" : empDetails.workLocation,
                                                                    empDetails.employementId == null ? 0 : Convert.ToInt32(empDetails.employementId), general.SetDateVal(empDetails.relievingDate), 1, empDetails.employmentStatusId != null ? Convert.ToInt32(empDetails.employmentStatusId) : 0,
                                                                    DateTime.Now, DateTime.Now, Convert.ToInt32(Session["EmpID"]), Convert.ToInt32(Session["EmpID"]), empDetails.weekOffDays,
                                                                    empDetails.workStartTime == null ? "" : empDetails.workStartTime, empDetails.workEndTime == null ? "" : empDetails.workEndTime, empDetails.quotes == null ? "" : empDetails.quotes);
                        dictEmpData = JsonConvert.DeserializeObject <Dictionary <string, int> >(JsonData);
                        if (!string.IsNullOrEmpty(empDetails.imageUrl) && dictEmpData["EmpId"] > 0)
                        {
                            imageUrlArray = empDetails.imageUrl.Split('|');
                            quoteArray    = empDetails.quoteText.Split('|');
                            sb.Append("[");
                            for (int i = 0; i < imageUrlArray.Length - 1; i++)
                            {
                                sb.Append("{\"FK_EmpId\":" + dictEmpData["EmpId"] + ",\"QuotesPictureUrl\":\"" + imageUrlArray[i] + "\",\"QuotesText\":\"" + quoteArray[i] + "\"},");
                            }
                            sb.Length--;
                            sb.Append("]");
                            IsSuccess = empService.SetEmpGallery(dictEmpData["EmpId"], Convert.ToString(sb).TrimEnd('}').TrimStart('{'));
                        }
                    }
                    else
                    {
                        var newId = recService.CreateJoinedEmployee(empDetails.applicantId, empDetails.firstName, empDetails.lastName == null ? "" : empDetails.lastName, empDetails.titleId == null ? "" : empDetails.titleId,
                                                                    empDetails.employeeCode, Convert.ToInt32(empDetails.designationId), empDetails.reportingTo, empDetails.profilePicUrl == null ? "" : empDetails.profilePicUrl,
                                                                    empDetails.passPicUrl == null ? "" : empDetails.passPicUrl, empDetails.bgPicUrl == null ? "" : empDetails.bgPicUrl, JDate, general.SetDateVal(empDetails.confirmationDate), empDetails.officeEmailId == null ? "" : empDetails.officeEmailId,
                                                                    Convert.ToInt32(empDetails.officeLocationId), empDetails.workLocation == null ? "" : empDetails.workLocation, empDetails.employementId == null ? 0 : Convert.ToInt32(empDetails.employementId), general.SetDateVal(empDetails.relievingDate), 1, empDetails.employmentStatusId != null ? Convert.ToInt32(empDetails.employmentStatusId) : 0,
                                                                    DateTime.Now, DateTime.Now, Convert.ToInt32(Session["EmpID"]), Convert.ToInt32(Session["EmpID"]), empDetails.weekOffDays,
                                                                    empDetails.workStartTime == null ? "" : empDetails.workStartTime, empDetails.workEndTime == null ? "" : empDetails.workEndTime, empDetails.quotes == null ? "" : empDetails.quotes);
                        if (!string.IsNullOrEmpty(newId))
                        {
                            IsSuccess = true;
                        }
                    }
                    if (empDetails.applicantId == 0 && dictEmpData["EmpId"] > 0 && dictEmpData["MailStatus"] == 1)
                    {
                        ModelState.Clear();
                        ViewBag.Message = "Employee Created Successfully";
                    }
                    else if (empDetails.applicantId == 0 && dictEmpData["EmpId"] > 0 && dictEmpData["MailStatus"] == 0)
                    {
                        ViewBag.Message = "Error in sending mail";
                    }
                    else if (empDetails.applicantId > 0 && IsSuccess)
                    {
                        ModelState.Clear();
                        ViewBag.Message = "Employee Created Successfully";
                    }
                    else
                    {
                        ViewBag.Message = "Error in saving data";
                    }
                }
            }
            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
            {
                empDetails  = null;
                empService  = null;
                general     = null;
                dictEmpData = null;
            }
            return(EmpInfoAdminView(hdnId));
        }
        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));
        }