public ActionResult Edit(EmployeeDesigViewModel model)
        {
            if (model.EmployeeDesignationId > 0)
            {
                Employeedesignation empdes = EmployeeDesignationManager.GetDesignationById(model.EmployeeDesignationId);


                model.EmployeeDesignationId = empdes.EmployeeDesignationId;
                model.DesinationName        = empdes.DesinationName;
            }
            return(View(model));
        }
        public JsonResult Save(EmployeeDesigViewModel model)
        {
            int saveIndex = 0;

            Employeedesignation empds = new Employeedesignation();

            empds.EmployeeDesignationId = model.EmployeeDesignationId;
            empds.DesinationName        = model.DesinationName;


            saveIndex = model.EmployeeDesignationId == 0
                ? EmployeeDesignationManager.Save(empds)
                : EmployeeDesignationManager.Edit(empds);

            return(Reload(saveIndex));
        }
        public int Save(Employeedesignation empds)
        {
            int saveIndex = 0;

            try
            {
                empds.IsActive = true;

                saveIndex = _employeeDesignationRepository.Save(empds);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(saveIndex);
        }
        public int Delete(int id)
        {
            int deleteIndex = 0;

            try
            {
                Employeedesignation emds = GetDesignationById(id);

                emds.IsActive = false;

                deleteIndex = _employeeDesignationRepository.Edit(emds);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(deleteIndex);
        }
        public int Edit(Employeedesignation empds)
        {
            int editIndex = 0;

            try
            {
                Employeedesignation _emplds = GetDesignationById(empds.EmployeeDesignationId);

                _emplds.EmployeeDesignationId = empds.EmployeeDesignationId;
                _emplds.DesinationName        = empds.DesinationName;


                editIndex = _employeeDesignationRepository.Save(_emplds);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(editIndex);
        }
        public List <Employeedesignation> GetAllDesignationByPaging(out int totalrecord, Employeedesignation model)
        {
            List <Employeedesignation> employeedesignations;


            try
            {
                employeedesignations = _employeeDesignationRepository.GetAllDesignationByPaging(out totalrecord, model);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }

            return(employeedesignations);
        }