示例#1
0
 public NoteViewModel(WorkspaceViewModel workspaceViewModel, NoteModel model)
 {
     this.WorkspaceViewModel = workspaceViewModel;
     _model = model;
     model.PropertyChanged += note_PropertyChanged;
     DynamoSelection.Instance.Selection.CollectionChanged += SelectionOnCollectionChanged;
 }
示例#2
0
 public void UpdateNoteEntity(Note note, NoteModel noteModel)
 {
     note.Title = noteModel.Title;
     note.Message = noteModel.Message;
     note.Price = noteModel.Price;
     note.EmailAddress = new EmailAddress(noteModel.Email);
 }
示例#3
0
 public Note CreateNewNoteFromModel(NoteModel noteModel)
 {
     Contract.Requires<ArgumentNullException>(noteModel != null);
     Contract.Requires<ArgumentException>(noteModel.CategoryId != Guid.Empty, "Note requires a category to belong to.");
     Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(noteModel.Title), "Note requires a title.");
     Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(noteModel.Message), "Note requires a message body.");
     Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(noteModel.Email), "Note requires an email address.");
     Contract.Ensures(Contract.Result<Note>() != null);
     throw new NotImplementedException();
 }
        public void NoteModelDivideNoteIntoGoldSilverAndBronze()
        {
            const int memberNote = 123456789;

            var noteModel = new NoteModel(memberNote);

            Assert.That(noteModel.Bronze, Is.EqualTo(89));
            Assert.That(noteModel.Silver, Is.EqualTo(67));
            Assert.That(noteModel.Gold, Is.EqualTo(12345));
        }
示例#5
0
 public void UpdateNoteEntity(Note note, NoteModel noteModel)
 {
     Contract.Requires<ArgumentNullException>(note != null);
     Contract.Requires<ArgumentNullException>(noteModel != null);
     Contract.Requires<ArgumentException>(noteModel.CategoryId != Guid.Empty, "Note requires a category to belong to.");
     Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(noteModel.Title), "Note requires a title.");
     Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(noteModel.Message), "Note requires a message body.");
     Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(noteModel.Email), "Note requires an email address.");
     Contract.Requires<ArgumentException>(note.Id == noteModel.Id, "Id's of note and note model should match.");
     throw new NotImplementedException();
 }
示例#6
0
        public static NoteModel ToNoteModel(this Note global)
        {
            NoteModel note = new NoteModel
            {
                Id = global.Id,
                Content = global.Content,
                IdBookmark = global.IdBookmark,
                NotePage = global.NotePage
            };

            return note;
        }
示例#7
0
 public static Note FromModel(NoteModel model)
 {
     return new Note() {Id = model.Id, Titre = model.Titre, Description = model.Description
         };
 }
示例#8
0
        public async Task <OpportunityViewModel> OpportunityToViewModelAsync(Opportunity entity, string requestId = "")
        {
            var oppId = entity.Id;

            try
            {
                //var entityDto = TinyMapper.Map<OpportunityViewModel>(entity);
                var viewModel = new OpportunityViewModel
                {
                    Id                   = entity.Id,
                    DisplayName          = entity.DisplayName,
                    Reference            = entity.Reference,
                    Version              = entity.Version,
                    OpportunityState     = OpportunityStateModel.FromValue(entity.Metadata.OpportunityState.Value),
                    OpportunityChannelId = entity.Metadata.OpportunityChannelId,
                    //TODO
                    TemplateLoaded = entity.TemplateLoaded,

                    //TODO : WAVE-4 GENERIC ACCELERATOR Change : start
                    MetaDataFields = entity.Metadata.Fields.Select(
                        field => new OpportunityMetaDataFields()
                    {
                        DisplayName = field.DisplayName,
                        FieldType   = field.FieldType,
                        Screen      = field.Screen,
                        Values      = field.Values
                    }
                        ).ToList(),
                    //TODO : WAVE-4 GENERIC ACCELERATOR Change : end
                    Customer = new CustomerModel
                    {
                        DisplayName = entity.Metadata.Customer.DisplayName,
                        Id          = entity.Metadata.Customer.Id,
                        ReferenceId = entity.Metadata.Customer.ReferenceId
                    },
                    TeamMembers = new List <TeamMemberModel>(),
                    Notes       = new List <NoteModel>(),
                    Checklists  = new List <ChecklistModel>()
                };

                //DealType
                var dealTypeFlag = false;
                dealTypeFlag = entity.Content.Template is null || entity.Content.Template.Id is null;
                if (!dealTypeFlag)
                {
                    viewModel.Template = await _templateHelpers.MapToViewModel(entity.Content.Template);

                    //DealType Processes
                    var checklistPass = false;
                    foreach (var item in entity.Content.Template.ProcessList)
                    {
                        if (item.ProcessType.ToLower() == "checklisttab" && checklistPass == false)
                        {
                            viewModel = await _checkListProcessService.MapToModelAsync(entity, viewModel, requestId);

                            checklistPass = true;
                        }
                        if (item.ProcessType.ToLower() == "customerdecisiontab")
                        {
                            viewModel = await _customerDecisionProcessService.MapToModelAsync(entity, viewModel, requestId);
                        }
                        if (item.ProcessType.ToLower() == "proposalstatustab")
                        {
                            viewModel = await _proposalStatusProcessService.MapToModelAsync(entity, viewModel, requestId);
                        }
                    }
                }


                // TeamMembers
                foreach (var item in entity.Content.TeamMembers.ToList())
                {
                    var memberModel = new TeamMemberModel();
                    memberModel.RoleId            = item.RoleId; //await _userProfileHelpers.RoleToViewModelAsync(item.AssignedRole, requestId);
                    memberModel.Id                = item.Id;
                    memberModel.DisplayName       = item.DisplayName;
                    memberModel.Mail              = item.Fields.Mail;
                    memberModel.UserPrincipalName = item.Fields.UserPrincipalName;
                    memberModel.Title             = item.Fields.Title ?? String.Empty;
                    memberModel.ProcessStep       = item.ProcessStep;
                    memberModel.Permissions       = new List <PermissionModel>();
                    memberModel.AdGroupName       = await _graphUserAppService.GetAdGroupName(item.RoleId, requestId);

                    memberModel.RoleName = item.RoleName;
                    foreach (var permission in item.Fields.Permissions)
                    {
                        memberModel.Permissions.Add(new PermissionModel {
                            Id = permission.Id, Name = permission.Name
                        });
                    }
                    memberModel.TeamsMembership = new TeamsMembershipModel()
                    {
                        Value = item.TeamsMembership.Value,
                        Name  = item.TeamsMembership.Name.ToString()
                    };
                    viewModel.TeamMembers.Add(memberModel);
                }

                // Notes
                foreach (var item in entity.Content.Notes.ToList())
                {
                    var note = new NoteModel();
                    note.Id = item.Id;

                    var userProfile = new UserProfileViewModel();
                    userProfile.Id                = item.CreatedBy.Id;
                    userProfile.DisplayName       = item.CreatedBy.DisplayName;
                    userProfile.Mail              = item.CreatedBy.Fields.Mail;
                    userProfile.UserPrincipalName = item.CreatedBy.Fields.UserPrincipalName;
                    userProfile.UserRoles         = await _userProfileHelpers.RolesToViewModelAsync(item.CreatedBy.Fields.UserRoles, requestId);

                    note.CreatedBy       = userProfile;
                    note.NoteBody        = item.NoteBody;
                    note.CreatedDateTime = item.CreatedDateTime;

                    viewModel.Notes.Add(note);
                }

                // DocumentAttachments
                viewModel.DocumentAttachments = new List <DocumentAttachmentModel>();
                if (entity.DocumentAttachments != null)
                {
                    foreach (var itm in entity.DocumentAttachments)
                    {
                        var doc = new DocumentAttachmentModel();
                        doc.Id            = itm.Id ?? String.Empty;
                        doc.FileName      = itm.FileName ?? String.Empty;
                        doc.Note          = itm.Note ?? String.Empty;
                        doc.Tags          = itm.Tags ?? String.Empty;
                        doc.Category      = new CategoryModel();
                        doc.Category.Id   = itm.Category.Id;
                        doc.Category.Name = itm.Category.Name;
                        doc.DocumentUri   = itm.DocumentUri;

                        viewModel.DocumentAttachments.Add(doc);
                    }
                }

                return(viewModel);
            }
            catch (Exception ex)
            {
                // TODO: _logger.LogError("MapToViewModelAsync error: " + ex);
                throw new ResponseException($"RequestId: {requestId} - OpportunityToViewModelAsync oppId: {oppId} - failed to map opportunity: {ex}");
            }
        }
示例#9
0
 private void RemoveNote(NoteModel note)
 {
     lock (notes)
     {
         if (!notes.Remove(note)) return;
     }
     OnNoteRemoved(note);
 }
示例#10
0
 public void AddNote(NoteModel note, bool centered)
 {
     if (centered)
     {
         var args = new ModelEventArgs(note, true);
         OnRequestNodeCentered(this, args);
     }
     AddNote(note);
 }
示例#11
0
 protected virtual void OnNoteRemoved(NoteModel note)
 {
     var handler = NoteRemoved;
     if (handler != null) handler(note);
 }
示例#12
0
 public NoteViewModel(NoteModel noteModel)
 {
     Note = noteModel;
 }
示例#13
0
        public PartialViewResult _TicketNotes(string id)
        {
            SDWS.Note[] Notes;
            NotesGridModel result = new NotesGridModel();
            List<NoteModel> list = new List<NoteModel>();
            SDWS.GetIncidentReq req = new SDWS.GetIncidentReq();
            SDWS.GetIncidentRequest filter = new SDWS.GetIncidentRequest();
            filter.IncidentNumber = id;
            filter.IncidentIdSpecified = false;
            filter.IncludeAttachments = false;
            filter.IncludeAttachmentsSpecified = false;
            filter.IncludeDefinition = false;
            filter.IncludeDefinitionSpecified = false;
            filter.IncludeNotes = true;
            filter.IncludeNotesSpecified = false;
            req.IncidentRequest = filter;
            SDWS.GetIncidentResponse responce = sDesk.ProcessRequest(req);

            Notes = responce.IncidentResponse.Notes.Where(n=>n.Hidden==false && n.delete==false).OrderBy(n=>n.Timestamp).ToArray();
            foreach (var note in Notes)
            {
                NoteModel n = new NoteModel();
                n.Text = note.Text;
                n.TimeStamp = note.Timestamp;
                n.User = note.User;
                list.Add(n);
            }
            result.Notes = list.ToArray();

            return PartialView(result);
        }
示例#14
0
 private void Model_NoteAdded(NoteModel note)
 {
     var viewModel = new NoteViewModel(this, note);
     _notes.Add(viewModel);
 }
示例#15
0
 public async Task <NoteModel> AddNote(NoteModel model)
 {
     return(await _noteService.AddNote(model));
 }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            UserModel user = new UserModel
            {
                _id            = Guid.Parse("2F4CC25D-C51B-4297-85D7-2B540AFDDE50"),
                FName          = "Alice",
                LName          = "Wong",
                Username       = "******",
                Email          = "*****@*****.**",
                HashedPassword = "******",
                Salt           = "1PMnOU",
                IsAdmin        = true
            };

            UserModel user2 = new UserModel
            {
                _id            = Guid.Parse("b282699b-5f9e-475d-85f4-5ef375e6b596"),
                FName          = "Bob",
                LName          = "Robertson",
                Username       = "******",
                Email          = "*****@*****.**",
                HashedPassword = "******",
                Salt           = "1PMnOU",
                IsAdmin        = false
            };

            var textNote = new
            {
                ID              = Guid.Parse("36ae8212-14f7-4f8a-9314-71a5202e43e6"),
                NoteText        = @"This is some test note text.Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
                            sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim vniam, 
                            quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
                            Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
                            Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
                LastEditedBy_id = user._id,
                LastEditedOn    = DateTime.Parse("2020-10-13")
            };

            var textNote2 = new
            {
                ID              = Guid.Parse("a18ccee1-05cd-4537-af28-fc79eb7984e4"),
                NoteText        = @"This is some test note text.Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
                            sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim vniam, 
                            quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
                            Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
                            Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
                LastEditedBy_id = user2._id,
                LastEditedOn    = DateTime.Parse("2020-10-13")
            };

            AddressModel address = new AddressModel
            {
                ID       = Guid.Parse("4f375627-00fc-4d3c-8175-fc57c2b14e16"),
                Address1 = "123 Easy Street",
                Address2 = "",
                City     = "Sacramento",
                State    = "CA",
                Zip      = "95819"
            };

            AddressModel address2 = new AddressModel
            {
                ID       = Guid.Parse("fcc822ac-55aa-4e12-9dfd-25616caae425"),
                Address1 = "456 North-South-West Street",
                Address2 = "Apt. 57",
                City     = "Sacramento",
                State    = "CA",
                Zip      = "95825"
            };

            AddressModel propertyAddr1 = new AddressModel
            {
                ID       = Guid.Parse("8f6c9cf9-7af6-4ebb-a052-f4f97a1957df"),
                Address1 = "1234 Street Lane",
                Address2 = "",
                City     = "Sacramento",
                State    = "CA",
                Zip      = "95817"
            };

            AddressModel propertyAddr2 = new AddressModel
            {
                ID       = Guid.Parse("3e32a6a4-7c5d-42b6-afd3-ac482d7352d2"),
                Address1 = "8762 Willow Road",
                Address2 = "",
                City     = "Sacramento",
                State    = "CA",
                Zip      = "95818"
            };

            AddressModel moneyBrokersPO = new AddressModel
            {
                ID       = Guid.Parse("4bd597e4-aee4-4130-a4c3-4b312ed48775"),
                Address1 = "P.O. Box 214507",
                Address2 = "",
                City     = "Sacramento",
                State    = "CA",
                Zip      = "95821-0507"
            };

            var borrower = new
            {
                ID                = Guid.Parse("608513C1-C9BC-458C-9ED8-641C442D2925"),
                CompanyName       = "Testing Corp",
                DOB               = DateTime.Parse("1990-10-10"),
                Fname             = "John",
                Lname             = "Smith",
                SSN               = "123-456-7890",
                Title             = "Sir",
                CompanyIsBorrower = false,
                AddressID         = address.ID
            };

            var borrower2 = new
            {
                ID                = Guid.Parse("f0860cdf-bed2-47c8-bfee-9f2b92ed81d0"),
                CompanyName       = "Really Cool Business Ltd.",
                DOB               = DateTime.Parse("1990-10-10"),
                Fname             = "Mallory",
                Lname             = "Johnson",
                SSN               = "098-765-4321",
                Title             = "Miss",
                CompanyIsBorrower = false,
                AddressID         = address2.ID
            };

            var phone = new
            {
                PhoneID    = Guid.Parse("D3D78C50-824C-400C-8FFF-26A002209C01"),
                Phone      = "916-555-5555",
                BorrowerID = borrower.ID
            };

            var phone2 = new
            {
                PhoneID    = Guid.Parse("1258259e-958a-40c0-ae7f-dc3a0485457d"),
                Phone      = "916-555-6789",
                BorrowerID = borrower2.ID
            };

            PhoneModel moneyBrokersPhone = new PhoneModel
            {
                PhoneID = Guid.Parse("3cfb74a5-6894-4e0f-8819-270576c9750f"),
                Phone   = "916-481-9999"
            };

            TrusteeModel trustee = new TrusteeModel
            {
                ID     = Guid.Parse("501BC54C-783D-40EF-8D1F-F93CC2C83D05"),
                Fname  = "Bob",
                Lname  = "Jones",
                Mailto = "123 Easy Street, Sacramento CA, 95825",
            };

            TrusteeModel trustee2 = new TrusteeModel
            {
                ID     = Guid.Parse("c928dfd5-328d-4463-bdc9-0b386523a499"),
                Fname  = "Miguel",
                Lname  = "Sanchez",
                Mailto = "999 Main Lane, Sacramento CA, 95819",
            };

            NoteModel note1 = new NoteModel
            {
                ID                    = Guid.Parse("db7b4f4e-0949-463e-8032-fc8ab19e8e54"),
                LateFee               = true,
                LateChargeDays        = 10,
                LateChargeMinimum     = 5.00f,
                LateChargePercentage  = 10.000f,
                ReturnCheckPercentage = 0.000f,
                ReturnCheckMinFee     = 25.00f,
                ReturnCheckMaxFee     = 25.00f,
                PrepaymentPenalty     = true,
                SubjectToMinCharge    = false,
                MinCharge             = 0.00f,
                BankruptcyAdminFee    = 0.00f,
                RefundIfPaidOff       = false,
                Assumable             = false,
                NoIncomeDocumentation = true
            };

            NoteModel note2 = new NoteModel
            {
                ID                    = Guid.Parse("29b6eed3-a0d5-4968-af2d-42f7b5fdcefa"),
                LateFee               = true,
                LateChargeDays        = 20,
                LateChargeMinimum     = 10.00f,
                LateChargePercentage  = 20.000f,
                ReturnCheckPercentage = 1.000f,
                ReturnCheckMinFee     = 25.00f,
                ReturnCheckMaxFee     = 25.00f,
                PrepaymentPenalty     = true,
                SubjectToMinCharge    = false,
                MinCharge             = 0.00f,
                BankruptcyAdminFee    = 0.00f,
                RefundIfPaidOff       = false,
                Assumable             = false,
                NoIncomeDocumentation = true
            };

            AddtlServicingModel addtl1 = new AddtlServicingModel
            {
                ID = Guid.Parse("c4781f88-4562-4503-9916-b8bef6dac97d"),
                ServicingAmount        = 10.00f,
                ServicingPercent       = 0.000f,
                ServicingPer           = "Month",
                ServicingPayable       = "Month",
                Assume100Investment    = false,
                LateChargeSplit        = 0.000f,
                PrepaySplit            = 0.000f,
                DifferentialOnly       = false,
                LPDInterestRate        = 8.500f,
                AdditionalProvisions   = "",
                BehalfOfAnother        = true,
                PrincipalAsBorrower    = false,
                FundingAPortion        = false,
                MoreThanOneExpl        = "",
                BExplanation           = "",
                BrokerNotAgentRelation = ""
            };

            AddtlServicingModel addtl2 = new AddtlServicingModel
            {
                ID = Guid.Parse("c1e3c0b2-3f16-46c9-a871-3df59e016ad8"),
                ServicingAmount        = 10.00f,
                ServicingPercent       = 0.000f,
                ServicingPer           = "Month",
                ServicingPayable       = "Month",
                Assume100Investment    = false,
                LateChargeSplit        = 0.000f,
                PrepaySplit            = 0.000f,
                DifferentialOnly       = false,
                LPDInterestRate        = 8.500f,
                AdditionalProvisions   = "",
                BehalfOfAnother        = true,
                PrincipalAsBorrower    = false,
                FundingAPortion        = false,
                MoreThanOneExpl        = "",
                BExplanation           = "",
                BrokerNotAgentRelation = ""
            };

            var broker1 = new
            {
                ID                 = Guid.Parse("b5d245b6-3c1e-43fb-8c85-a2ee6fa4edf7"),
                BrokerCompany      = "The Money Brokers, Inc.",
                BrokerAddressID    = moneyBrokersPO.ID,
                BrokerEmail        = "*****@*****.**",
                BrokerPhoneID      = moneyBrokersPhone.PhoneID,
                DRELicense         = "00798745",
                CFLLicense         = "",
                NMLSID             = "307433",
                BrokerFee          = 0.00f,
                AdditionalComp     = false,
                CompensationAmt    = 0.00f,
                BorrowerRepName    = "",
                BorrowerRepDRE     = "",
                BorrowerRepNMLS    = "",
                LenderRepName      = "Melinda D. Wood",
                LenderRepDRE       = "01479727",
                LenderRepNMLS      = "",
                ServicingAddressID = moneyBrokersPO.ID,
                ServicingPhoneID   = moneyBrokersPhone.PhoneID
            };

            var broker2 = new
            {
                ID                 = Guid.Parse("5a59bc28-69a3-442e-9793-162e67684db8"),
                BrokerCompany      = "The Money Brokers, Inc.",
                BrokerAddressID    = moneyBrokersPO.ID,
                BrokerEmail        = "*****@*****.**",
                BrokerPhoneID      = moneyBrokersPhone.PhoneID,
                DRELicense         = "00798745",
                CFLLicense         = "",
                NMLSID             = "307433",
                BrokerFee          = 0.00f,
                AdditionalComp     = false,
                CompensationAmt    = 0.00f,
                BorrowerRepName    = "",
                BorrowerRepDRE     = "",
                BorrowerRepNMLS    = "",
                LenderRepName      = "Melinda D. Wood",
                LenderRepDRE       = "01479727",
                LenderRepNMLS      = "",
                ServicingAddressID = moneyBrokersPO.ID,
                ServicingPhoneID   = moneyBrokersPhone.PhoneID
            };

            DeductionModel brokerDeduction1 = new DeductionModel
            {
                ID     = Guid.Parse("2404938d-f2fa-42fe-bdb1-00d5ed8557ab"),
                Desc   = "Notary Fee",
                RESPA  = 0,
                Amount = 0.00f,
                PPF    = true,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = true,
                RE882M = "Notary Fee"
            };

            DeductionModel brokerDeduction2 = new DeductionModel
            {
                ID     = Guid.Parse("287c3762-87a1-468a-9bf8-c833b1464a22"),
                Desc   = "Processing Fee",
                RESPA  = 810,
                Amount = 500.00f,
                PPF    = true,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = true,
                RE882M = "Processing Fee"
            };

            DeductionModel otherDeduction1 = new DeductionModel
            {
                ID     = Guid.Parse("ccb11145-5699-4f25-af55-04394e3b741b"),
                Desc   = "Appraisal Fee",
                RESPA  = 804,
                Amount = 0.00f,
                PPF    = false,
                EST    = false,
                POE    = false,
                NET    = true,
                SEC32  = false,
                RE882M = "Appraisal Fee"
            };

            DeductionModel otherDeduction2 = new DeductionModel
            {
                ID     = Guid.Parse("52637c14-6aed-4238-8769-cef7f70593c0"),
                Desc   = "Recording Fees",
                RESPA  = 1201,
                Amount = 0.00f,
                PPF    = false,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = false,
                RE882M = "Recording Fees"
            };

            DeductionModel brokerPayment1 = new DeductionModel
            {
                ID     = Guid.Parse("0a263bd6-568a-46ae-b9d5-d001b1fa4fd5"),
                Desc   = "Home Owner's Insurance Premiums",
                RESPA  = 903,
                Amount = 0.00f,
                PPF    = false,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = true,
                RE882M = "Hazard"
            };

            DeductionModel brokerPayment2 = new DeductionModel
            {
                ID     = Guid.Parse("e4a79270-a964-4b8c-aaca-9624ab7ef479"),
                Desc   = "Credit Life or Disability Premiums",
                RESPA  = 0,
                Amount = 0.00f,
                PPF    = false,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = true,
                RE882M = "Credit Life or Disability Premiums"
            };

            DeductionModel otherPayment1 = new DeductionModel
            {
                ID     = Guid.Parse("baa28c91-ff8f-4afe-b229-a88eae5188d8"),
                Desc   = "Tax Service Fee",
                RESPA  = 809,
                Amount = 67.00f,
                PPF    = true,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = true,
                RE882M = "Tax Service Fee"
            };

            DeductionModel otherPayment2 = new DeductionModel
            {
                ID     = Guid.Parse("3f90740c-0af0-4c54-9d77-f7c003685f8e"),
                Desc   = "Broker Opinion of Value",
                RESPA  = 1306,
                Amount = 500.00f,
                PPF    = true,
                EST    = false,
                POE    = false,
                NET    = false,
                SEC32  = true,
                RE882M = "Broker Opinion of Value"
            };

            var costExpense1 = new
            {
                ID = Guid.Parse("1a131472-6c0c-43c7-a5ca-73b4f35d16c8"),
                BrokerDeductions1ID = brokerDeduction1.ID,
                BrokerDeductions2ID = brokerDeduction2.ID,
                OtherDeductions1ID  = otherDeduction1.ID,
                OtherDeductions2ID  = otherDeduction2.ID,
                BrokerPayments1ID   = brokerPayment1.ID,
                BrokerPayments2ID   = brokerPayment2.ID,
                OtherPayments1ID    = otherPayment1.ID,
                OtherPayments2ID    = otherPayment2.ID
            };

            var costExpense2 = new
            {
                ID = Guid.Parse("b6582c6a-b9c9-4051-a4db-4d5e9878166d"),
                BrokerDeductions1ID = brokerDeduction1.ID,
                BrokerDeductions2ID = brokerDeduction2.ID,
                OtherDeductions1ID  = otherDeduction1.ID,
                OtherDeductions2ID  = otherDeduction2.ID,
                BrokerPayments1ID   = brokerPayment1.ID,
                BrokerPayments2ID   = brokerPayment2.ID,
                OtherPayments1ID    = otherPayment1.ID,
                OtherPayments2ID    = otherPayment2.ID
            };

            var property1 = new
            {
                ID                        = Guid.Parse("62c0b988-caa2-4920-a4a8-2e03017486be"),
                Subject                   = false,
                UnincorporatedArea        = false,
                APN                       = "000-1233-012-0000",
                ConstructionType          = "Wood Framed",
                ConstructionDescription   = "SFR 2/2/1",
                LegalDescription          = "Lot 129, as shown on the \"Plat of Vienna Woods\", recorded in the office of the County Recorder of Sacramento County of July 19, 1946, in Book 23 of Maps, Map No. 47",
                FireInsurancePolicyAmt    = 100000.00f,
                AnnualInsurancePremiumAmt = 0.00f,
                LossPayableClause         = "The Money Brokers, Inc., a California corporation",
                AddressID                 = propertyAddr1.ID,
                FireInsuranceAddressID    = moneyBrokersPO.ID,
            };

            var property2 = new
            {
                ID                        = Guid.Parse("1e948fd2-336e-4c5f-8b46-bdaf796828dc"),
                Subject                   = false,
                UnincorporatedArea        = false,
                APN                       = "000-1233-012-0000",
                ConstructionType          = "Wood Framed",
                ConstructionDescription   = "SFR 6/4/1",
                LegalDescription          = "Lot 49, as shown on the \"Plat of Vienna Woods\", recorded in the office of the County Recorder of Sacramento County of August 29, 1968, in Book 29 of Maps, Map No. 84",
                FireInsurancePolicyAmt    = 100000.00f,
                AnnualInsurancePremiumAmt = 0.00f,
                LossPayableClause         = "The Money Brokers, Inc., a California corporation",
                AddressID                 = propertyAddr2.ID,
                FireInsuranceAddressID    = moneyBrokersPO.ID,
            };

            EscrowModel escrow = new EscrowModel
            {
                ID                  = Guid.Parse("5d65e683-d292-4817-901f-837d7226cd3b"),
                CompanyCode         = "",
                EscrowCompany       = "Stewart Title of Sacramento",
                Address             = "3461 Fair Oaks Blvd., Ste 150",
                City                = "Sacramento",
                State               = "CA",
                ZipCode             = "95864",
                Phone               = "916-484-6500",
                Fax                 = "946-482-9391",
                EscrowNumber        = "",
                EscrowOfficer       = "Kristene Morse",
                PolicyType          = "ALTA/CLTA",
                PolicyAmount        = 100000.00f,
                PercentLoan         = 100.00f,
                SpecialEndorsements = "100 AND 116",
                Exceptions          = "",
                ItemElimination     = "",
            };

            var loan = new
            {
                ID                         = Guid.Parse("C0141D0D-1413-4633-9256-98A56E33C0E9"),
                LoanNumber                 = "N1234MW",
                IntRateLockDate            = DateTime.Parse("2020-12-25"),
                PrincipalAmt               = 100000.00f,
                IntRate                    = 9.000f,
                IntRateLender              = 8.5000f,
                PaymentsPerPeriod          = 12,
                TotalPaymentsInPeriods     = 12,
                PaymentsCollectedInAdvance = 0,
                PaymentAmortizationPeriod  = 999,
                RegPaymentAmt              = 750.00f,
                LoanPoints                 = 4.00f,
                MaturityDate               = DateTime.Parse("2021-12-25"),
                TotalLoanFee               = 4000.00f,
                Stage                      = 1,
                TextNotesID                = textNote.ID,
                CreatedBy_id               = user._id,
                CreatedOn                  = DateTime.Parse("2020-10-13"),
                LastChangedOn              = DateTime.Parse("2020-10-13"),
                LastChangedBy_id           = user._id,
                BorrowerID                 = borrower.ID,
                BrokerRefID                = broker1.ID,
                NoteRefID                  = note1.ID,
                AddtlRefID                 = addtl1.ID,
                CostRefID                  = costExpense1.ID,
                EscrowID                   = escrow.ID,
                PropertyID                 = property1.ID,
            };

            var loan2 = new
            {
                ID                         = Guid.Parse("2e029a23-520e-4555-a3c6-77360bfdd2f9"),
                LoanNumber                 = "N5678TB",
                IntRateLockDate            = DateTime.Parse("2020-12-25"),
                PrincipalAmt               = 100000.00f,
                IntRate                    = 9.000f,
                IntRateLender              = 8.5000f,
                PaymentsPerPeriod          = 12,
                TotalPaymentsInPeriods     = 12,
                PaymentsCollectedInAdvance = 0,
                PaymentAmortizationPeriod  = 999,
                RegPaymentAmt              = 750.00f,
                LoanPoints                 = 4.00f,
                MaturityDate               = DateTime.Parse("2021-12-25"),
                TotalLoanFee               = 4000.00f,
                Stage                      = 1,
                TextNotesID                = textNote2.ID,
                CreatedBy_id               = user2._id,
                CreatedOn                  = DateTime.Parse("2020-10-13"),
                LastChangedOn              = DateTime.Parse("2020-10-13"),
                LastChangedBy_id           = user2._id,
                BorrowerID                 = borrower2.ID,
                BrokerRefID                = broker2.ID,
                NoteRefID                  = note2.ID,
                AddtlRefID                 = addtl2.ID,
                CostRefID                  = costExpense2.ID,
                EscrowID                   = escrow.ID,
                PropertyID                 = property2.ID,
            };

            var loanTrustee = new
            {
                ID        = Guid.Parse("D876AFCA-27D8-4BC6-9B48-5C46A2AE30FA"),
                LoanID    = loan.ID,
                TrusteeID = trustee.ID
            };

            var loanTrustee2 = new
            {
                ID        = Guid.Parse("6680e123-12dc-4815-b19f-c6f77afcc715"),
                LoanID    = loan2.ID,
                TrusteeID = trustee2.ID
            };

            modelBuilder.Entity <UserModel>().HasData(new [] { user, user2 });
            modelBuilder.Entity <LoanModel>().HasData(new [] { loan, loan2 });
            modelBuilder.Entity <NotesModel>().HasData(new[] { textNote, textNote2 });
            modelBuilder.Entity <PhoneModel>().HasData(new[] { phone, phone2 });
            modelBuilder.Entity <AddressModel>().HasData(new[] { address, address2, moneyBrokersPO, propertyAddr1, propertyAddr2 });
            modelBuilder.Entity <BorrowerModel>().HasData(new[] { borrower, borrower2 });
            modelBuilder.Entity <TrusteeModel>().HasData(new[] { trustee, trustee2 });
            modelBuilder.Entity <LoanTrusteeModel>().HasData(new[] { loanTrustee, loanTrustee2 });
            modelBuilder.Entity <NoteModel>().HasData(new[] { note1, note2 });
            modelBuilder.Entity <AddtlServicingModel>().HasData(new[] { addtl1, addtl2 });
            modelBuilder.Entity <DeductionModel>().HasData(new[] { brokerDeduction1, brokerDeduction2, otherDeduction1, otherDeduction2, brokerPayment1, brokerPayment2, otherPayment1, otherPayment2 });
            modelBuilder.Entity <CostExpenseModel>().HasData(new[] { costExpense1, costExpense2 });
            modelBuilder.Entity <BrokerServicingModel>().HasData(new[] { broker1, broker2 });
            modelBuilder.Entity <EscrowModel>().HasData(new[] { escrow });
            modelBuilder.Entity <PropertyModel>().HasData(new[] { property1, property2 });
        }
 public NoteEventArgs(NoteModel n, Dictionary <string, object> d)
 {
     Note = n;
     Data = d;
 }
 public IHttpActionResult PostNotes(NoteModel noteModel)
 {
     _dismissalCaseBusiness.UpdateDismissalCaseByNotes(noteModel);
     return(Ok());
 }
示例#19
0
        public void UseOrderCorrectly()
        {
            NoteRepositoryModel clientRepo = new NoteRepositoryModel();
            NoteModel           note101    = new NoteModel();
            NoteModel           note102    = new NoteModel();
            NoteModel           note103    = new NoteModel();
            NoteModel           note104    = new NoteModel();
            NoteModel           note105    = new NoteModel();

            clientRepo.Notes.Add(note101);
            clientRepo.Notes.Add(note102);
            clientRepo.Notes.Add(note103);
            clientRepo.Notes.Add(note104);
            clientRepo.Notes.Add(note105);
            NoteRepositoryModel serverRepo = new NoteRepositoryModel();
            NoteModel           note201    = new NoteModel();
            NoteModel           note202    = note103.Clone();
            NoteModel           note203    = new NoteModel();
            NoteModel           note204    = note102.Clone();
            NoteModel           note205    = new NoteModel();
            NoteModel           note206    = note104.Clone();

            serverRepo.Notes.Add(note201);
            serverRepo.Notes.Add(note202);
            serverRepo.Notes.Add(note203);
            serverRepo.Notes.Add(note204);
            serverRepo.Notes.Add(note205);
            serverRepo.Notes.Add(note206);

            // Take order of client
            NoteRepositoryMerger merger = new NoteRepositoryMerger();

            clientRepo.OrderModifiedAt = new DateTime(2000, 01, 02); // newer
            serverRepo.OrderModifiedAt = new DateTime(2000, 01, 01); // older
            NoteRepositoryModel result = merger.Merge(clientRepo, serverRepo);

            Assert.AreEqual(8, result.Notes.Count);
            Assert.AreEqual(note101.Id, result.Notes[0].Id);
            Assert.AreEqual(note201.Id, result.Notes[1].Id);
            Assert.AreEqual(note102.Id, result.Notes[2].Id);
            Assert.AreEqual(note205.Id, result.Notes[3].Id);
            Assert.AreEqual(note103.Id, result.Notes[4].Id);
            Assert.AreEqual(note203.Id, result.Notes[5].Id);
            Assert.AreEqual(note104.Id, result.Notes[6].Id);
            Assert.AreEqual(note105.Id, result.Notes[7].Id);

            // Take order of server
            clientRepo.OrderModifiedAt = new DateTime(2000, 01, 01); // older
            serverRepo.OrderModifiedAt = new DateTime(2000, 01, 02); // newer
            result = merger.Merge(clientRepo, serverRepo);

            Assert.AreEqual(8, result.Notes.Count);
            Assert.AreEqual(note201.Id, result.Notes[0].Id);
            Assert.AreEqual(note101.Id, result.Notes[1].Id);
            Assert.AreEqual(note202.Id, result.Notes[2].Id);
            Assert.AreEqual(note203.Id, result.Notes[3].Id);
            Assert.AreEqual(note204.Id, result.Notes[4].Id);
            Assert.AreEqual(note205.Id, result.Notes[5].Id);
            Assert.AreEqual(note206.Id, result.Notes[6].Id);
            Assert.AreEqual(note105.Id, result.Notes[7].Id);
        }
 public void InsertNote(NoteModel note)
 {
     _sql.SaveData("dbo.spNote_Insert", note, "TulipData");
 }
示例#21
0
 public NoteViewModel(WorkspaceViewModel workspaceViewModel, NoteModel model)
 {
     this.WorkspaceViewModel = workspaceViewModel;
     _model = model;
     model.PropertyChanged += note_PropertyChanged;
     DynamoSelection.Instance.Selection.CollectionChanged += SelectionOnCollectionChanged;
     ZIndex = ++StaticZIndex; // places the note on top of all nodes/notes
 }
示例#22
0
 public Note CreateNewNoteFromModel(NoteModel noteModel)
 {
     return new Note(noteModel.Title, noteModel.Message, noteModel.Price, new EmailAddress(noteModel.Email));
 }
        public async Task <JsonResult> ChangeStatus([FromBody] NoteModel model)
        {
            Note note = await _noteRepo.ChangeStatus(model);

            return(Json(note));
        }
示例#24
0
 public CreateNoteCommand(NoteModel noteModel)
 {
     NoteModel = noteModel;
 }
示例#25
0
 public NoteViewModel()
 {
     Note = new NoteModel();
 }
示例#26
0
 private void Model_NoteRemoved(NoteModel note)
 {
     _notes.Remove(_notes.First(x => x.Model == note));
 }
        public async Task <IActionResult> GetNoteDetails(int NoteId)
        {
            NoteModel result = await _noteRepo.GetNoteById(NoteId);

            return(View(result));
        }
示例#28
0
 private void Model_NoteRemoved(NoteModel note)
 {
     _notes.Remove(_notes.First(x => x.Model == note));
 }
示例#29
0
        private void Model_NoteAdded(NoteModel note)
        {
            var viewModel = new NoteViewModel(this, note);

            Notes.Add(viewModel);
        }
示例#30
0
 public void SaveNote(NoteModel noteModel)
 {
     _notes.Add(noteModel);
 }
示例#31
0
 public void DeleteNote(NoteModel noteModel)
 {
     _notes.Remove(noteModel);
 }
 public NoteEventArgs(NoteModel n, Dictionary<string, object> d)
 {
     Note = n;
     Data = d;
 }
示例#33
0
 public NoteUpdatedEvent(NoteModel model)
 {
     Model = model;
 }
示例#34
0
        private void AddNote(NoteModel note)
        {
            lock (notes)
            {
                notes.Add(note);
            }

            OnNoteAdded(note);
        }
示例#35
0
    public override void Set(NoteModel note)
    {
        if (note.ConnectedNotes == null)
        {
            gameObject.SetActive(false);
            return;
        }
        if (note.ConnectedNotes[0] == NoteLengthType.None && note.ConnectedNotes[1] == NoteLengthType.None)
        {
            gameObject.SetActive(false);
            return;
        }
        gameObject.SetActive(true);

        NoteLengthType leftType  = note.ConnectedNotes[0];
        NoteLengthType rightType = note.ConnectedNotes[1];

        if (leftType < NoteLengthType.T8 && isLeft)
        {
            gameObject.SetActive(false);
            return;
        }
        if (rightType < NoteLengthType.T8 && !isLeft)
        {
            gameObject.SetActive(false);
            return;
        }

        if (leftType == rightType && leftType == note.LengthType)
        {
            Work(note, note.LengthType, note.LengthType);
            return;
        }

        if (isLeft)
        {
            if (leftType < note.LengthType)
            {
                if (rightType > leftType)
                {
                    Work(note, leftType, leftType);
                    return;
                }
                Work(note, note.LengthType, leftType);
                return;
            }
            Work(note, note.LengthType, note.LengthType);
            return;
        }
        else
        {
            if (rightType < note.LengthType)
            {
                if (leftType >= rightType)
                {
                    Work(note, rightType, rightType);
                    return;
                }
                Work(note, note.LengthType, rightType);
                return;
            }
            Work(note, note.LengthType, note.LengthType);
            return;
        }
    }
示例#36
0
        public NoteModel AddNote(bool centerNote, double xPos, double yPos, string text, Guid id)
        {
            var noteModel = new NoteModel(xPos, yPos, string.IsNullOrEmpty(text) ? Resources.NewNoteString : text, id);

            //if we have null parameters, the note is being added
            //from the menu, center the view on the note

            AddNote(noteModel, centerNote);
            return noteModel;
        }
示例#37
0

        
示例#38
0
        /// <summary>
        ///     Paste ISelectable objects from the clipboard to the workspace at specified point.
        /// </summary>
        /// <param name="targetPoint">Location where data will be pasted</param>
        /// <param name="useOffset">Indicates whether we will use current workspace offset or paste nodes
        /// directly in this point. </param>
        public void Paste(Point2D targetPoint, bool useOffset = true)
        {
            if (useOffset)
            {
                // Provide a small offset when pasting so duplicate pastes aren't directly on top of each other
                CurrentWorkspace.IncrementPasteOffset();
            }

            //clear the selection so we can put the
            //paste contents in
            DynamoSelection.Instance.ClearSelection();

            //make a lookup table to store the guids of the
            //old models and the guids of their pasted versions
            var modelLookup = new Dictionary<Guid, ModelBase>();

            //make a list of all newly created models so that their
            //creations can be recorded in the undo recorder.
            var createdModels = new List<ModelBase>();

            var nodes = ClipBoard.OfType<NodeModel>();
            var connectors = ClipBoard.OfType<ConnectorModel>();
            var notes = ClipBoard.OfType<NoteModel>();
            var annotations = ClipBoard.OfType<AnnotationModel>();

            // Create the new NoteModel's
            var newNoteModels = new List<NoteModel>();
            foreach (var note in notes)
            {
                var noteModel = new NoteModel(note.X, note.Y, note.Text, Guid.NewGuid());
                //Store the old note as Key and newnote as value.
                modelLookup.Add(note.GUID,noteModel);
                newNoteModels.Add(noteModel);
            }

            var xmlDoc = new XmlDocument();

            // Create the new NodeModel's
            var newNodeModels = new List<NodeModel>();
            foreach (var node in nodes)
            {
                NodeModel newNode;

                if (CurrentWorkspace is HomeWorkspaceModel && (node is Symbol || node is Output))
                {
                    var symbol = (node is Symbol
                        ? (node as Symbol).InputSymbol
                        : (node as Output).Symbol);
                    var code = (string.IsNullOrEmpty(symbol) ? "x" : symbol) + ";";
                    newNode = new CodeBlockNodeModel(code, node.X, node.Y, LibraryServices, CurrentWorkspace.ElementResolver);
                }
                else
                {
                    var dynEl = node.Serialize(xmlDoc, SaveContext.Copy);
                    newNode = NodeFactory.CreateNodeFromXml(dynEl, SaveContext.Copy, CurrentWorkspace.ElementResolver);
                }

                var lacing = node.ArgumentLacing.ToString();
                newNode.UpdateValue(new UpdateValueParams("ArgumentLacing", lacing));
                if (!string.IsNullOrEmpty(node.NickName) && !(node is Symbol) && !(node is Output))
                    newNode.NickName = node.NickName;

                newNode.Width = node.Width;
                newNode.Height = node.Height;

                modelLookup.Add(node.GUID, newNode);

                newNodeModels.Add(newNode);
            }

            var newItems = newNodeModels.Concat<ModelBase>(newNoteModels);

            var shiftX = targetPoint.X - newItems.Min(item => item.X);
            var shiftY = targetPoint.Y - newItems.Min(item => item.Y);
            var offset = useOffset ? CurrentWorkspace.CurrentPasteOffset : 0;

            foreach (var model in newItems)
            {
                model.X = model.X + shiftX + offset;
                model.Y = model.Y + shiftY + offset;
            }

            // Add the new NodeModel's to the Workspace
            foreach (var newNode in newNodeModels)
            {
                CurrentWorkspace.AddAndRegisterNode(newNode, false);
                createdModels.Add(newNode);
            }

            // TODO: is this required?
            OnRequestLayoutUpdate(this, EventArgs.Empty);

            // Add the new NoteModel's to the Workspace
            foreach (var newNote in newNoteModels)
            {
                CurrentWorkspace.AddNote(newNote, false);
                createdModels.Add(newNote);
            }

            ModelBase start;
            ModelBase end;
            var newConnectors =
                from c in connectors

                // If the guid is in nodeLookup, then we connect to the new pasted node. Otherwise we
                // re-connect to the original.
                let startNode =
                    modelLookup.TryGetValue(c.Start.Owner.GUID, out start)
                        ? start as NodeModel
                        : CurrentWorkspace.Nodes.FirstOrDefault(x => x.GUID == c.Start.Owner.GUID)
                let endNode =
                    modelLookup.TryGetValue(c.End.Owner.GUID, out end)
                        ? end as NodeModel
                        : CurrentWorkspace.Nodes.FirstOrDefault(x => x.GUID == c.End.Owner.GUID)

                // Don't make a connector if either end is null.
                where startNode != null && endNode != null
                select
                    ConnectorModel.Make(startNode, endNode, c.Start.Index, c.End.Index);

            createdModels.AddRange(newConnectors);

            //Grouping depends on the selected node models.
            //so adding the group after nodes / notes are added to workspace.
            //select only those nodes that are part of a group.
            var newAnnotations = new List<AnnotationModel>();
            foreach (var annotation in annotations)
            {
                var annotationNodeModel = new List<NodeModel>();
                var annotationNoteModel = new List<NoteModel>();
                // some models can be deleted after copying them,
                // so they need to be in pasted annotation as well
                var modelsToRestore = annotation.DeletedModelBases.Intersect(ClipBoard);
                var modelsToAdd = annotation.SelectedModels.Concat(modelsToRestore);
                // checked condition here that supports pasting of multiple groups
                foreach (var models in modelsToAdd)
                {
                    ModelBase mbase;
                    modelLookup.TryGetValue(models.GUID, out mbase);
                    if (mbase is NodeModel)
                    {
                        annotationNodeModel.Add(mbase as NodeModel);
                    }
                    if (mbase is NoteModel)
                    {
                        annotationNoteModel.Add(mbase as NoteModel);
                    }
                }

                var annotationModel = new AnnotationModel(annotationNodeModel, annotationNoteModel)
                {
                    GUID = Guid.NewGuid(),
                    AnnotationText = annotation.AnnotationText,
                    Background = annotation.Background,
                    FontSize = annotation.FontSize
                };

                newAnnotations.Add(annotationModel);
            }

            // Add the new Annotation's to the Workspace
            foreach (var newAnnotation in newAnnotations)
            {
                CurrentWorkspace.AddAnnotation(newAnnotation);
                createdModels.Add(newAnnotation);
                AddToSelection(newAnnotation);
            }

            // adding an annotation overrides selection, so add nodes and notes after
            foreach (var item in newItems)
            {
                AddToSelection(item);
            }

            // Record models that are created as part of the command.
            CurrentWorkspace.RecordCreatedModels(createdModels);
        }
示例#39
0
 public override void Set(NoteModel note)
 {
     column.gameObject.SetActive(note.LengthType != NoteLengthType.T1);
     column.color = note.NoteColor;
 }