コード例 #1
0
ファイル: IntakeController.cs プロジェクト: buyonlinemahi/MMC
        private void movePatientMedicalRecordsByClaimID(IEnumerable <RFARecordSpliting> rfaRecSplts, int opatientID, int patientID, int claimID)
        {
            string virStoragePath = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            //create path...
            StorageModel _storageModel = new StorageModel();

            _storageModel            = Mapper.Map <StorageModel>(_commonService.GetStorageStuctureByID(claimID, 'C'));
            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.PatientID  = opatientID;
            _storageModel.ClaimID    = rfaRecSplts.FirstOrDefault().PatientClaimID;
            _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords;


            StorageModel _storageModel1 = new StorageModel()
            {
                ClientID   = _storageModel.ClientID,
                path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString()),
                PatientID  = patientID,
                ClaimID    = claimID,
                FolderName = GlobalConst.FolderName.MedicalRecords
            };

            //end path..
            rfaRecSplts.ToList().ForEach(hp =>
                                         _storageService.movePatientMedicalRecordIntakeByClaimID(_storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + hp.RFARecDocumentName, _storageService.GeneateStorage(_storageModel1) + GlobalConst.ConstantChar.DoubleBackSlash + hp.RFARecDocumentName));
        }
コード例 #2
0
        // Constructors

        public UpgradeHintsProcessor(
            HandlerAccessor handlers,
            MappingResolver resolver,
            StoredDomainModel currentDomainModel,
            StoredDomainModel extractedDomainModel,
            StorageModel extractedStorageModel,
            bool autoDetectTypesMovements)
        {
            ArgumentValidator.EnsureArgumentNotNull(handlers, "handlers");
            ArgumentValidator.EnsureArgumentNotNull(resolver, "resolver");
            ArgumentValidator.EnsureArgumentNotNull(currentDomainModel, "currentDomainModel");
            ArgumentValidator.EnsureArgumentNotNull(extractedDomainModel, "extractedDomainModel");
            ArgumentValidator.EnsureArgumentNotNull(extractedStorageModel, "extractedStorageModel");

            typeMapping         = new Dictionary <StoredTypeInfo, StoredTypeInfo>();
            reverseTypeMapping  = new Dictionary <StoredTypeInfo, StoredTypeInfo>();
            fieldMapping        = new Dictionary <StoredFieldInfo, StoredFieldInfo>();
            reverseFieldMapping = new Dictionary <StoredFieldInfo, StoredFieldInfo>();

            this.resolver = resolver;
            nameBuilder   = handlers.NameBuilder;
            domainModel   = handlers.Domain.Model;

            this.extractedStorageModel = extractedStorageModel;

            currentModel = currentDomainModel;
            currentTypes = currentModel.Types.ToDictionary(t => t.UnderlyingType);

            extractedModel = extractedDomainModel;
            extractedTypes = extractedModel.Types.ToDictionary(t => t.UnderlyingType);

            this.autoDetectTypesMovements = autoDetectTypesMovements;
            hints           = new NativeTypeClassifier <UpgradeHint>(true);
            suspiciousTypes = new List <StoredTypeInfo>();
        }
コード例 #3
0
        public ActionResult updatePatientMedicalRecord(int id)
        {
            RFARecordSplittingViewModel _rfaRecordSplit = new RFARecordSplittingViewModel();

            //_rfaRecordSplit.documentTypes = Mapper.Map<IEnumerable<AppModel.DocumentTypeModel.DocumentType>>(_iCommonService.getDocumentTypesAll());
            _rfaRecordSplit.rfaRecordSpliting           = Mapper.Map <RFARecordSpliting>(_intakeService.getRFARecordSplittingByID(id));
            _rfaRecordSplit.documentTypes               = Mapper.Map <IEnumerable <AppModel.DocumentTypeModel.DocumentType> >(_iCommonService.getDocumentTypeByDocumentCategoryID(_rfaRecordSplit.rfaRecordSpliting.DocumentCategoryID));
            _rfaRecordSplit.rfaRecordSpliting.PatientID = _iPatientService.getPatientClaimByID(_rfaRecordSplit.rfaRecordSpliting.PatientClaimID).PatientID;

            ///create path...
            StorageModel _storageModel = new StorageModel();

            _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_rfaRecordSplit.rfaRecordSpliting.PatientClaimID, 'C'));
            _storageModel.path       = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString();
            _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords;

            //end path..

            _rfaRecordSplit.rfaRecordSpliting.DocumentUrl = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + _rfaRecordSplit.rfaRecordSpliting.RFAFileName;

            List <string> diag = (from s in _iPatientService.getPatientClaimDiagnoseByPatientClaimIdAll(_rfaRecordSplit.rfaRecordSpliting.PatientClaimID).OrderByDescending(hp => hp.PatientClaimDiagnosisID).ToList()
                                  select s.icdICDNumber).ToList();

            diag.ForEach(hp => _rfaRecordSplit.diagnosisAll += hp + ",");

            if (_rfaRecordSplit.diagnosisAll != null)
            {
                _rfaRecordSplit.diagnosisAll = _rfaRecordSplit.diagnosisAll.Substring(0, _rfaRecordSplit.diagnosisAll.Length - 1);
            }


            return(View(_rfaRecordSplit));
        }
コード例 #4
0
        /// <summary>
        /// Add Storage
        /// </summary>
        /// <param name="p_oStorageModel"></param>
        /// <returns></returns>
        public bool AddStorage(StorageModel p_oStorageModel)
        {
            try
            {
                Connection();
                SqlCommand oSqlCommand = new SqlCommand("uspStorageAdd", oSqlConnection);
                oSqlCommand.CommandType = CommandType.StoredProcedure;

                oSqlCommand.Parameters.AddWithValue("@p_strImageName", p_oStorageModel.ImageName);
                oSqlCommand.Parameters.AddWithValue("@p_strCaption", p_oStorageModel.Caption);
                oSqlCommand.Parameters.AddWithValue("@p_strImageUri", p_oStorageModel.ImageUri);
                oSqlCommand.Parameters.AddWithValue("@p_strThumbnailUri", p_oStorageModel.ThumbnailUri);
                oSqlCommand.Parameters.AddWithValue("@p_strResponse", p_oStorageModel.Response);

                oSqlConnection.Open();
                int i = oSqlCommand.ExecuteNonQuery();
                oSqlConnection.Close();

                if (i >= 1)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception oException)
            {
                throw oException;
            }
        }
コード例 #5
0
        public IActionResult Index(StorageModel model)
        {
            // Apply input history from cookie
            var cu = ControllerUtils.From(this);

            cu.PersistInput("StrageAccountName", model, StorageModel.Default.StrageAccountName);
            cu.PersistInput("Key", model, StorageModel.Default.Key);
            cu.PersistInput("Page", model, StorageModel.Default.Page);
            cu.PersistInput("BlobContainerName", model, StorageModel.Default.BlobContainerName);
            cu.PersistInput("BlobName", model, StorageModel.Default.BlobName);
            cu.PersistInput("FileShareName", model, StorageModel.Default.FileShareName);
            cu.PersistInput("FileName", model, StorageModel.Default.FileName);
            cu.PersistInput("TableName", model, StorageModel.Default.TableName);
            cu.PersistInput("TablePartition", model, StorageModel.Default.TablePartition);
            cu.PersistInput("TableKey", model, StorageModel.Default.TableKey);
            cu.PersistInput("QueueName", model, StorageModel.Default.QueueName);

            if (!model.Pages.Contains(model.Page))
            {
                model.Page = "Blob";
            }
            switch (model.Page)
            {
            case "Blob": return(Blob(model));

            case "File": return(File(model));

            case "Table": return(Table(model));

            case "Queue": return(Queue(model));

            default: return(NotFound($"Page {model.Page} not found."));
            }
        }
コード例 #6
0
        public ActionResult SavePatientMedicalRecordSplitting(RFARecordSplittingViewModel _rfaRecSplit)
        {
            var _result = 0;

            try
            {
                var lstpatMedicalSplitDetails = _rfaRecSplit.rfaRecordSplitingDetails.ToList();

                //create path...
                StorageModel _storageModel = new StorageModel();
                _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(lstpatMedicalSplitDetails.FirstOrDefault().PatientClaimID, 'C'));
                _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
                _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords;

                string saveToPath = _storageService.GeneateStorage(_storageModel);
                //end path..

                foreach (var MedicalSplitDetail in lstpatMedicalSplitDetails)
                {
                    MedicalSplitDetail.RFAFileName   = MedicalSplitDetail.RFARecDocumentName + System.DateTime.Now.ToString().Replace("/", "_").Replace(":", "_").Replace(" ", "_").Trim();
                    MedicalSplitDetail.RFAFileName   = _pdfSplitterService.splitPDFPatientMedicalRecord(MedicalSplitDetail.RFARecPageStart, MedicalSplitDetail.RFARecPageEnd, Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath]), saveToPath, MedicalSplitDetail.RFAReferralFileName, MedicalSplitDetail.RFAFileName);
                    MedicalSplitDetail.RFAReferralID = null;
                    MedicalSplitDetail.RFARecSpltID  = _intakeService.addRFARecordSplitting(Mapper.Map <serviceModel.IntakeService.RFARecordSplitting>(MedicalSplitDetail));
                }
                _result = 1;
            }
            catch
            {
                _result = 0;
            }
            return(Json(_result, GlobalConst.ContentTypes.TextHtml));
        }
コード例 #7
0
    private void UpdateStorage(SqlTransaction trans)
    {
        StorageModel model = this.storage.GetModel(this.storageCode);

        model.project = this.hfldProject.Value;
        this.storage.Update(trans, model);
    }
コード例 #8
0
        public IActionResult File(StorageModel model)
        {
            try
            {
                if (!model.Skip)
                {
                    var storageAccount = CloudStorageAccount.Parse($"DefaultEndpointsProtocol=https;AccountName={model.StrageAccountName};AccountKey={model.Key}");
                    var fc             = storageAccount.CreateCloudFileClient();
                    var fs             = fc.GetShareReference(model.FileShareName);
                    var clouddir       = fs.GetRootDirectoryReference();
                    var dirs           = model.FileName.Split('\\', StringSplitOptions.RemoveEmptyEntries);
                    for (var i = 0; i < dirs.Length - 1; i++)
                    {
                        var dir = dirs[i];
                        clouddir = clouddir.GetDirectoryReference(dir);
                    }
                    var fr = clouddir.GetFileReference(dirs[dirs.Length - 1]);
                    model.Result = fr.DownloadTextAsync().ConfigureAwait(false).GetAwaiter().GetResult();
                }
            }
            catch (Exception ex)
            {
                model.ErrorMessage = $"File Share Error : {ex.Message}";
            }

            model.Skip = false;
            return(View(model));
        }
コード例 #9
0
        public Tuple <string, string> DownloadPrintDocumnent(IEnumerable <RFAReferralFile> RFAReferralFile)
        {
            var           myList        = new List <string>();
            StorageModel  _storageModel = new StorageModel();
            List <string> filesPath     = new List <string>();
            string        savePath;

            foreach (RFAReferralFile __rfaReferralFiledetail in RFAReferralFile)
            {
                if (__rfaReferralFiledetail.IsChecked)
                {
                    _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(__rfaReferralFiledetail.RFAReferralID, GlobalConst.ConstantChar.Char_R));
                    _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
                    _storageModel.FolderName = GlobalConst.FolderName.LegalDocs;
                    savePath = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + __rfaReferralFiledetail.RFAReferralFileName;
                    filesPath.Add(savePath);
                }
            }
            _storageModel.FolderName = GlobalConst.FolderName.MergePDF;
            string FileName = _storageModel.ReferralID + GlobalConst.ReportName.Mergepdf;
            string sPath    = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + FileName;

            if (System.IO.File.Exists(sPath))
            {
                System.IO.File.Delete(sPath);
            }
            _storageService.MergePdf(sPath, filesPath.ToArray());
            Tuple <string, string> savePathWithFileName = new Tuple <string, string>(sPath, FileName);

            return(savePathWithFileName);
        }
コード例 #10
0
ファイル: StorageService.cs プロジェクト: enable934/Exam
        public void CreateStorage(StorageModel storage)
        {
            Storage storageEntity = _mapper.Map <Storage>(storage);

            _unitOfWork.StorageRepository.Insert(storageEntity);
            _unitOfWork.Save();
        }
コード例 #11
0
        public ActionResult uploadNotificationDoc(RFAReferralFile _rfaReferralFile)
        {
            StorageModel _storageModel = new StorageModel();

            _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_rfaReferralFile.RFAReferralID, GlobalConst.ConstantChar.Char_R));
            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.FolderName = GlobalConst.FolderName.LegalDocs;

            string filename     = Guid.NewGuid().ToString() + Path.GetExtension(_rfaReferralFile.rfaReferralFile.FileName);
            string path         = _storageService.GeneateStorage(_storageModel);
            string fileToDelete = _rfaReferralFile.RFAReferralFileName;

            _rfaReferralFile.rfaReferralFile.SaveAs(path + GlobalConst.ConstantChar.DoubleBackSlash + filename);

            _rfaReferralFile.RFAReferralFileName = filename;
            _rfaReferralFile.RFAFileTypeID       = GlobalConst.FileType.UploadInitialNotifications;
            _rfaReferralFile.RFAFileCreationDate = DateTime.Now;
            _rfaReferralFile.RFAFileUserID       = MMCUser.UserId;
            if (_rfaReferralFile.RFAReferralFileID == 0)
            {
                _rfaReferralFile.RFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile));
            }
            else
            {
                System.IO.File.Delete(path + GlobalConst.ConstantChar.DoubleBackSlash + fileToDelete);
                _intakeService.updateReferralFile(Mapper.Map <serviceModel.IntakeService.RFAReferralFile>(_rfaReferralFile));
            }
            _rfaReferralFile.rfaReferralFile = null;
            return(Json(_rfaReferralFile, GlobalConst.ContentTypes.TextHtml));
        }
コード例 #12
0
        public ActionResult GetReferralFileByRFAReferralIDandFileType(int _referralID)
        {
            //int[] filetypeIdDoc = { GlobalConst.FileType.InitialNotification, GlobalConst.FileType.ProofofService, GlobalConst.FileType.DeterminationLetter, GlobalConst.FileType.IMRApplication };
            PatientAndRequestModel _patientAndRequestModel = new PatientAndRequestModel();

            _patientAndRequestModel.ReferralFileNotification = Mapper.Map <IEnumerable <RFAReferralFile> >(_intakeService.getReferralFileByRFAReferralIDandFileType(_referralID));
            int _order = 1;

            StorageModel _storageModel = new StorageModel();
            string       toSearched    = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            string       toReplace     = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString();

            foreach (RFAReferralFile _refFile in _patientAndRequestModel.ReferralFileNotification)
            {
                _refFile.Order = _order;
                _order++;


                _storageModel                    = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(_refFile.RFAReferralID, GlobalConst.ConstantChar.Char_R));
                _storageModel.path               = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
                _storageModel.FolderName         = GlobalConst.FolderName.LegalDocs;
                _refFile.RFAReferralFileFullPath = (_storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + _refFile.RFAReferralFileName).Replace(toSearched, toReplace);
            }
            return(Json(_patientAndRequestModel, GlobalConst.ContentTypes.TextHtml));
        }
コード例 #13
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            View        = (StorageModel)e.Parameter;
            DataContext = View;

            base.OnNavigatedTo(e);
        }
コード例 #14
0
        public DataResult <List <StorageModel> > InitStorageArea()
        {
            DataResult <List <StorageModel> > result = new DataResult <List <StorageModel> >();

            try
            {
                StorageModel storageModel = new StorageModel();
                var          sa           = dataAccess.GetStorageArea();
                result.State = true;
                result.Data  = (from q in sa.AsEnumerable()
                                select new StorageModel
                {
                    Id = q.Field <string>("id"),
                    SlaveAdress = q.Field <Int32>("slave_add"),
                    StartAddress = int.Parse(q.Field <string>("start_reg")),
                    FuncCode = q.Field <string>("func_code"),
                    Length = int.Parse(q.Field <string>("length"))
                }).ToList();
            }
            catch (Exception ex)
            {
                result.Message = ex.Message;
            }

            return(result);
        }
コード例 #15
0
        // GET: Storage/Details/5
        public async Task <ActionResult> Details(string fileName)
        {
            var blobModel = new StorageModel();

            try
            {
                var tokenHelper = new AuthHelper(new ADALTokenCache(AuthHelper.ClaimsSignedInUserID));
                var client      = await GetStorageClient();

                var container = client.GetContainerReference("demo");
                var blob      = container.GetBlockBlobReference(fileName);
                await blob.FetchAttributesAsync();

                blobModel          = new StorageModel(blob);
                blobModel.Contents = await blob.DownloadTextAsync();

                return(View(blobModel));
            }
            // if the above failed, the user needs to explicitly re-authenticate for the app to obtain the required token
            catch (AdalSilentTokenAcquisitionException ee)
            {
                System.Diagnostics.Trace.TraceError("AdalSilentTokenAcquisitionException: " + ee.Message);
                AuthHelper.RefreshSession("/ARM");
                return(View("Relogin"));
            }
            catch (Exception oops)
            {
                System.Diagnostics.Trace.TraceError("Exception: " + oops.Message);
                return(View("Error"));
            }
        }
コード例 #16
0
        public StorageModel Get(string Id)
        {
            var dto = fileRepo.Get(Id);

            if (dto == null)
            {
                throw new KeyNotFoundException($"Could not find {Id}");
            }
            var model      = new StorageModel();
            var filePieces = pieces.Where(x => x.FileId == dto.Id).ToList().OrderBy(x => x.PieceNumber).Select(x => x.FilePieceId);
            var dataItems  = piece.Where(x => filePieces.Contains(x.Id)).ToList();
            var fileData   = filePieces
                             .Select(x => dataItems.FirstOrDefault(z => z.Id == x))
                             .Select(x => x.Hash)
                             .ToList()
                             .Select(x => {
                var result = s3Client.GetObjectAsync(DefaultBucket, x).Result;
                byte[] part;
                using (BinaryReader br = new BinaryReader(result.ResponseStream))
                    part = br.ReadBytes(Convert.ToInt32(result.ResponseStream.Length));
                return(part);
            }).ToList();

            model.data     = fileData.SelectMany(x => x).ToArray();
            model.Filename = dto.Filename;
            model.Id       = dto.Id;
            return(model);
        }
コード例 #17
0
ファイル: Storage.cs プロジェクト: zxl881203/src
        public int Add(SqlTransaction trans, StorageModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into Sm_Storage(");
            builder.Append("sid,scode,tcode,flowstate,person,intime,inflag,annx,explain,project,isfirst,trustee,supervisor,isintime)");
            builder.Append(" values (");
            builder.Append("@sid,@scode,@tcode,@flowstate,@person,@intime,@inflag,@annx,@explain,@project,@isfirst,@trustee,@supervisor,@isintime)");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@sid", SqlDbType.NVarChar, 50), new SqlParameter("@scode", SqlDbType.NVarChar, 0x40), new SqlParameter("@tcode", SqlDbType.NVarChar, 0x200), new SqlParameter("@flowstate", SqlDbType.Int, 4), new SqlParameter("@person", SqlDbType.NVarChar, 0x40), new SqlParameter("@intime", SqlDbType.SmallDateTime), new SqlParameter("@inflag", SqlDbType.Bit, 1), new SqlParameter("@annx", SqlDbType.NVarChar, 0x80), new SqlParameter("@explain", SqlDbType.NVarChar, 0x800), new SqlParameter("@project", SqlDbType.NVarChar, 0x40), new SqlParameter("@isfirst", SqlDbType.Bit, 1), new SqlParameter("@trustee", SqlDbType.NVarChar, 50), new SqlParameter("@supervisor", SqlDbType.NVarChar, 50), new SqlParameter("@isintime", SqlDbType.SmallDateTime) };
            commandParameters[0].Value  = model.sid;
            commandParameters[1].Value  = model.scode;
            commandParameters[2].Value  = model.tcode;
            commandParameters[3].Value  = model.flowstate;
            commandParameters[4].Value  = model.person;
            commandParameters[5].Value  = model.intime;
            commandParameters[6].Value  = model.inflag;
            commandParameters[7].Value  = model.annx;
            commandParameters[8].Value  = model.explain;
            commandParameters[9].Value  = model.project;
            commandParameters[10].Value = model.isfirst;
            commandParameters[11].Value = model.Trustee;
            commandParameters[12].Value = model.Supervisor;
            commandParameters[13].Value = model.IsInTime;
            return(SqlHelper.ExecuteNonQuery(trans, CommandType.Text, builder.ToString(), commandParameters));
        }
コード例 #18
0
        // GET: Admin/Storage
        public ActionResult Index(int Id)
        {
            ViewBag.ActiveMenu = "admin";
            var model = new StorageModel().GetStorageData(Id);

            return(View("..\\Storage\\Index", model));
        }
コード例 #19
0
        public override void OnComplete(Domain domain)
        {
            base.OnComplete(domain);

            TargetStorageModel = UpgradeContext.TargetStorageModel;
            MappingResolver    = UpgradeContext.Services.MappingResolver;
        }
コード例 #20
0
        public IActionResult OnPost(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            StorageModel = _storage.GetWhiskyById(id);

            if (StorageModel != null)
            {
                if (StorageModel.Available > 0)
                {
                    StorageModel.Available--;
                    StorageModel.Reserved++;
                    _storage.UpdateWhiskyByModel(StorageModel);

                    OrderModel orderModel = new OrderModel();
                    orderModel.Completed = false;
                    orderModel.Customer  = _user.GetUserByName(User.Identity.Name);
                    orderModel.Whisky    = StorageModel.Whisky;

                    _order.AddOrder(orderModel);
                }
            }

            return(RedirectToPage("./Index"));
        }
        public void Write(StorageModel model)
        {
            var writePath = $"{_path}{FileName}-{model.Id}.temp";
            var str       = Newtonsoft.Json.JsonConvert.SerializeObject(model);

            File.WriteAllText($"{writePath}", str);
        }
コード例 #22
0
        //private HintSet GetSchemaHints(StorageModel extractedSchema, StorageModel targetSchema)
        //{
        //  context.SchemaHints = new HintSet(extractedSchema, targetSchema);
        //  if (context.Stage==UpgradeStage.Upgrading)
        //    BuildSchemaHints(extractedSchema);
        //  return context.SchemaHints;
        //}

        private void BuildSchemaHints(StorageModel extractedSchema, UpgradeHintsProcessingResult result, StoredDomainModel currentDomainModel)
        {
            var oldModel = context.ExtractedDomainModel;

            if (oldModel == null)
            {
                return;
            }
            var handlers = Domain.Demand().Handlers;
            // It's important to use same StoredDomainModel of current domain
            // in both UpgradeHintsProcessor and HintGenerator instances.
            var hintGenerator = new HintGenerator(result.TypeMapping, result.ReverseTypeMapping, result.FieldMapping, result.Hints, handlers, context.Services.MappingResolver, extractedSchema, currentDomainModel, oldModel);
            var hints         = hintGenerator.Run();

            context.UpgradedTypesMapping = hints.UpgradedTypesMapping;
            context.Hints.Clear();
            foreach (var modelHint in hints.ModelHints)
            {
                context.Hints.Add(modelHint);
            }
            foreach (var schemaHint in hints.SchemaHints)
            {
                try {
                    context.SchemaHints.Add(schemaHint);
                }
                catch (Exception error) {
                    UpgradeLog.Warning(Strings.LogFailedToAddSchemaHintXErrorY, schemaHint, error);
                }
            }
        }
コード例 #23
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (dataGridStanje_u_Magacinu.SelectedIndex != -1)
     {
         SelectedDoctorRoom = (StorageModel)dataGridStanje_u_Magacinu.SelectedItem;
         if (SelectedDoctorRoom.Location.Contains("A"))
         {
             GroundFloor f = new GroundFloor(SelectedDoctorRoom.Location);
             f.Show();
             this.Close();
         }
         else if (SelectedDoctorRoom.Location.Contains("B"))
         {
             GroundFloor2 f = new GroundFloor2(SelectedDoctorRoom.Location);
             f.Show();
             this.Close();
         }
         else
         {
             FirstFloor f = new FirstFloor(SelectedDoctorRoom.Location);
             f.Show();
             this.Close();
         }
     }
 }
コード例 #24
0
        public override object GetData(ITabContext context)
        {
            var timelineMessages = context.GetMessages <ITimelineMessage>()
                                   .Where(m => m.EventName.StartsWith("WAZStorage:")).Cast <WindowsAzureStorageTimelineMessage>();

            var model = new StorageModel();

            if (timelineMessages != null)
            {
                model.Statistics.TotalStorageTx               = timelineMessages.Count();
                model.Statistics.TotalBlobTx                  = timelineMessages.Count(m => m.EventName.StartsWith("WAZStorage:Blob"));
                model.Statistics.TotalTableTx                 = timelineMessages.Count(m => m.EventName.StartsWith("WAZStorage:Table"));
                model.Statistics.TotalQueueTx                 = timelineMessages.Count(m => m.EventName.StartsWith("WAZStorage:Queue"));
                model.Statistics.TotalTrafficToStorage        = timelineMessages.Sum(m => m.RequestSize).ToBytesHuman();
                model.Statistics.TotalTrafficFromStorage      = timelineMessages.Sum(m => m.ResponseSize).ToBytesHuman();
                model.Statistics.PricePerTenThousandPageViews = string.Format("${0}", model.Statistics.TotalStorageTx * 1000 * 0.0000001 + timelineMessages.Sum(m => m.ResponseSize) * 10000 * (0.12 / 1024 / 1024 / 1024));

                model.Requests = FlattenRequests(timelineMessages);
                model.Warnings = AnalyzeMessagesForWarnings(timelineMessages);

                return(model);
            }

            return("No storage transactions have been utilized for this request.");
        }
