예제 #1
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));
        }
예제 #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 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));
        }
예제 #4
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;
            }
        }
예제 #5
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));
 }
 public JsonResult BindDropdown(int RowId, int Operation)
 {
     try
     {
         NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
         dbService.Url = Constants.DBService;
         string jsonString = dbService.GetDDListBox(RowId, 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));
 }
예제 #7
0
 public JsonResult GetTasksList(int EmpId)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         string JsonString = dbService.GetDDListBox(EmpId == 0 ? Convert.ToInt16(Session["EmpId"]) : EmpId, 19);
         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));
 }
        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));
        }