Ejemplo n.º 1
0
        public Operation DeleteSecGroup(SecGroup objSecGroup)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objSecGroup.Id };
            _SecGroupRepository.Delete(objSecGroup);

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

                objOperation.Success = false;
            }
            return objOperation;
        }
Ejemplo n.º 2
0
        public Operation SaveSecGroup(SecGroup objSecGroup)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _SecGroupRepository.AddEntity(objSecGroup);
            objOperation.OperationId = Id;

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }
        public ActionResult SaveSecGroup(SecGroup Group)
        {
            Operation objOperation = new Operation { Success = false };

            if (ModelState.IsValid)
            {
                int userId = Convert.ToInt32(Session["userId"].ToString());
                Group.CreatedBy = userId;
                if (Group.Id == 0)
                {
                    objOperation = _ccService.SaveSecGroup(Group);
                }
                else
                {
                    Group.ModifiedBy = userId;
                    objOperation = _ccService.UpdateSecGroup(Group);
                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }