Esempio n. 1
0
        public JsonResult AddEmployee(string userName, string passWord, string emailId, bool checkBoxActive)
        {
            bool addEmployeeflag;
            int  chkActive = checkBoxActive ? 1 : 0;

            try
            {
                ETLEmployeeService.ETLCenterEmployeeService addEmployeeService = new ETLEmployeeService.ETLCenterEmployeeService();
                addEmployeeService.Url = Constants.EmployeeService;
                addEmployeeflag        = addEmployeeService.EmployeeCreation(0, userName, passWord, emailId, chkActive, 0, 1, 1, 1);
                return(Json(new { flag = addEmployeeflag }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                CommonFunctions commonFun = new CommonFunctions();
                commonFun.ExceptionLog(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name,
                                       Convert.ToString(ControllerContext.RouteData.Values["action"]),
                                       Convert.ToString(ControllerContext.RouteData.Values["controller"]));
                commonFun = null;
                return(Json(new { flag = -1 }, JsonRequestBehavior.AllowGet));
            }
            finally
            {
                Dispose();
            }
        }
Esempio n. 2
0
        public ActionResult AddEmployee()
        {
            try
            {
                ETLEmployeeService.ETLCenterEmployeeService selectEmpdetails = new ETLEmployeeService.ETLCenterEmployeeService();
                selectEmpdetails.Url = Constants.EmployeeService;
                string    employeeDetails   = selectEmpdetails.SelectEmployeeDetails();
                DataTable dtEmployeeDetails = JsonConvert.DeserializeObject <DataTable>(employeeDetails);


                return(View(dtEmployeeDetails));
            }
            catch (Exception ex)
            {
                CommonFunctions commonFun = new CommonFunctions();
                commonFun.ExceptionLog(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name,
                                       Convert.ToString(ControllerContext.RouteData.Values["action"]),
                                       Convert.ToString(ControllerContext.RouteData.Values["controller"]));
                commonFun = null;
                return(Json(new { flag = -1 }, JsonRequestBehavior.AllowGet));
            }
            finally
            {
                Dispose();
            }
        }