public Operation Delete(HrmEmployee objHrmEmployee)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objHrmEmployee.Id };
            _HrmEmployeeRepository.Delete(objHrmEmployee);

            try
            {
                _unitOfWork.Commit();
            }
            catch (Exception)
            {

                objOperation.Success = false;
            }
            return objOperation;
        }
        public Operation Save(HrmEmployee objHrmEmployee)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _HrmEmployeeRepository.AddEntity(objHrmEmployee);
            objOperation.OperationId = Id;

            try
            {
                _unitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }
        public ActionResult Save(HrmEmployeeViewModel hrmEmployeeViewModel)
        {
            Operation objOperation = new Operation { Success = false };
            int companyId = Convert.ToInt32(Session["companyId"]);
            int userId = Convert.ToInt32(Session["userId"]);
            if (ModelState.IsValid)
            {
                HrmEmployee hrmEmployee = new HrmEmployee
                {
                    Id = hrmEmployeeViewModel.Id,
                    Name = hrmEmployeeViewModel.Name,
                    Address = hrmEmployeeViewModel.Address,
                    HrmDesignationId = hrmEmployeeViewModel.HrmDesignationId,
                    Email = hrmEmployeeViewModel.Email,
                    Phone = hrmEmployeeViewModel.Phone,
                    HrmDepartmentId = hrmEmployeeViewModel.HrmDepartmentId,
                    LineManager = hrmEmployeeViewModel.LineManager,
                    SlsOfficeId = hrmEmployeeViewModel.SlsOfficeId,
                    SecCompanyId = companyId,
                    CreatedBy = hrmEmployeeViewModel.CreatedBy,
                    CreatedDate = hrmEmployeeViewModel.CreatedDate
                };
                if (hrmEmployee.Id == 0)
                {
                    if ((bool)Session["Add"])
                    {
                        hrmEmployee.CreatedBy = userId;
                        hrmEmployee.CreatedDate = DateTime.Now.Date;
                        objOperation = _hrmEmployeeService.Save(hrmEmployee);
                    }
                    else { objOperation.OperationId = -1; }
                }
                else
                {
                    if ((bool)Session["Edit"])
                    {
                        hrmEmployee.ModifiedBy = userId;
                        hrmEmployee.ModifiedDate = DateTime.Now.Date;
                        objOperation = _hrmEmployeeService.Update(hrmEmployee);
                    }
                    else { objOperation.OperationId = -2; }

                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }