Пример #1
0
        public static void InsertForCompany(List <RollBackDistributionCompanyInfo> finalList, int userID)
        {
            RollBackDistribution rdb = new RollBackDistribution();

            rdb.BranchID = null;
            decimal[] values = getSums(finalList);
            rdb.BrokerageValue     = values[1];
            rdb.TotalValue         = values[0];
            rdb.StartDate          = RollBackDistributionCompanyInfo.getDate(finalList, true);
            rdb.EndDate            = RollBackDistributionCompanyInfo.getDate(finalList, false);
            rdb.Date               = DateTime.Now;
            rdb.InsuranceCompanyID = finalList.First().InsuranceCompanyID;
            rdb.Number             = GetNextNumber();
            rdb.RollBackStatusID   = RollBackDistributionStatuse.GetByCode(RollBackDistributionStatuse.NEPOTVRDENA_OD_KOMPANIJA).ID;
            rdb.UserID             = userID;
            rdb.Insert();

            RollBackDistributionStatuse finalized = RollBackDistributionStatuse.GetByCode(RollBackDistributionStatuse.ZAVRSENA_OD_FILIJALA);

            foreach (RollBackDistributionCompanyInfo info in finalList)
            {
                RollBackDistribution.Get(info.ID).RollBackStatusID = finalized.ID;
                Table.Context.SubmitChanges();
                RollBackDistributionItem.InsertForCompany(info, rdb.ID);
                RollBackDistributionParentship.InsertParentShip(rdb.ID, info.ID);
            }
        }
Пример #2
0
        public static void SetConfirmedFromCompany(RollBackDistribution rbd)
        {
            RollBackDistributionStatuse rbds = RollBackDistributionStatuse.GetByCode(RollBackDistributionStatuse.POTVRDENA_OD_KOMPANIJA);

            rbd.RollBackStatusID = rbds.ID;
            RollBackDistributionStatuse.Table.Context.SubmitChanges();
        }
Пример #3
0
        public static void SetDiscardedFromCompany(RollBackDistribution rbd)
        {
            RollBackDistributionStatuse rbds = RollBackDistributionStatuse.GetByCode(RollBackDistributionStatuse.STORNIRANA_OD_KOMPANIJA);

            rbd.RollBackStatusID = rbds.ID;
            RollBackDistributionStatuse.Table.Context.SubmitChanges();
            RollBackDistributionItem.UnRollBackPolicies(rbd);
        }
Пример #4
0
        public static void InsertByInsuranceSubTypeAndCompanyFromBranch(int companyID, int branchID, int userID, List <RollBackDistributionInfo> listOldRollBackInfos, List <RollBackDistributionInfo> listNewRollBackInfos, DateTime startDate, DateTime endDate)
        {
            RollBackDistribution rbd = new RollBackDistribution();

            rbd.BranchID           = branchID;
            rbd.Date               = DateTime.Now;
            rbd.StartDate          = startDate;
            rbd.EndDate            = endDate;
            rbd.InsuranceCompanyID = companyID;
            rbd.Number             = GetNextNumber();
            rbd.RollBackStatusID   = RollBackDistributionStatuse.GetByCode(RollBackDistributionStatuse.NEPOTVRDENA_OD_FILIJALA).ID;
            rbd.UserID             = userID;
            rbd.Insert();
            RollBackDistributionItem.InsertItems(rbd, listOldRollBackInfos, listNewRollBackInfos);
        }