public Operation DeleteCmnProject(CmnProject objCmnProject)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objCmnProject.Id };
            _CmnProjectRepository.Delete(objCmnProject);

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

                objOperation.Success = false;
            }
            return objOperation;
        }
        public ActionResult UpdateCmnProject(CmnProject objCmnProject)
        {
            int userId = Convert.ToInt32(Session["userId"]);
            Operation objOperation = new Operation { Success = false };

            if (ModelState.IsValid)
            {
                CmnProject objProject = _CmnProjectService.GetById(objCmnProject.Id);
                if (objProject != null)
                {
                    objProject.ClosingStatus = objCmnProject.ClosingStatus;
                    objProject.ClosingNote = objCmnProject.ClosingNote;
                    objProject.ClosedBy = userId;
                    objProject.ClosingDate = DateTime.Now;
                    objProject.ModifiedBy = userId;
                    objProject.ModifiedDate = DateTime.Now;
                    objOperation = _CmnProjectService.UpdateCmnProject(objProject);
                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public Operation SaveCmnProject(CmnProject objCmnProject)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _CmnProjectRepository.AddEntity(objCmnProject);
            objOperation.OperationId = Id;

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }
        public ActionResult SaveProject(CmnProject cmnProject)
        {
            Operation objOperation = new Operation { Success = false };

            if (ModelState.IsValid)
            {

                if (cmnProject.Id == 0)
                {
                    if ((bool)Session["Add"])
                    {
                        objOperation = _CmnProjectService.SaveCmnProject(cmnProject);
                    }
                    else { objOperation.OperationId = -1; }
                }
                else
                {
                    if ((bool)Session["Edit"])
                    {
                        objOperation = _CmnProjectService.UpdateCmnProject(cmnProject);
                    }
                    else { objOperation.OperationId = -2; }
                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }