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

            model.Errors = new Dictionary <string, string>();
            try
            {
                model = _fpMachineService.GetObjectById(Id);
            }
            catch (Exception ex)
            {
                LOG.Error("GetInfo", ex);

                model.Errors.Add("Generic", "Error " + ex);

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

            return(Json(new
            {
                model.Id,
                model.CompanyInfoId,
                CompanyInfo = model.CompanyInfo != null ? model.CompanyInfo.Name : "",
                model.MachineNumber,
                model.MachineName,
                model.Password,
                model.IsAutoConnect,
                model.IsClearLogAfterDownload,
                model.CommType,
                model.EthernetIP,
                model.EthernetPort,
                model.SerialPort,
                model.SerialBaudRate,
                model.TimeZone,
                model.TimeZoneOffset,
                model.Errors
            }, JsonRequestBehavior.AllowGet));
        }