Пример #1
0
 /// <summary>
 /// Opens settlement window after click generate list button. If excel file is imported then loads new window and displays
 /// two connected lists with insurance policies assigned to user.
 /// </summary>
 private void GenerateSettlementButton(object sender, RoutedEventArgs e)
 {
     if (MakeNewLIstFromMerge.MergeListsAndFilter() != null)
     {
         SettlementWindow showWindow = new SettlementWindow();
         showWindow.ShowDialog();
     }
 }
Пример #2
0
        /// <summary>
        ///Changes status field in insurance policy in database if insurance policy  that number is in settlement.
        ///If insurance policy is marked as "R" then won't shows in not settled insrance policy datagrid.
        ///If status insurance policy field is null than it's shows that policy as not settled.
        /// </summary>
        public static void ForSettled()
        {
            masterEntities dc = new masterEntities(SaveConnectionStringsAsStringToMethodParameter.connstringMasterEntitiesConnectionDatabase);

            var userList     = ShowImportedList.userList;
            var importedList = ShowImportedList.importedList;
            var checkNumber  = MakeNewLIstFromMerge.MergeListsAndFilter().Select(n => n.settlementPolicyNumber).FirstOrDefault();
            var addStatus    = dc.userPolicyData.Where(n => n.policyNumber.Equals(checkNumber)).FirstOrDefault();

            if (addStatus != null)
            {
                if (addStatus.policyNumber != null)
                {
                    addStatus.policyStatus = "R";
                    dc.SaveChanges();
                }
            }
        }