public Operation Delete(HrmDesignation objHrmDesignation)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objHrmDesignation.Id };
            _HrmDesignationRepository.Delete(objHrmDesignation);

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }
        public ActionResult Save(HrmDesignation HrmDesignationViewModel)
        {
            Operation objOperation = new Operation();
            int companyId = Convert.ToInt32(Session["companyId"]);
            int userId = Convert.ToInt32(Session["userId"]);
            if (ModelState.IsValid)
            {
                HrmDesignation hrmDesignation = new HrmDesignation
                {
                    Id = HrmDesignationViewModel.Id,
                    Name = HrmDesignationViewModel.Name,
                    ShortName = HrmDesignationViewModel.ShortName,
                    HrmDesignationId = HrmDesignationViewModel.HrmDesignationId,
                    //CmnCompanyId = companyId,
                    //Priority = HrmDesignationViewModel.Priority,
                    //Remarks = HrmDesignationViewModel.Remarks,
                    CreatedBy = userId,
                    CreatedDate = DateTime.Now.Date
                };
                if (hrmDesignation.Id == 0)
                {
                    if ((bool)Session["Add"])
                    {
                        hrmDesignation.CreatedBy = userId;
                        hrmDesignation.CreatedDate = DateTime.Now.Date;
                        objOperation = _HrmDesignationService.Save(hrmDesignation);
                    }
                    else { objOperation.OperationId = -1; }
                }
                else
                {
                    if ((bool)Session["Edit"])
                    {
                        hrmDesignation.ModifiedBy = userId;
                        hrmDesignation.ModifiedDate = DateTime.Now.Date;
                        objOperation = _HrmDesignationService.Update(hrmDesignation);
                    }
                    else { objOperation.OperationId = -2; }
                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public Operation Save(HrmDesignation objHrmDesignation)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _HrmDesignationRepository.AddEntity(objHrmDesignation);
            objOperation.OperationId = Id;

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
            }

            return objOperation;
        }