private string GetApprovalType()
        {
            var approvalType = string.Empty;

            var reinvestment   = ReinvestmentCost.FirstOrDefault(e => e.ConsInfoID == Id);
            var writeOffAmount = WriteOffAmount.FirstOrDefault(e => e.ConsInfoID == Id);

            if (reinvestment != null &&
                writeOffAmount != null)
            {
                var totalVariance = GetTotalVariance(reinvestment, writeOffAmount);

                if (totalVariance <= (decimal)0.05)
                {
                    approvalType = "LeqFivePercent";
                }
                else if (totalVariance > (decimal)0.05 &&
                         totalVariance <= (decimal)0.1)
                {
                    approvalType = "BetweenFiveAndTenPercent";
                }
                else if (totalVariance > (decimal)0.1)
                {
                    approvalType = "MoreThanPercent";
                }
            }


            return(approvalType);
        }
Beispiel #2
0
        public void Save(bool pushOrNot)
        {
            using (TransactionScope tranScope = new TransactionScope())
            {
                var projectInfo = ProjectInfo.Get(Id);
                if (projectInfo == null)
                {
                    ProjectId = ProjectInfo.CreateDLProject(Id, FlowCode.Reimage, USCode, NodeCode.Start, ClientCookie.UserCode, pushOrNot);
                    var store = StoreBasicInfo.GetStorInfo(USCode);

                    var reimageInfo = new ReimageInfo();
                    reimageInfo.Id                 = Guid.NewGuid();
                    reimageInfo.ProjectId          = ProjectId;
                    reimageInfo.USCode             = USCode;
                    reimageInfo.CreateDate         = DateTime.Now;
                    reimageInfo.CreateUserAccount  = ClientCookie.UserCode;
                    reimageInfo.CreateUserNameENUS = ClientCookie.UserNameENUS;
                    reimageInfo.CreateUserNameZHCN = ClientCookie.UserNameZHCN;
                    reimageInfo.AssetRepAccount    = "";
                    reimageInfo.AssetRepNameZHCN   = "";
                    reimageInfo.AssetRepNameENUS   = "";
                    reimageInfo.AssetActorAccount  = "";
                    reimageInfo.AssetActorNameZHCN = "";
                    reimageInfo.AssetActorNameENUS = "";
                    reimageInfo.FinanceAccount     = "";
                    reimageInfo.FinanceNameZHCN    = "";
                    reimageInfo.FinanceNameENUS    = "";
                    reimageInfo.PMAccount          = "";
                    reimageInfo.PMNameZHCN         = "";
                    reimageInfo.PMNameENUS         = "";
                    reimageInfo.LegalAccount       = "";
                    reimageInfo.LegalNameZHCN      = "";
                    reimageInfo.LegalNameENUS      = "";
                    reimageInfo.StoreNameENUS      = store.NameENUS;
                    reimageInfo.StoreNameZHCN      = store.NameZHCN;
                    reimageInfo.GBDate             = GBDate;
                    reimageInfo.ReopenDate         = ReopenDate;
                    reimageInfo.Add();

                    var reimageConsInfo = new ReimageConsInfo();
                    reimageConsInfo.Id                = Guid.NewGuid();
                    reimageConsInfo.ProjectId         = ProjectId;
                    reimageConsInfo.IsHistory         = false;
                    reimageConsInfo.CreateTime        = DateTime.Now;
                    reimageConsInfo.CreateUserAccount = ClientCookie.UserCode;
                    reimageConsInfo.Add();

                    var reinvestmentBasicInfo = new ReinvestmentBasicInfo();
                    reinvestmentBasicInfo.ConsInfoID        = reimageConsInfo.Id;
                    reinvestmentBasicInfo.RightSizingSeatNo = RightSizingSeatNO;
                    reinvestmentBasicInfo.NewDesignType     = AfterReimageDesignType;
                    reinvestmentBasicInfo.Add();

                    var reimageConsInvtChecking = new ReimageConsInvtChecking();
                    reimageConsInvtChecking.Id                = Guid.NewGuid();
                    reimageConsInvtChecking.ProjectId         = ProjectId;
                    reimageConsInvtChecking.IsHistory         = false;
                    reimageConsInvtChecking.CreateTime        = DateTime.Now;
                    reimageConsInvtChecking.CreateUserAccount = ClientCookie.UserCode;
                    reimageConsInvtChecking.Add();

                    var writeOffAmount = new WriteOffAmount();
                    writeOffAmount.Id            = Guid.NewGuid();
                    writeOffAmount.ConsInfoID    = reimageConsInvtChecking.Id;
                    writeOffAmount.TotalWriteOff = Reimage_Total_WO_Proj;
                    writeOffAmount.TotalActual   = Reimage_Total_WO_Act;
                    writeOffAmount.Add();

                    var reinvestmentCost = new ReinvestmentCost();
                    reinvestmentCost.Id         = Guid.NewGuid();
                    reinvestmentCost.ConsInfoID = reimageConsInvtChecking.Id;
                    reinvestmentCost.TotalReinvestmentBudget = Reimage_Total_Reinvestment_Proj;
                    reinvestmentCost.TotalReinvestmentPMAct  = Reimage_Total_Reinvestment_Act;
                    reinvestmentCost.Add();

                    var reopenMemo = new ReopenMemo();
                    reopenMemo.Id        = Guid.NewGuid();
                    reopenMemo.ProjectId = ProjectId;
                    reopenMemo.NewMcCafe = false;
                    reopenMemo.NewKiosk  = false;
                    reopenMemo.NewMDS    = false;
                    reopenMemo.Is24H     = false;
                    reopenMemo.AftARSN   = AfterReimageSeatNO;
                    reopenMemo.Add();
                }
                else
                {
                    ProjectId            = projectInfo.ProjectId;
                    projectInfo.IsPushed = pushOrNot;
                    projectInfo.Update();
                    var store = StoreBasicInfo.GetStorInfo(USCode);

                    var reimageInfo = ReimageInfo.FirstOrDefault(i => i.ProjectId == ProjectId);
                    if (reimageInfo != null)
                    {
                        reimageInfo.GBDate     = GBDate;
                        reimageInfo.ReopenDate = ReopenDate;
                        reimageInfo.Update();
                    }
                    else
                    {
                        reimageInfo                    = new ReimageInfo();
                        reimageInfo.Id                 = Guid.NewGuid();
                        reimageInfo.ProjectId          = ProjectId;
                        reimageInfo.USCode             = USCode;
                        reimageInfo.CreateDate         = DateTime.Now;
                        reimageInfo.CreateUserAccount  = ClientCookie.UserCode;
                        reimageInfo.CreateUserNameENUS = ClientCookie.UserNameENUS;
                        reimageInfo.CreateUserNameZHCN = ClientCookie.UserNameZHCN;
                        reimageInfo.AssetRepAccount    = "";
                        reimageInfo.AssetRepNameZHCN   = "";
                        reimageInfo.AssetRepNameENUS   = "";
                        reimageInfo.AssetActorAccount  = "";
                        reimageInfo.AssetActorNameZHCN = "";
                        reimageInfo.AssetActorNameENUS = "";
                        reimageInfo.FinanceAccount     = "";
                        reimageInfo.FinanceNameZHCN    = "";
                        reimageInfo.FinanceNameENUS    = "";
                        reimageInfo.PMAccount          = "";
                        reimageInfo.PMNameZHCN         = "";
                        reimageInfo.PMNameENUS         = "";
                        reimageInfo.LegalAccount       = "";
                        reimageInfo.LegalNameZHCN      = "";
                        reimageInfo.LegalNameENUS      = "";
                        reimageInfo.StoreNameENUS      = store.NameENUS;
                        reimageInfo.StoreNameZHCN      = store.NameZHCN;
                        reimageInfo.GBDate             = GBDate;
                        reimageInfo.ReopenDate         = ReopenDate;
                        reimageInfo.Add();
                    }

                    var reimageConsInfo = ReimageConsInfo.FirstOrDefault(i => i.ProjectId == ProjectId && i.IsHistory == false);
                    if (reimageConsInfo != null)
                    {
                        var reinvestmentBasicInfo = ReinvestmentBasicInfo.FirstOrDefault(i => i.ConsInfoID == reimageConsInfo.Id);
                        if (reinvestmentBasicInfo != null)
                        {
                            reinvestmentBasicInfo.RightSizingSeatNo = RightSizingSeatNO;
                            reinvestmentBasicInfo.NewDesignType     = AfterReimageDesignType;
                            reinvestmentBasicInfo.Update();
                        }
                        else
                        {
                            reinvestmentBasicInfo                   = new ReinvestmentBasicInfo();
                            reinvestmentBasicInfo.ConsInfoID        = reimageConsInfo.Id;
                            reinvestmentBasicInfo.RightSizingSeatNo = RightSizingSeatNO;
                            reinvestmentBasicInfo.NewDesignType     = AfterReimageDesignType;
                            reinvestmentBasicInfo.Add();
                        }
                    }
                    else
                    {
                        reimageConsInfo                   = new ReimageConsInfo();
                        reimageConsInfo.Id                = Guid.NewGuid();
                        reimageConsInfo.ProjectId         = ProjectId;
                        reimageConsInfo.IsHistory         = false;
                        reimageConsInfo.CreateTime        = DateTime.Now;
                        reimageConsInfo.CreateUserAccount = ClientCookie.UserCode;
                        reimageConsInfo.Add();

                        var reinvestmentBasicInfo = new ReinvestmentBasicInfo();
                        reinvestmentBasicInfo.ConsInfoID        = reimageConsInfo.Id;
                        reinvestmentBasicInfo.RightSizingSeatNo = RightSizingSeatNO;
                        reinvestmentBasicInfo.NewDesignType     = AfterReimageDesignType;
                        reinvestmentBasicInfo.Add();
                    }

                    var reimageConsInvtChecking = ReimageConsInvtChecking.FirstOrDefault(i => i.ProjectId == ProjectId && i.IsHistory == false);
                    if (reimageConsInvtChecking != null)
                    {
                        var writeOffAmount = WriteOffAmount.FirstOrDefault(i => i.ConsInfoID == reimageConsInvtChecking.Id);
                        if (writeOffAmount != null)
                        {
                            writeOffAmount.TotalWriteOff = Reimage_Total_WO_Proj;
                            writeOffAmount.TotalActual   = Reimage_Total_WO_Act;
                            writeOffAmount.Update();
                        }
                        else
                        {
                            writeOffAmount               = new WriteOffAmount();
                            writeOffAmount.Id            = Guid.NewGuid();
                            writeOffAmount.ConsInfoID    = reimageConsInvtChecking.Id;
                            writeOffAmount.TotalWriteOff = Reimage_Total_WO_Proj;
                            writeOffAmount.TotalActual   = Reimage_Total_WO_Act;
                            writeOffAmount.Add();
                        }

                        var reinvestmentCost = ReinvestmentCost.FirstOrDefault(i => i.ConsInfoID == reimageConsInvtChecking.Id);
                        if (reinvestmentCost != null)
                        {
                            reinvestmentCost.TotalReinvestmentBudget = Reimage_Total_Reinvestment_Proj;
                            reinvestmentCost.TotalReinvestmentPMAct  = Reimage_Total_Reinvestment_Act;
                            reinvestmentCost.Update();
                        }
                        else
                        {
                            reinvestmentCost            = new ReinvestmentCost();
                            reinvestmentCost.Id         = Guid.NewGuid();
                            reinvestmentCost.ConsInfoID = reimageConsInvtChecking.Id;
                            reinvestmentCost.TotalReinvestmentBudget = Reimage_Total_Reinvestment_Proj;
                            reinvestmentCost.TotalReinvestmentPMAct  = Reimage_Total_Reinvestment_Act;
                            reinvestmentCost.Add();
                        }
                    }
                    else
                    {
                        reimageConsInvtChecking                   = new ReimageConsInvtChecking();
                        reimageConsInvtChecking.Id                = Guid.NewGuid();
                        reimageConsInvtChecking.ProjectId         = ProjectId;
                        reimageConsInvtChecking.IsHistory         = false;
                        reimageConsInvtChecking.CreateTime        = DateTime.Now;
                        reimageConsInvtChecking.CreateUserAccount = ClientCookie.UserCode;
                        reimageConsInvtChecking.Add();

                        var writeOffAmount = new WriteOffAmount();
                        writeOffAmount.Id            = Guid.NewGuid();
                        writeOffAmount.ConsInfoID    = reimageConsInvtChecking.Id;
                        writeOffAmount.TotalWriteOff = Reimage_Total_WO_Proj;
                        writeOffAmount.TotalActual   = Reimage_Total_WO_Act;
                        writeOffAmount.Add();

                        var reinvestmentCost = new ReinvestmentCost();
                        reinvestmentCost.Id         = Guid.NewGuid();
                        reinvestmentCost.ConsInfoID = reimageConsInvtChecking.Id;
                        reinvestmentCost.TotalReinvestmentBudget = Reimage_Total_Reinvestment_Proj;
                        reinvestmentCost.TotalReinvestmentPMAct  = Reimage_Total_Reinvestment_Act;
                        reinvestmentCost.Add();
                    }

                    var reopenMemo = ReopenMemo.FirstOrDefault(i => i.ProjectId == ProjectId);
                    if (reopenMemo != null)
                    {
                        reopenMemo.AftARSN = AfterReimageSeatNO;
                        reopenMemo.Update();
                    }
                    else
                    {
                        reopenMemo           = new ReopenMemo();
                        reopenMemo.Id        = Guid.NewGuid();
                        reopenMemo.ProjectId = ProjectId;
                        reopenMemo.NewMcCafe = false;
                        reopenMemo.NewKiosk  = false;
                        reopenMemo.NewMDS    = false;
                        reopenMemo.Is24H     = false;
                        reopenMemo.AftARSN   = AfterReimageSeatNO;
                        reopenMemo.Add();
                    }
                }
                tranScope.Complete();
            }
        }
Beispiel #3
0
        public void Save(bool pushOrNot)
        {
            using (TransactionScope tranScope = new TransactionScope())
            {
                var projectInfo = ProjectInfo.Get(Id);
                if (projectInfo == null)
                {
                    ProjectId = ProjectInfo.CreateDLProject(Id, FlowCode.Renewal, USCode, NodeCode.Start, ClientCookie.UserCode, pushOrNot);

                    var renewalInfo = new RenewalInfo();
                    renewalInfo.Id                 = Guid.NewGuid();
                    renewalInfo.ProjectId          = ProjectId;
                    renewalInfo.USCode             = USCode;
                    renewalInfo.RenewalYears       = 0;
                    renewalInfo.NeedProjectCostEst = false;
                    renewalInfo.CreateTime         = DateTime.Now;
                    renewalInfo.CreateUserAccount  = ClientCookie.UserCode;
                    renewalInfo.Add();

                    var renewalConsInfo = new RenewalConsInfo();
                    renewalConsInfo.Id                = Guid.NewGuid();
                    renewalConsInfo.ProjectId         = ProjectId;
                    renewalConsInfo.HasReinvenstment  = false;
                    renewalConsInfo.IsHistory         = false;
                    renewalConsInfo.CreateTime        = DateTime.Now;
                    renewalConsInfo.CreateUserAccount = ClientCookie.UserCode;
                    renewalConsInfo.ProcInstId        = 0;
                    renewalConsInfo.Add();

                    var writeOffAmount = new WriteOffAmount();
                    writeOffAmount.Id            = Guid.NewGuid();
                    writeOffAmount.ConsInfoID    = renewalConsInfo.Id;
                    writeOffAmount.TotalWriteOff = Renewal_Total_WO_Proj;
                    writeOffAmount.TotalNBV      = Renewal_Total_WO_Act;
                    writeOffAmount.Add();

                    var reinvestmentCost = new ReinvestmentCost();
                    reinvestmentCost.Id                    = Guid.NewGuid();
                    reinvestmentCost.ConsInfoID            = renewalConsInfo.Id;
                    reinvestmentCost.TotalReinvestmentNorm = Renewal_Total_Reinvestment_Proj;
                    reinvestmentCost.LHINorm               = Renewal_Total_Reinvestment_Act;
                    reinvestmentCost.Add();

                    var renewalAnalysis = new RenewalAnalysis();
                    renewalAnalysis.Id                  = Guid.NewGuid();
                    renewalAnalysis.ProjectId           = ProjectId;
                    renewalAnalysis.CreateUserAccount   = ClientCookie.UserCode;
                    renewalAnalysis.CreateTime          = DateTime.Now;
                    renewalAnalysis.IsHistory           = false;
                    renewalAnalysis.FairMarketRentAgent = Fair_Market_Rent;
                    renewalAnalysis.DR1stTYAmount       = DR1stTYAmount;
                    renewalAnalysis.RentDeviation       = RentDeviation;
                    renewalAnalysis.DRMFLastTYSales     = DRMFLastTYSales;
                    renewalAnalysis.DRMF1stTY           = DRMF1stTY;
                    renewalAnalysis.Add();

                    var renewalTool = new RenewalTool();
                    renewalTool.Id                = Guid.NewGuid();
                    renewalTool.ProjectId         = ProjectId;
                    renewalTool.IsHistory         = false;
                    renewalTool.CreateTime        = DateTime.Now;
                    renewalTool.CreateUserAccount = ClientCookie.UserCode;
                    renewalTool.Add();

                    var renewalToolFinMeasureOutput = new RenewalToolFinMeasureOutput();
                    renewalToolFinMeasureOutput.Id                 = Guid.NewGuid();
                    renewalToolFinMeasureOutput.ToolId             = renewalTool.Id;
                    renewalToolFinMeasureOutput.RentAsProdSalesYr1 = SRMFLastTYSales;
                    renewalToolFinMeasureOutput.RentAsProdSalesAvg = SRMF1stTYSales;
                    renewalToolFinMeasureOutput.Add();

                    var projectContractInfo = new ProjectContractInfo();
                    projectContractInfo.Id                           = Guid.NewGuid();
                    projectContractInfo.ProjectId                    = ProjectId;
                    projectContractInfo.ContractInfoId               = Guid.Empty;
                    projectContractInfo.CreatedTime                  = DateTime.Now;
                    projectContractInfo.WriteBack                    = false;
                    projectContractInfo.EditMode                     = EditMode;
                    projectContractInfo.PartyAFullName               = PartyAFullName;
                    projectContractInfo.McDLegalEntity               = ContractEntityName;
                    projectContractInfo.McDOwnership                 = McdOwnership;
                    projectContractInfo.ContactPerson                = ContactPerson;
                    projectContractInfo.ContactMode                  = ContactMode;
                    projectContractInfo.RentType                     = RentType;
                    projectContractInfo.TotalLeasedArea              = RentSize;
                    projectContractInfo.LeasePurchaseTerm            = ContractTerm;
                    projectContractInfo.LeasePurchase                = ContractType;
                    projectContractInfo.StartDate                    = ContractStartDate;
                    projectContractInfo.EndDate                      = ContraceEndDate;
                    projectContractInfo.StartYear                    = ContractStartYear;
                    projectContractInfo.EndYear                      = ContraceEndYear;
                    projectContractInfo.RentCommencementDate         = RentPaymentStartDate;
                    projectContractInfo.DeadlineToNotice             = DeadlineToNoticeLL;
                    projectContractInfo.Changedafter2010             = ChangedAfter2010;
                    projectContractInfo.RentStructure                = RentStructure;
                    projectContractInfo.WithEarlyTerminationClause   = EarlyTerminationClause;
                    projectContractInfo.EarlyTerminationClauseDetail = EarlyTerminationClauseDescription;
                    projectContractInfo.RentPaymentArrangement       = RentPaymentArrangement;
                    projectContractInfo.HasDeposit                   = Deposit;
                    projectContractInfo.DepositAmount                = DepositAmount;
                    projectContractInfo.RefundableDate               = WhenRefund;
                    projectContractInfo.WithPenaltyClause            = withPenaltyClause;
                    projectContractInfo.HasBankGuarantee             = BankGuarantee;
                    projectContractInfo.BGNumber                     = BankGuaranteeNumber;
                    projectContractInfo.BGAmount                     = BankGuaranteeAmount;
                    projectContractInfo.BGCommencementDate           = BGCommencementDate;
                    projectContractInfo.BGEndDate                    = BGEndDate;
                    projectContractInfo.Add();
                }
                else
                {
                    ProjectId            = projectInfo.ProjectId;
                    projectInfo.IsPushed = pushOrNot;
                    projectInfo.Update();

                    var renewalInfo = RenewalInfo.FirstOrDefault(i => i.ProjectId == ProjectId);
                    if (renewalInfo == null)
                    {
                        renewalInfo                    = new RenewalInfo();
                        renewalInfo.Id                 = Guid.NewGuid();
                        renewalInfo.ProjectId          = ProjectId;
                        renewalInfo.USCode             = USCode;
                        renewalInfo.RenewalYears       = 0;
                        renewalInfo.NeedProjectCostEst = false;
                        renewalInfo.CreateTime         = DateTime.Now;
                        renewalInfo.CreateUserAccount  = ClientCookie.UserCode;
                        renewalInfo.Add();
                    }

                    var renewalConsInfo = RenewalConsInfo.FirstOrDefault(i => i.ProjectId == ProjectId && !i.IsHistory);
                    if (renewalConsInfo == null)
                    {
                        renewalConsInfo                   = new RenewalConsInfo();
                        renewalConsInfo.Id                = Guid.NewGuid();
                        renewalConsInfo.ProjectId         = ProjectId;
                        renewalConsInfo.HasReinvenstment  = false;
                        renewalConsInfo.IsHistory         = false;
                        renewalConsInfo.CreateTime        = DateTime.Now;
                        renewalConsInfo.CreateUserAccount = ClientCookie.UserCode;
                        renewalConsInfo.ProcInstId        = 0;
                        renewalConsInfo.Add();
                    }

                    var writeOffAmount = WriteOffAmount.FirstOrDefault(i => i.ConsInfoID == renewalConsInfo.Id);
                    if (writeOffAmount == null)
                    {
                        writeOffAmount               = new WriteOffAmount();
                        writeOffAmount.Id            = Guid.NewGuid();
                        writeOffAmount.ConsInfoID    = renewalConsInfo.Id;
                        writeOffAmount.TotalWriteOff = Renewal_Total_WO_Proj;
                        writeOffAmount.TotalNBV      = Renewal_Total_WO_Act;
                        writeOffAmount.Add();
                    }
                    else
                    {
                        writeOffAmount.TotalWriteOff = Renewal_Total_WO_Proj;
                        writeOffAmount.TotalNBV      = Renewal_Total_WO_Act;
                        writeOffAmount.Update();
                    }

                    var reinvestmentCost = ReinvestmentCost.FirstOrDefault(i => i.ConsInfoID == renewalConsInfo.Id);
                    if (reinvestmentCost == null)
                    {
                        reinvestmentCost                       = new ReinvestmentCost();
                        reinvestmentCost.Id                    = Guid.NewGuid();
                        reinvestmentCost.ConsInfoID            = renewalConsInfo.Id;
                        reinvestmentCost.TotalReinvestmentNorm = Renewal_Total_Reinvestment_Proj;
                        reinvestmentCost.LHINorm               = Renewal_Total_Reinvestment_Act;
                        reinvestmentCost.Add();
                    }
                    else
                    {
                        reinvestmentCost.TotalReinvestmentNorm = Renewal_Total_Reinvestment_Proj;
                        reinvestmentCost.LHINorm = Renewal_Total_Reinvestment_Act;
                        reinvestmentCost.Update();
                    }

                    var renewalAnalysis = RenewalAnalysis.FirstOrDefault(i => i.ProjectId == ProjectId && !i.IsHistory);
                    if (renewalAnalysis == null)
                    {
                        renewalAnalysis                     = new RenewalAnalysis();
                        renewalAnalysis.Id                  = Guid.NewGuid();
                        renewalAnalysis.ProjectId           = ProjectId;
                        renewalAnalysis.CreateUserAccount   = ClientCookie.UserCode;
                        renewalAnalysis.CreateTime          = DateTime.Now;
                        renewalAnalysis.IsHistory           = false;
                        renewalAnalysis.FairMarketRentAgent = Fair_Market_Rent;
                        renewalAnalysis.DR1stTYAmount       = DR1stTYAmount;
                        renewalAnalysis.RentDeviation       = RentDeviation;
                        renewalAnalysis.DRMFLastTYSales     = DRMFLastTYSales;
                        renewalAnalysis.DRMF1stTY           = DRMF1stTY;
                        renewalAnalysis.Add();
                    }
                    else
                    {
                        renewalAnalysis.FairMarketRentAgent = Fair_Market_Rent;
                        renewalAnalysis.DR1stTYAmount       = DR1stTYAmount;
                        renewalAnalysis.RentDeviation       = RentDeviation;
                        renewalAnalysis.DRMFLastTYSales     = DRMFLastTYSales;
                        renewalAnalysis.DRMF1stTY           = DRMF1stTY;
                        renewalAnalysis.Update();
                    }

                    var renewalTool = RenewalTool.FirstOrDefault(i => i.ProjectId == ProjectId && !i.IsHistory);
                    if (renewalTool == null)
                    {
                        renewalTool                   = new RenewalTool();
                        renewalTool.Id                = Guid.NewGuid();
                        renewalTool.ProjectId         = ProjectId;
                        renewalTool.IsHistory         = false;
                        renewalTool.CreateTime        = DateTime.Now;
                        renewalTool.CreateUserAccount = ClientCookie.UserCode;
                        renewalTool.Add();
                    }

                    var renewalToolFinMeasureOutput = RenewalToolFinMeasureOutput.FirstOrDefault(i => i.ToolId == renewalTool.Id);
                    if (renewalToolFinMeasureOutput == null)
                    {
                        renewalToolFinMeasureOutput                    = new RenewalToolFinMeasureOutput();
                        renewalToolFinMeasureOutput.Id                 = Guid.NewGuid();
                        renewalToolFinMeasureOutput.ToolId             = renewalTool.Id;
                        renewalToolFinMeasureOutput.RentAsProdSalesYr1 = SRMFLastTYSales;
                        renewalToolFinMeasureOutput.RentAsProdSalesAvg = SRMF1stTYSales;
                        renewalToolFinMeasureOutput.Add();
                    }
                    else
                    {
                        renewalToolFinMeasureOutput.RentAsProdSalesYr1 = SRMFLastTYSales;
                        renewalToolFinMeasureOutput.RentAsProdSalesAvg = SRMF1stTYSales;
                        renewalToolFinMeasureOutput.Update();
                    }

                    var projectContractInfo = ProjectContractInfo.FirstOrDefault(i => i.ProjectId == ProjectId);
                    if (projectContractInfo != null)
                    {
                        projectContractInfo.EditMode                     = EditMode;
                        projectContractInfo.PartyAFullName               = PartyAFullName;
                        projectContractInfo.McDLegalEntity               = ContractEntityName;
                        projectContractInfo.McDOwnership                 = McdOwnership;
                        projectContractInfo.ContactPerson                = ContactPerson;
                        projectContractInfo.ContactMode                  = ContactMode;
                        projectContractInfo.RentType                     = RentType;
                        projectContractInfo.TotalLeasedArea              = RentSize;
                        projectContractInfo.LeasePurchaseTerm            = ContractTerm;
                        projectContractInfo.LeasePurchase                = ContractType;
                        projectContractInfo.StartDate                    = ContractStartDate;
                        projectContractInfo.EndDate                      = ContraceEndDate;
                        projectContractInfo.StartYear                    = ContractStartYear;
                        projectContractInfo.EndYear                      = ContraceEndYear;
                        projectContractInfo.RentCommencementDate         = RentPaymentStartDate;
                        projectContractInfo.DeadlineToNotice             = DeadlineToNoticeLL;
                        projectContractInfo.Changedafter2010             = ChangedAfter2010;
                        projectContractInfo.RentStructure                = RentStructure;
                        projectContractInfo.WithEarlyTerminationClause   = EarlyTerminationClause;
                        projectContractInfo.EarlyTerminationClauseDetail = EarlyTerminationClauseDescription;
                        projectContractInfo.RentPaymentArrangement       = RentPaymentArrangement;
                        projectContractInfo.HasDeposit                   = Deposit;
                        projectContractInfo.DepositAmount                = DepositAmount;
                        projectContractInfo.RefundableDate               = WhenRefund;
                        projectContractInfo.WithPenaltyClause            = withPenaltyClause;
                        projectContractInfo.HasBankGuarantee             = BankGuarantee;
                        projectContractInfo.BGNumber                     = BankGuaranteeNumber;
                        projectContractInfo.BGAmount                     = BankGuaranteeAmount;
                        projectContractInfo.BGCommencementDate           = BGCommencementDate;
                        projectContractInfo.BGEndDate                    = BGEndDate;
                        projectContractInfo.Update();
                    }
                    else
                    {
                        projectContractInfo                              = new ProjectContractInfo();
                        projectContractInfo.Id                           = Guid.NewGuid();
                        projectContractInfo.ProjectId                    = ProjectId;
                        projectContractInfo.ContractInfoId               = Guid.Empty;
                        projectContractInfo.CreatedTime                  = DateTime.Now;
                        projectContractInfo.WriteBack                    = false;
                        projectContractInfo.EditMode                     = EditMode;
                        projectContractInfo.PartyAFullName               = PartyAFullName;
                        projectContractInfo.McDLegalEntity               = ContractEntityName;
                        projectContractInfo.McDOwnership                 = McdOwnership;
                        projectContractInfo.ContactPerson                = ContactPerson;
                        projectContractInfo.ContactMode                  = ContactMode;
                        projectContractInfo.RentType                     = RentType;
                        projectContractInfo.TotalLeasedArea              = RentSize;
                        projectContractInfo.LeasePurchaseTerm            = ContractTerm;
                        projectContractInfo.LeasePurchase                = ContractType;
                        projectContractInfo.StartDate                    = ContractStartDate;
                        projectContractInfo.EndDate                      = ContraceEndDate;
                        projectContractInfo.StartYear                    = ContractStartYear;
                        projectContractInfo.EndYear                      = ContraceEndYear;
                        projectContractInfo.RentCommencementDate         = RentPaymentStartDate;
                        projectContractInfo.DeadlineToNotice             = DeadlineToNoticeLL;
                        projectContractInfo.Changedafter2010             = ChangedAfter2010;
                        projectContractInfo.RentStructure                = RentStructure;
                        projectContractInfo.WithEarlyTerminationClause   = EarlyTerminationClause;
                        projectContractInfo.EarlyTerminationClauseDetail = EarlyTerminationClauseDescription;
                        projectContractInfo.RentPaymentArrangement       = RentPaymentArrangement;
                        projectContractInfo.HasDeposit                   = Deposit;
                        projectContractInfo.DepositAmount                = DepositAmount;
                        projectContractInfo.RefundableDate               = WhenRefund;
                        projectContractInfo.WithPenaltyClause            = withPenaltyClause;
                        projectContractInfo.HasBankGuarantee             = BankGuarantee;
                        projectContractInfo.BGNumber                     = BankGuaranteeNumber;
                        projectContractInfo.BGAmount                     = BankGuaranteeAmount;
                        projectContractInfo.BGCommencementDate           = BGCommencementDate;
                        projectContractInfo.BGEndDate                    = BGEndDate;
                        projectContractInfo.Add();
                    }
                }
                tranScope.Complete();
            }
        }
Beispiel #4
0
        public void Save(bool pushOrNot)
        {
            using (TransactionScope tranScope = new TransactionScope())
            {
                var projectInfo = ProjectInfo.Get(Id);
                if (projectInfo == null)
                {
                    ProjectId = ProjectInfo.CreateDLProject(Id, FlowCode.Rebuild, USCode, NodeCode.Start, ClientCookie.UserCode, pushOrNot);

                    var rebuildInfo = new RebuildInfo();
                    rebuildInfo.Id                 = Guid.NewGuid();
                    rebuildInfo.ProjectId          = ProjectId;
                    rebuildInfo.USCode             = USCode;
                    rebuildInfo.CreateTime         = DateTime.Now;
                    rebuildInfo.CreateUserAccount  = ClientCookie.UserCode;
                    rebuildInfo.CreateUserNameENUS = ClientCookie.UserNameENUS;
                    rebuildInfo.CreateUserNameZHCN = ClientCookie.UserNameZHCN;
                    rebuildInfo.GBDate             = GBDate;
                    rebuildInfo.ReopenDate         = ReopenDate;
                    rebuildInfo.Add();

                    var rebuildPackage = new RebuildPackage();
                    rebuildPackage.Id                    = Guid.NewGuid();
                    rebuildPackage.ProjectId             = ProjectId;
                    rebuildPackage.IsHistory             = false;
                    rebuildPackage.ChangeLandlordType    = ChangeLandlordType;
                    rebuildPackage.NewLandlord           = ChangeLandLordDESC;
                    rebuildPackage.ChangeRentalType      = ChangeRentalType;
                    rebuildPackage.ChangeRentalTypeDESC  = ChangeRentalTypeDESC;
                    rebuildPackage.ChangeLeaseTermType   = ChangeLeaseTermType;
                    rebuildPackage.ChangeLeaseTermDESC   = ChangeLeaseTermDESC;
                    rebuildPackage.ChangeRedLineType     = ChangeRedLineType;
                    rebuildPackage.ChangeRedLineTypeDESC = ChangeRedLineTypeDESC;
                    //rebuildPackage.NewRentalStructure = NewRentalStructure;
                    rebuildPackage.Add();

                    var projectContractInfo = new ProjectContractInfo();
                    projectContractInfo.Id                           = Guid.NewGuid();
                    projectContractInfo.ProjectId                    = ProjectId;
                    projectContractInfo.ContractInfoId               = Guid.Empty;
                    projectContractInfo.CreatedTime                  = DateTime.Now;
                    projectContractInfo.WriteBack                    = false;
                    projectContractInfo.EditMode                     = EditMode;
                    projectContractInfo.PartyAFullName               = PartyAFullName;
                    projectContractInfo.McDLegalEntity               = ContractEntityName;
                    projectContractInfo.McDOwnership                 = McdOwnership;
                    projectContractInfo.ContactPerson                = ContactPerson;
                    projectContractInfo.ContactMode                  = ContactMode;
                    projectContractInfo.RentType                     = RentType;
                    projectContractInfo.TotalLeasedArea              = RentSize;
                    projectContractInfo.LeasePurchaseTerm            = ContractTerm;
                    projectContractInfo.LeasePurchase                = ContractType;
                    projectContractInfo.StartDate                    = ContractStartDate;
                    projectContractInfo.EndDate                      = ContraceEndDate;
                    projectContractInfo.StartYear                    = ContractStartYear;
                    projectContractInfo.EndYear                      = ContraceEndYear;
                    projectContractInfo.RentCommencementDate         = RentPaymentStartDate;
                    projectContractInfo.DeadlineToNotice             = DeadlineToNoticeLL;
                    projectContractInfo.Changedafter2010             = ChangedAfter2010;
                    projectContractInfo.RentStructure                = RentStructure;
                    projectContractInfo.WithEarlyTerminationClause   = EarlyTerminationClause;
                    projectContractInfo.EarlyTerminationClauseDetail = EarlyTerminationClauseDescription;
                    projectContractInfo.RentPaymentArrangement       = RentPaymentArrangement;
                    projectContractInfo.HasDeposit                   = Deposit;
                    projectContractInfo.DepositAmount                = DepositAmount;
                    projectContractInfo.RefundableDate               = WhenRefund;
                    projectContractInfo.WithPenaltyClause            = withPenaltyClause;
                    projectContractInfo.HasBankGuarantee             = BankGuarantee;
                    projectContractInfo.BGNumber                     = BankGuaranteeNumber;
                    projectContractInfo.BGAmount                     = BankGuaranteeAmount;
                    projectContractInfo.BGCommencementDate           = BGCommencementDate;
                    projectContractInfo.BGEndDate                    = BGEndDate;
                    projectContractInfo.Add();

                    var rebuildConsInfo = new RebuildConsInfo();
                    rebuildConsInfo.Id                = Guid.NewGuid();
                    rebuildConsInfo.ProjectId         = ProjectId;
                    rebuildConsInfo.IsHistory         = false;
                    rebuildConsInfo.CreateTime        = DateTime.Now;
                    rebuildConsInfo.CreateUserAccount = ClientCookie.UserCode;
                    rebuildConsInfo.Add();

                    var reinvestmentBasicInfo = new ReinvestmentBasicInfo();
                    reinvestmentBasicInfo.ConsInfoID        = rebuildConsInfo.Id;
                    reinvestmentBasicInfo.EstimatedSeatNo   = OriginalSeatNO;
                    reinvestmentBasicInfo.RightSizingSeatNo = AfterRebuildSeatNO;
                    reinvestmentBasicInfo.NewDesignType     = AfterRebuildDesignType;
                    reinvestmentBasicInfo.NewOperationSize  = AfterRebuildOperationArea;
                    reinvestmentBasicInfo.Add();

                    var rebuildConsInvtChecking = new RebuildConsInvtChecking();
                    rebuildConsInvtChecking.Id        = Guid.NewGuid();
                    rebuildConsInvtChecking.ProjectId = ProjectId;
                    rebuildConsInvtChecking.IsHistory = false;
                    rebuildConsInvtChecking.Add();

                    var writeOffAmount = new WriteOffAmount();
                    writeOffAmount.Id          = Guid.NewGuid();
                    writeOffAmount.ConsInfoID  = rebuildConsInvtChecking.Id;
                    writeOffAmount.TotalActual = Rebuild_TotalWO_Act;
                    writeOffAmount.Add();

                    var reinvestmentCost = new ReinvestmentCost();
                    reinvestmentCost.Id                     = Guid.NewGuid();
                    reinvestmentCost.ConsInfoID             = rebuildConsInvtChecking.Id;
                    reinvestmentCost.TotalReinvestmentFAAct = Rebuild_TotalReinvestment_Act;
                    reinvestmentCost.Add();
                }
                else
                {
                    ProjectId            = projectInfo.ProjectId;
                    projectInfo.IsPushed = pushOrNot;
                    projectInfo.Update();

                    var rebuildInfo = RebuildInfo.FirstOrDefault(i => i.ProjectId == ProjectId);
                    if (rebuildInfo != null)
                    {
                        rebuildInfo.GBDate     = GBDate;
                        rebuildInfo.ReopenDate = ReopenDate;
                        rebuildInfo.Update();
                    }
                    else
                    {
                        rebuildInfo                    = new RebuildInfo();
                        rebuildInfo.Id                 = Guid.NewGuid();
                        rebuildInfo.ProjectId          = ProjectId;
                        rebuildInfo.USCode             = USCode;
                        rebuildInfo.CreateTime         = DateTime.Now;
                        rebuildInfo.CreateUserAccount  = ClientCookie.UserCode;
                        rebuildInfo.CreateUserNameENUS = ClientCookie.UserNameENUS;
                        rebuildInfo.CreateUserNameZHCN = ClientCookie.UserNameZHCN;
                        rebuildInfo.GBDate             = GBDate;
                        rebuildInfo.ReopenDate         = ReopenDate;
                        rebuildInfo.Add();
                    }

                    var rebuildPackage = RebuildPackage.FirstOrDefault(i => i.ProjectId == ProjectId && !i.IsHistory);
                    if (rebuildPackage != null)
                    {
                        rebuildPackage.ChangeLandlordType    = ChangeLandlordType;
                        rebuildPackage.NewLandlord           = ChangeLandLordDESC;
                        rebuildPackage.ChangeRentalType      = ChangeRentalType;
                        rebuildPackage.ChangeRentalTypeDESC  = ChangeRentalTypeDESC;
                        rebuildPackage.ChangeLeaseTermType   = ChangeLeaseTermType;
                        rebuildPackage.ChangeLeaseTermDESC   = ChangeLeaseTermDESC;
                        rebuildPackage.ChangeRedLineType     = ChangeRedLineType;
                        rebuildPackage.ChangeRedLineTypeDESC = ChangeRedLineTypeDESC;
                        //rebuildPackage.NewRentalStructure = NewRentalStructure;
                        rebuildPackage.Update();
                    }
                    else
                    {
                        rebuildPackage                       = new RebuildPackage();
                        rebuildPackage.Id                    = Guid.NewGuid();
                        rebuildPackage.ProjectId             = ProjectId;
                        rebuildPackage.IsHistory             = false;
                        rebuildPackage.ChangeLandlordType    = ChangeLandlordType;
                        rebuildPackage.NewLandlord           = ChangeLandLordDESC;
                        rebuildPackage.ChangeRentalType      = ChangeRentalType;
                        rebuildPackage.ChangeRentalTypeDESC  = ChangeRentalTypeDESC;
                        rebuildPackage.ChangeLeaseTermType   = ChangeLeaseTermType;
                        rebuildPackage.ChangeLeaseTermDESC   = ChangeLeaseTermDESC;
                        rebuildPackage.ChangeRedLineType     = ChangeRedLineType;
                        rebuildPackage.ChangeRedLineTypeDESC = ChangeRedLineTypeDESC;
                        //rebuildPackage.NewRentalStructure = NewRentalStructure;
                        rebuildPackage.Add();
                    }

                    var projectContractInfo = ProjectContractInfo.FirstOrDefault(i => i.ProjectId == ProjectId);
                    if (projectContractInfo != null)
                    {
                        projectContractInfo.EditMode                     = EditMode;
                        projectContractInfo.PartyAFullName               = PartyAFullName;
                        projectContractInfo.McDLegalEntity               = ContractEntityName;
                        projectContractInfo.McDOwnership                 = McdOwnership;
                        projectContractInfo.ContactPerson                = ContactPerson;
                        projectContractInfo.ContactMode                  = ContactMode;
                        projectContractInfo.RentType                     = RentType;
                        projectContractInfo.TotalLeasedArea              = RentSize;
                        projectContractInfo.LeasePurchaseTerm            = ContractTerm;
                        projectContractInfo.LeasePurchase                = ContractType;
                        projectContractInfo.StartDate                    = ContractStartDate;
                        projectContractInfo.EndDate                      = ContraceEndDate;
                        projectContractInfo.StartYear                    = ContractStartYear;
                        projectContractInfo.EndYear                      = ContraceEndYear;
                        projectContractInfo.RentCommencementDate         = RentPaymentStartDate;
                        projectContractInfo.DeadlineToNotice             = DeadlineToNoticeLL;
                        projectContractInfo.Changedafter2010             = ChangedAfter2010;
                        projectContractInfo.RentStructure                = RentStructure;
                        projectContractInfo.WithEarlyTerminationClause   = EarlyTerminationClause;
                        projectContractInfo.EarlyTerminationClauseDetail = EarlyTerminationClauseDescription;
                        projectContractInfo.RentPaymentArrangement       = RentPaymentArrangement;
                        projectContractInfo.HasDeposit                   = Deposit;
                        projectContractInfo.DepositAmount                = DepositAmount;
                        projectContractInfo.RefundableDate               = WhenRefund;
                        projectContractInfo.WithPenaltyClause            = withPenaltyClause;
                        projectContractInfo.HasBankGuarantee             = BankGuarantee;
                        projectContractInfo.BGNumber                     = BankGuaranteeNumber;
                        projectContractInfo.BGAmount                     = BankGuaranteeAmount;
                        projectContractInfo.BGCommencementDate           = BGCommencementDate;
                        projectContractInfo.BGEndDate                    = BGEndDate;
                        projectContractInfo.Update();
                    }
                    else
                    {
                        projectContractInfo                              = new ProjectContractInfo();
                        projectContractInfo.Id                           = Guid.NewGuid();
                        projectContractInfo.ProjectId                    = ProjectId;
                        projectContractInfo.ContractInfoId               = Guid.Empty;
                        projectContractInfo.CreatedTime                  = DateTime.Now;
                        projectContractInfo.WriteBack                    = false;
                        projectContractInfo.EditMode                     = EditMode;
                        projectContractInfo.PartyAFullName               = PartyAFullName;
                        projectContractInfo.McDLegalEntity               = ContractEntityName;
                        projectContractInfo.McDOwnership                 = McdOwnership;
                        projectContractInfo.ContactPerson                = ContactPerson;
                        projectContractInfo.ContactMode                  = ContactMode;
                        projectContractInfo.RentType                     = RentType;
                        projectContractInfo.TotalLeasedArea              = RentSize;
                        projectContractInfo.LeasePurchaseTerm            = ContractTerm;
                        projectContractInfo.LeasePurchase                = ContractType;
                        projectContractInfo.StartDate                    = ContractStartDate;
                        projectContractInfo.EndDate                      = ContraceEndDate;
                        projectContractInfo.StartYear                    = ContractStartYear;
                        projectContractInfo.EndYear                      = ContraceEndYear;
                        projectContractInfo.RentCommencementDate         = RentPaymentStartDate;
                        projectContractInfo.DeadlineToNotice             = DeadlineToNoticeLL;
                        projectContractInfo.Changedafter2010             = ChangedAfter2010;
                        projectContractInfo.RentStructure                = RentStructure;
                        projectContractInfo.WithEarlyTerminationClause   = EarlyTerminationClause;
                        projectContractInfo.EarlyTerminationClauseDetail = EarlyTerminationClauseDescription;
                        projectContractInfo.RentPaymentArrangement       = RentPaymentArrangement;
                        projectContractInfo.HasDeposit                   = Deposit;
                        projectContractInfo.DepositAmount                = DepositAmount;
                        projectContractInfo.RefundableDate               = WhenRefund;
                        projectContractInfo.WithPenaltyClause            = withPenaltyClause;
                        projectContractInfo.HasBankGuarantee             = BankGuarantee;
                        projectContractInfo.BGNumber                     = BankGuaranteeNumber;
                        projectContractInfo.BGAmount                     = BankGuaranteeAmount;
                        projectContractInfo.BGCommencementDate           = BGCommencementDate;
                        projectContractInfo.BGEndDate                    = BGEndDate;
                        projectContractInfo.Add();
                    }

                    var rebuildConsInfo = RebuildConsInfo.FirstOrDefault(i => i.ProjectId == ProjectId && !i.IsHistory);
                    if (rebuildConsInfo == null)
                    {
                        rebuildConsInfo                   = new RebuildConsInfo();
                        rebuildConsInfo.Id                = Guid.NewGuid();
                        rebuildConsInfo.ProjectId         = ProjectId;
                        rebuildConsInfo.IsHistory         = false;
                        rebuildConsInfo.CreateTime        = DateTime.Now;
                        rebuildConsInfo.CreateUserAccount = ClientCookie.UserCode;
                        rebuildConsInfo.Add();
                    }

                    var reinvestmentBasicInfo = ReinvestmentBasicInfo.FirstOrDefault(i => i.ConsInfoID == rebuildConsInfo.Id);
                    if (reinvestmentBasicInfo != null)
                    {
                        reinvestmentBasicInfo.EstimatedSeatNo   = OriginalSeatNO;
                        reinvestmentBasicInfo.RightSizingSeatNo = AfterRebuildSeatNO;
                        reinvestmentBasicInfo.NewDesignType     = AfterRebuildDesignType;
                        reinvestmentBasicInfo.NewOperationSize  = AfterRebuildOperationArea;
                        reinvestmentBasicInfo.Update();
                    }
                    else
                    {
                        reinvestmentBasicInfo                   = new ReinvestmentBasicInfo();
                        reinvestmentBasicInfo.ConsInfoID        = rebuildConsInfo.Id;
                        reinvestmentBasicInfo.EstimatedSeatNo   = OriginalSeatNO;
                        reinvestmentBasicInfo.RightSizingSeatNo = AfterRebuildSeatNO;
                        reinvestmentBasicInfo.NewDesignType     = AfterRebuildDesignType;
                        reinvestmentBasicInfo.NewOperationSize  = AfterRebuildOperationArea;
                        reinvestmentBasicInfo.Add();
                    }

                    var rebuildConsInvtChecking = RebuildConsInvtChecking.FirstOrDefault(i => i.ProjectId == ProjectId && !i.IsHistory);
                    if (rebuildConsInvtChecking == null)
                    {
                        rebuildConsInvtChecking           = new RebuildConsInvtChecking();
                        rebuildConsInvtChecking.Id        = Guid.NewGuid();
                        rebuildConsInvtChecking.ProjectId = ProjectId;
                        rebuildConsInvtChecking.IsHistory = false;
                        rebuildConsInvtChecking.Add();
                    }

                    var writeOffAmount = WriteOffAmount.FirstOrDefault(i => i.ConsInfoID == rebuildConsInvtChecking.Id);
                    if (writeOffAmount != null)
                    {
                        writeOffAmount.TotalActual = Rebuild_TotalWO_Act;
                        writeOffAmount.Update();
                    }
                    else
                    {
                        writeOffAmount             = new WriteOffAmount();
                        writeOffAmount.Id          = Guid.NewGuid();
                        writeOffAmount.ConsInfoID  = rebuildConsInvtChecking.Id;
                        writeOffAmount.TotalActual = Rebuild_TotalWO_Act;
                        writeOffAmount.Add();
                    }

                    var reinvestmentCost = ReinvestmentCost.FirstOrDefault(i => i.ConsInfoID == rebuildConsInvtChecking.Id);
                    if (reinvestmentCost != null)
                    {
                        reinvestmentCost.TotalReinvestmentFAAct = Rebuild_TotalReinvestment_Act;
                        reinvestmentCost.Update();
                    }
                    else
                    {
                        reinvestmentCost                        = new ReinvestmentCost();
                        reinvestmentCost.Id                     = Guid.NewGuid();
                        reinvestmentCost.ConsInfoID             = rebuildConsInvtChecking.Id;
                        reinvestmentCost.TotalReinvestmentFAAct = Rebuild_TotalReinvestment_Act;
                        reinvestmentCost.Add();
                    }
                }
                tranScope.Complete();
            }
        }