コード例 #25
0
        public ActionResult GetMergedIMRDecisionDocuments(IEnumerable <RFAReferralFile> RFAReferralFile, int ReflID)
        {
            StorageModel  _storageModel = new StorageModel();
            List <string> filesPath     = new List <string>();

            _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(ReflID, GlobalConst.ConstantChar.Char_R));
            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.FolderName = GlobalConst.FolderName.LegalDocs;

            string pth1 = _storageService.GeneateStorage(_storageModel);

            foreach (RFAReferralFile _RFAReferralFile in RFAReferralFile)
            {
                filesPath.Add(_storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + _RFAReferralFile.RFAReferralFileName);
            }
            _storageModel            = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(ReflID, GlobalConst.ConstantChar.Char_R));
            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.FolderName = GlobalConst.FolderName.MergePDF;
            string FileName = _storageModel.ReferralID + GlobalConst.ReportName.IMRDecisionMergePdf;
            string sPath    = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + FileName;

            if (System.IO.File.Exists(sPath))
            {
                System.IO.File.Delete(sPath);
            }
            _storageService.MergePdf(sPath, filesPath.ToArray());
            string toSearched = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            string toReplace  = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString();
            String URL        = sPath.Replace(toSearched, toReplace);
            Tuple <string, string> savePathWithFileName = new Tuple <string, string>(sPath, URL);

            return(Json(savePathWithFileName));
        }
コード例 #26
0
        public override void Update()
        {
            var player      = ServiceLocator.Current.GetInstance <SingletonStorageModel>().PlayerSelectedItem;
            var tournaments = ServiceLocator.Current.GetInstance <IDataService>().GetPlayerTournaments(player?.PlayerIds);

            var tournamentsOfStatistic = new HashSet <TournamentKey>(StorageModel
                                                                     .GetFilteredTournamentPlayerStatistic()
                                                                     .Select(x => new TournamentKey(x.PokersiteId, x.TournamentId))
                                                                     .Distinct());

            var filteredTournaments = tournaments.Where(x => tournamentsOfStatistic.Contains(x.BuildKey())).ToList();

            var chartSeriesItems = new Dictionary <TournamentChartSeries, List <ChartSeriesItem> >();

            UpdateBasedOnTournamentsSeries(chartSeriesItems, filteredTournaments);
            UpdateBasedOnStatisticSeries(chartSeriesItems, filteredTournaments);

            App.Current.Dispatcher.Invoke(() => ChartCollection.ForEach(x => x.ItemsCollection.Clear()));

            if (chartSeriesItems.Count > 0)
            {
                chartSeriesItems.Keys.ForEach(charSerie =>
                {
                    charSerie.ItemsCollection = new ObservableCollection <ChartSeriesItem>(chartSeriesItems[charSerie]);
                });
            }
        }
