Ejemplo n.º 1
0
        public dynamic DownloadLog(int Id)
        {
            var model = new FPMachine();

            model.Errors = new Dictionary <string, string>();
            try
            {
                if (!AuthenticationModel.IsAllowed("Create", Core.Constants.Constant.MenuName.FPUser, Core.Constants.Constant.MenuGroupName.Setting))
                {
                    model.Errors.Add("Generic", "You are Not Allowed to Add record");

                    return(Json(new
                    {
                        model
                    }, JsonRequestBehavior.AllowGet));
                }
                model = _fpMachineService.GetObjectById(Id);
                _fpMachineService.DownloadAttLog(model, model.IsClearLogAfterDownload, _fpUserService, _fpAttLogService);
            }
            catch (Exception ex)
            {
                LOG.Error("Download Failed", ex);
                model.Errors.Add("Generic", "Error " + ex);

                return(Json(new
                {
                    model
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new
            {
                model
            }, JsonRequestBehavior.AllowGet));
        }