Пример #1
0
        public ActionResult SaveOrUpdateIndicator(Guid stageId, Guid id, string temperature, string humidity, string designation, string demand, string actualResult, int?analyseIndicator, bool?isMatches)
        {
            double tempr;
            double?temperatureVal = null;

            if (!string.IsNullOrEmpty(temperature) && double.TryParse(temperature.Replace(".", ","), out tempr))
            {
                temperatureVal = tempr;
            }

            double humid;
            double?humidityVal = null;

            if (!string.IsNullOrEmpty(humidity) && double.TryParse(humidity.Replace(".", ","), out humid))
            {
                humidityVal = humid;
            }
            var model = new DrugAnaliticRepository().SaveOrUpdateIndicator(stageId, id, temperatureVal, humidityVal, designation, demand, actualResult, analyseIndicator, isMatches, UserHelper.GetCurrentEmployee());
            var isNew = id == Guid.Empty;

            return(Json(new
            {
                isNew,
                model.IsMatchesStr,
                modelId = model.Id,
                model.AnalyseIndicatorName,
                model.PositionNumber
            }));
        }
Пример #2
0
        public FileStreamResult ExportProtocol(Guid id)
        {
            StiReport report    = new StiReport();
            var       model     = new DrugAnaliticRepository().GetExpExpertiseStageDosage(id);
            var       applicant = new EmployeesRepository().GetById(model.EXP_ExpertiseStage.EXP_DrugDeclaration.OwnerId);


            report.Load(Server.MapPath("../Reports/DrugDeclaration/AnaliseProtocol.mrt"));
            foreach (var data in report.Dictionary.Databases.Items.OfType <StiSqlDatabase>())
            {
                data.ConnectionString = UserHelper.GetCnString();
            }

            if (report.Dictionary.Variables.Contains("DosageStageId"))
            {
                report.Dictionary.Variables["DosageStageId"].ValueObject = id;
            }
            if (report.Dictionary.Variables.Contains("ApplicationName"))
            {
                report.Dictionary.Variables["ApplicationName"].ValueObject = applicant.DisplayName;
            }
            report.Render(false);
            var stream = new MemoryStream();

            report.ExportDocument(StiExportFormat.Pdf, stream);
            stream.Position = 0;
            var reportname = "Протокол_" + DateTime.Now.ToString("yyyy-mm-dd hh.mm.ss") + ".pdf";

            return(File(stream, "application/pdf", reportname));
        }
Пример #3
0
        public virtual ActionResult GetIndicator(string id)
        {
            var model = new DrugAnaliticRepository().GetIndicator(new Guid(id));

            if (model == null)
            {
                return(Json(new { Id = Guid.Empty, ActualResult = "", AnalyseIndicator = "", Demand = "", Designation = "", Humidity = "", Temperature = "", IsMatches = "" }));
            }
            return(Json(new { model.Id, model.ActualResult, model.AnalyseIndicator, model.Demand, model.Designation, model.Humidity, model.Temperature, model.IsMatches }));
        }