コード例 #27
0
        public ActionResult GenerateIMRResponse(IEnumerable <RFAReferralFile> RFAReferralFile, int ReflID, int ImrRFAReferralFileID)
        {
            StorageModel _storageModel = new StorageModel();

            _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(ReflID, GlobalConst.ConstantChar.Char_R));

            _storageModel.path = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());

            string savePath;
            string AttachedDocument = "";

            foreach (RFAReferralFile __rfaReferralFiledetail in RFAReferralFile)
            {
                if (__rfaReferralFiledetail.IsChecked)
                {
                    AttachedDocument += __rfaReferralFiledetail.Mode + ",";
                }
            }
            AttachedDocument = AttachedDocument.Substring(0, AttachedDocument.Length - 1);
            string uClientPathURL = GlobalConst.Extension.http + Request.Url.Host.ToLower() + GlobalConst.ConstantChar.Colon + Request.Url.Port + GlobalConst.ConstantChar.ForwardSlash;
            string reportURL      = string.Format(ConfigurationManager.AppSettings[GlobalConst.SSRSReportName.RptIMRResponse], ReflID, AttachedDocument, uClientPathURL, GlobalConst.Extension.PDF);

            _storageModel.FolderName = GlobalConst.FolderName.LegalDocs;
            _storageModel.ReferralID = ReflID;
            savePath = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + ReflID + "_IMRResponseLetter.pdf";
            if (System.IO.File.Exists(savePath))
            {
                System.IO.File.Delete(savePath);
            }
            using (WebClient client = new WebClient())
            {
                client.Credentials = CredentialCache.DefaultNetworkCredentials;
                client.DownloadFile(reportURL, savePath);
                client.Dispose();
            }

            RFAReferralFile _rfaFile = new RFAReferralFile();

            _rfaFile.RFAReferralFileID   = ImrRFAReferralFileID;
            _rfaFile.RFAReferralID       = ReflID;
            _rfaFile.RFAReferralFileName = ReflID.ToString() + "_IMRResponseLetter.pdf";
            _rfaFile.RFAFileTypeID       = GlobalConst.FileType.IMRResponse;
            _rfaFile.RFAFileCreationDate = DateTime.Now;
            _rfaFile.RFAFileUserID       = MMCUser.UserId;
            if (ImrRFAReferralFileID != 0)
            {
                _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile));
            }
            else
            {
                ImrRFAReferralFileID = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile));
            }

            string toSearched = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            string toReplace  = System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString();
            String URL        = savePath.Replace(toSearched, toReplace);
            Tuple <string, string, int> savePathWithFileName = new Tuple <string, string, int>(savePath, URL, ImrRFAReferralFileID);

            return(Json(savePathWithFileName));
        }
コード例 #28
0
        public JsonResult UploadIMRDecisionDoc(int id, int id2)
        {
            HttpPostedFileBase fileContent   = Request.Files[0];
            string             filename      = Guid.NewGuid().ToString() + Path.GetExtension(fileContent.FileName);
            StorageModel       _storageModel = Mapper.Map <StorageModel>(_iCommonService.GetStorageStuctureByID(id, GlobalConst.ConstantChar.Char_R));

            _storageModel.path       = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings[GlobalConst.VirtualDirectoryPath.VirtualPath].ToString());
            _storageModel.FolderName = GlobalConst.FolderName.MedicalRecords;
            string path = _storageService.GeneateStorage(_storageModel) + GlobalConst.ConstantChar.DoubleBackSlash + filename;

            RFAReferralFile _rfaFile = new RFAReferralFile();

            _rfaFile.RFAReferralID       = id;
            _rfaFile.RFAReferralFileName = filename;
            _rfaFile.RFAFileTypeID       = GlobalConst.FileType.IMRDecisionUpload;
            _rfaFile.RFAFileCreationDate = DateTime.Now;
            _rfaFile.RFAFileUserID       = MMCUser.UserId;

            if (id2 != 0)
            {
                System.IO.File.Delete(path);
                fileContent.SaveAs(path);
                _rfaFile.RFAReferralFileID = id2;
                _intakeService.updateReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile));
            }
            else
            {
                fileContent.SaveAs(path);
                id2 = _intakeService.addReferralFile(Mapper.Map <MMC.MMCService.IntakeService.RFAReferralFile>(_rfaFile));
            }
            return(Json(id2));
        }
コード例 #29
0
 private void Stop()
 {
     Storage.StopProcesses();
     botThread.Abort();
     Storage = null;
     Bot     = null;
 }
コード例 #30
0
        public async Task <IActionResult> AddOrEdit([Bind] StorageModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(this.HtmlReponse(view: "AddOrEditStorage", model,
                                             Result.Failed(Error.WithCode(ErrorCodes.InvalidModel)))));
            }
            if (model.Id == 0)
            {
                var result = await _storageBiz.Add(model);

                if (!result.Success)
                {
                    return(Json(this.HtmlReponse(view: "AddOrEditStorage", model, result)));
                }
            }
            else
            {
                var result = await _storageBiz.Edit(model);

                if (!result.Success)
                {
                    return(Json(this.HtmlReponse(view: "AddOrEditStorage", model, result)));
                }
            }
            return(Json(this.HtmlReponse()));
        }
コード例 #31
0
 public void UpdateStorageModel(StorageModel sm)
 {
     sm.YouTubeClientId = YouTubeClientId;
     sm.YouTubeClientSecret = YouTubeClientSecret;
     sm.SoundCloudClientId = SoundCloudClientId;
     sm.SoundCloudClientSecret = SoundCloudClientSecret;
     sm.FacebookClientId = FacebookClientId;
     sm.FacebookClientSecret = FacebookClientSecret;
 }