Esempio n. 1
0
        public ActionResult Update(AuditTrailLogItemModel auditTrailLogItemModel)
        {
            try
            {
                if (IsUpdate(auditTrailLogItemModel.OperationResult))
                {
                    if (IsValid(auditTrailLogItemModel.OperationResult, auditTrailLogItemModel.AuditTrailLog))
                    {
                        AuditTrailLog auditTrailLog = (AuditTrailLog)auditTrailLogItemModel.AuditTrailLog.ToData();
                        if (Application.Update(auditTrailLogItemModel.OperationResult, auditTrailLog))
                        {
                            if (auditTrailLogItemModel.IsSave)
                            {
                                return(JsonResultSuccess(auditTrailLogItemModel.OperationResult,
                                                         Url.Action("Update", "AuditTrailLog", new { Id = auditTrailLog.Id }, Request.Url.Scheme)));
                            }
                            else
                            {
                                return(JsonResultSuccess(auditTrailLogItemModel.OperationResult));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            auditTrailLogItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(auditTrailLogItemModel.OperationResult));
        }
Esempio n. 2
0
        public ActionResult Delete(int?auditTrailLogId)
        {
            AuditTrailLogItemModel auditTrailLogItemModel = new AuditTrailLogItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                AuditTrailLog        = new AuditTrailLogViewModel(),
                ControllerAction     = "Delete"
            };

            try
            {
                if (IsDelete(auditTrailLogItemModel.OperationResult))
                {
                    AuditTrailLog auditTrailLog = Repository.GetById(new object[] { auditTrailLogId });
                    if (auditTrailLog != null)
                    {
                        auditTrailLogItemModel.AuditTrailLog = new AuditTrailLogViewModel(auditTrailLog);
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(auditTrailLogItemModel));
        }
Esempio n. 3
0
        public ActionResult Update(AuditTrailLogItemModel auditTrailLogItemModel)
        {
            try
            {
                if (IsUpdate(auditTrailLogItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(auditTrailLogItemModel.OperationResult, (AuditTrailLog)auditTrailLogItemModel.AuditTrailLog.ToData()))
                        {
                            if (UnitOfWork.Save(auditTrailLogItemModel.OperationResult))
                            {
                                return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(auditTrailLogItemModel.OperationResult));
        }
Esempio n. 4
0
        public ActionResult Update(AuditTrailLogItemModel auditTrailLogItemModel)
        {
            try
            {
                if (IsUpdate(auditTrailLogItemModel.OperationResult))
                {
                    if (ValidateModelState(Repository))
                    {
                        if (Repository.Update(auditTrailLogItemModel.OperationResult, (AuditTrailLog)auditTrailLogItemModel.AuditTrailLog.ToData()))
                        {
                            if (UnitOfWork.Save(auditTrailLogItemModel.OperationResult))
                            {
                                return(RedirectToUrlDictionary());
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            auditTrailLogItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(auditTrailLogItemModel));
        }
Esempio n. 5
0
        public ActionResult Create(string masterEntity = null, string masterKey = null)
        {
            AuditTrailLogItemModel auditTrailLogItemModel = new AuditTrailLogItemModel(ActivityOperations, "Create", masterEntity, masterKey);

            try
            {
                if (IsCreate(auditTrailLogItemModel.OperationResult))
                {
                    return(ZPartialView("CRUD", auditTrailLogItemModel));
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(auditTrailLogItemModel.OperationResult));
        }
Esempio n. 6
0
        public ActionResult Create()
        {
            AuditTrailLogItemModel auditTrailLogItemModel = new AuditTrailLogItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                AuditTrailLog        = new AuditTrailLogViewModel(),
                ControllerAction     = "Create"
            };

            try
            {
                IsCreate(auditTrailLogItemModel.OperationResult);
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(auditTrailLogItemModel));
        }
Esempio n. 7
0
        public ActionResult Delete(AuditTrailLogItemModel auditTrailLogItemModel)
        {
            try
            {
                if (IsDelete(auditTrailLogItemModel.OperationResult))
                {
                    if (Application.Delete(auditTrailLogItemModel.OperationResult, (AuditTrailLog)auditTrailLogItemModel.AuditTrailLog.ToData()))
                    {
                        return(JsonResultSuccess(auditTrailLogItemModel.OperationResult));
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            auditTrailLogItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(auditTrailLogItemModel.OperationResult));
        }
Esempio n. 8
0
        public ActionResult Delete(int id, string masterEntity = null, string masterKey = null)
        {
            AuditTrailLogItemModel auditTrailLogItemModel = new AuditTrailLogItemModel(ActivityOperations, "Delete", masterEntity, masterKey);

            try
            {
                if (IsDelete(auditTrailLogItemModel.OperationResult))
                {
                    AuditTrailLog auditTrailLog = Application.GetById(auditTrailLogItemModel.OperationResult, new object[] { id });
                    if (auditTrailLog != null)
                    {
                        auditTrailLogItemModel.AuditTrailLog = new AuditTrailLogViewModel(auditTrailLog);

                        return(ZPartialView("CRUD", auditTrailLogItemModel));
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(auditTrailLogItemModel.OperationResult));
        }
Esempio n. 9
0
        public ActionResult Read(int id)
        {
            AuditTrailLogItemModel auditTrailLogItemModel = new AuditTrailLogItemModel(ActivityOperations, "Read");

            try
            {
                if (IsRead(auditTrailLogItemModel.OperationResult))
                {
                    AuditTrailLog auditTrailLog = Application.GetById(auditTrailLogItemModel.OperationResult, new object[] { id });
                    if (auditTrailLog != null)
                    {
                        auditTrailLogItemModel.AuditTrailLog = new AuditTrailLogViewModel(auditTrailLog);

                        return(ZPartialView("CRUD", auditTrailLogItemModel));
                    }
                }
            }
            catch (Exception exception)
            {
                auditTrailLogItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(auditTrailLogItemModel.OperationResult));
        }