コード例 #1
0
        public JsonResult GetTaskName()
        {
            Dictionary <string, string> outData = new Dictionary <string, string>();

            NuPortalDBService.NuPortalService taskService = new NuPortalDBService.NuPortalService();
            taskService.Url = Constants.DBService;
            try
            {
                string jsonTaskName = taskService.GetDDListBox(Convert.ToInt32(Session["CompanyId"]), 12);
                if (jsonTaskName != string.Empty)
                {
                    return(Json(jsonTaskName, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    outData = new Dictionary <string, string>();
                    outData.Add("Error", "Error");
                    return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                outData = new Dictionary <string, string>();
                outData.Add("Error", "Error");
                return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet));
            }
            finally
            {
                taskService = null;
            }
        }
コード例 #2
0
 public JsonResult getProjectName()
 {
     NuPortalDBService.NuPortalService dBService = new NuPortalDBService.NuPortalService();
     dBService.Url = Constants.DBService;
     try
     {
         string jsonLocation = dBService.GetDDListBox(Convert.ToInt32(Session["EmpID"]), 16);
         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
     {
         dBService = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #3
0
 public JsonResult GetDefaultValues(int CategoryType, int Operation)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         string jsonString = dbService.CancelItem(Convert.ToInt32(Session["CompanyId"]), CategoryType, 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
     {
         dbService = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #4
0
 public JsonResult GetClosedTickets()
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         string JsonString = Dbservice.SelectGridInfo(Convert.ToInt32(Session["EmpId"]), 6);
         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
     {
         Dbservice.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #5
0
        public JsonResult getReimbursementInfoforID(int reimbursementID)
        {
            Dictionary <string, string> outData = new Dictionary <string, string>();

            NuPortalDBService.NuPortalService dBService = new NuPortalDBService.NuPortalService();
            dBService.Url = Constants.DBService;

            try
            {
                string jsonLocation = dBService.SelectGridInfo(reimbursementID, 8);
                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
            {
                dBService = null;
            }
            outData = new Dictionary <string, string>();
            outData.Add("Error", "Error");
            return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet));
        }
コード例 #6
0
        public JsonResult GetDdlData(int Id, int Operation)
        {
            Dictionary <string, string> outData = new Dictionary <string, string>();

            NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
            dbService.Url = Constants.DBService;
            try
            {
                string jsonData = dbService.GetDDListBox(Id, Operation);
                if (jsonData != "")
                {
                    return(Json(jsonData, 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;
                outData = new Dictionary <string, string>();
                outData.Add("Error", "Error");
                return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet));
            }
            finally
            {
                dbService = null;
            }
            outData = new Dictionary <string, string>();
            outData.Add("Error", "Error");
            return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
 public JsonResult GetSelectData(int Id, int Operation)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         string jsonString = dbService.SelectGridInfo(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
     {
         dbService = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #8
0
 public JsonResult GetEmployeeProgressChat(int empId, int Month, int Year, int Operation)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         Dictionary <string, string> outData = new Dictionary <string, string>();
         string JsonString = dbService.SelectDetailsByMonth(empId, Month, Year, 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
     {
         dbService.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #9
0
        public JsonResult loadPollDetails(string JsonData, int Operation, int OffSet, int RowCount)
        {
            NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
            dbService.Url = Constants.DBService;
            try
            {
                string jsonString = dbService.GetFilterForGrid(JsonData, Convert.ToInt32(Session["CompanyId"]), OffSet, RowCount, 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
            {
                dbService = null;
            }

            return(Json(Common_Library.Constants.JsonError));
        }
コード例 #10
0
 public JsonResult GetStatusUpdates()
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         string JsonString = Dbservice.SelectGridInfo(Convert.ToInt32(Session["EmpId"]), 34);
         if (JsonString != string.Empty)
         {
             return(Json(JsonString, JsonRequestBehavior.AllowGet));
         }
         else
         {
             ViewBag.Message = "No Records Found";
         }
     }
     catch (Exception ex)
     {
         return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
     }
     finally
     {
         Dbservice.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #11
0
        public ActionResult changePassword(string OldPassword, string NewPassword, int Operation)
        {
            Dictionary <string, string> outData = new Dictionary <string, string>();

            NuPortalDBService.NuPortalService dbservice = new NuPortalDBService.NuPortalService();
            dbservice.Url = Constants.DBService;
            try
            {
                string JsonString = dbservice.ChangePassword(OldPassword, NewPassword, Convert.ToInt32(Session["EmpId"]), Operation);
                if (JsonString != string.Empty)
                {
                    return(Json(JsonString));
                }
            }
            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("{\"Result\":\"" + ex.Message + "\"}"));
            }
            finally
            {
                dbservice = null;
            }
            return(Json(Common_Library.Constants.JsonError));
        }
コード例 #12
0
 public JsonResult GetMonthlyRating(int Month, int Year, int Operation)
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         string jsonString = Dbservice.SelectDetailsByMonth(Convert.ToInt32(Session["EmpId"]), Month, Year, 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
     {
         Dbservice = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #13
0
        public JsonResult GetReimbursemenType()
        {
            Dictionary <string, string> outData = new Dictionary <string, string>();

            NuPortalDBService.NuPortalService dBService = new NuPortalDBService.NuPortalService();
            dBService.Url = Constants.DBService;
            try
            {
                string jsonReim = dBService.GetDDListBox(Convert.ToInt32(Session["CompanyId"]), 9);
                if (jsonReim != string.Empty)
                {
                    return(Json(jsonReim, 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
            {
                dBService = null;
            }
            outData = new Dictionary <string, string>();
            outData.Add("Error", "Error");
            return(Json(JsonConvert.SerializeObject(outData), JsonRequestBehavior.AllowGet));
        }
コード例 #14
0
        public ActionResult LoginView(Login Login)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    ViewBag.validationMessage = string.Empty;
                    NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
                    dbService.Url = Constants.DBService;
                    DataTable dtLogin = JsonConvert.DeserializeObject <DataTable>(dbService.LoginInfo(Login.userName, Login.password, 1));
                    if (dtLogin.Rows.Count > 0)
                    {
                        int oItem = Convert.ToInt32(dtLogin.Rows[0]["UserExists"]);
                        if (oItem == 1)
                        {
                            FormsAuthentication.RedirectFromLoginPage("SetCookie", false);
                            Session["CompanyId"] = Convert.ToInt32(dtLogin.Rows[0]["FK_CompanyId"]);
                            Session["EmpID"]     = Convert.ToInt32(dtLogin.Rows[0]["FK_EmpId"]);
                            Session["LType"]     = Convert.ToInt32(dtLogin.Rows[0]["LoginType"]);
                            int loginType = Convert.ToInt32(dtLogin.Rows[0]["LoginType"]);

                            if (loginType == 1)
                            {
                                return(RedirectToAction("Home", "Home"));
                            }
                            else if (loginType == 2)
                            {
                                return(RedirectToAction("Home", "Home"));
                            }
                        }
                        else if (oItem == 0)
                        {
                            Login.ErrorMessage = "User does not exists";
                        }
                        else if (oItem == 2)
                        {
                            Login.ErrorMessage = "Password and username does not match";
                        }
                    }
                    else
                    {
                        Login.ErrorMessage = "Login attempt failed due to service unavailability";
                    }
                }
                else
                {
                    Login.ErrorMessage = "* fields are mandatory";
                }
            }
            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("LoginView", Login));
        }
コード例 #15
0
 public JsonResult GetGridData(string jsonData, int Operation, int ProjId, int TypeId, int OffSet, int RowCount)
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         int    SessionValue = 0;
         string jsonString   = string.Empty;
         if (TypeId == 0)
         {
             SessionValue = ProjId;
         }
         else if (TypeId == 1)
         {
             SessionValue = Convert.ToInt32(Session["CompanyId"]);
         }
         else if (TypeId == 2)
         {
             SessionValue = Convert.ToInt32(Session["EmpId"]);
         }
         else if (TypeId == 3)
         {
             SessionValue = ProjId;
         }
         jsonString = Dbservice.GetFilterForGrid(jsonData, SessionValue, OffSet, RowCount, Operation); //change value of offset as per pagination case
         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
     {
         Dbservice = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #16
0
 public JsonResult GetAllOpenings(int Operation)
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         return(Json(Dbservice.SelectGridInfo(Convert.ToInt32(Session["CompanyId"]), Operation), 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 { Dbservice.Dispose(); }
 }
コード例 #17
0
 public JsonResult GetContact(int clientId)
 {
     try
     {
         NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
         dbService.Url = Constants.DBService;
         string ReturnVal = dbService.GetDDListBox(clientId, 6);
         if (ReturnVal != string.Empty)
         {
             return(Json(ReturnVal, 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));
 }
コード例 #18
0
 public JsonResult GetCompletedMyTasks()
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         string JsonString = Dbservice.SelectGridInfo(Convert.ToInt32(Session["EmpId"]), 2);
         if (JsonString != string.Empty)
         {
             return(Json(JsonString, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
     }
     finally
     {
         Dbservice.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #19
0
 public JsonResult GetOpenTask(int ProjId)
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         string JsonString = Dbservice.SelectGridInfo(ProjId, 11);
         if (JsonString != string.Empty)
         {
             return(Json(JsonString, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
     }
     finally
     {
         Dbservice.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #20
0
 public JsonResult BindTasks(int Project, int EmpId)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         string JsonString = dbService.CancelItem(Project, EmpId == 0 ? Convert.ToInt16(Session["EmpId"]) : EmpId, 8);
         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 { dbService.Dispose(); }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #21
0
 public JsonResult GetMonthBasedDetails(int Month, int Year, int Operation)
 {
     NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService();
     Dbservice.Url = Constants.DBService;
     try
     {
         Dictionary <string, string> outData = new Dictionary <string, string>();
         string JsonString = Dbservice.SelectDetailsByMonth(Convert.ToInt32(Session["EmpId"]), Month, Year, Operation);
         if (JsonString != string.Empty)
         {
             return(Json(JsonString, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
     }
     finally
     {
         Dbservice.Dispose();
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
コード例 #22
0
        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));
        }
コード例 #23
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));
        }