Ejemplo n.º 1
0
        public IHttpActionResult GetWriteOff(string refTableId)
        {
            WriteOffAmount writeoff = null;

            if (!string.IsNullOrEmpty(refTableId))
            {
                writeoff = WriteOffAmount.GetByConsInfoId(new Guid(refTableId));
            }
            return(Ok(writeoff));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetSummaryReinvestmentCost(string projectId)
        {
            var reimageConsInfo       = ReimageConsInfo.GetConsInfo(projectId, "");
            ReinvestmentCost rein     = ReinvestmentCost.FirstOrDefault(e => e.ConsInfoID == reimageConsInfo.Id);
            WriteOffAmount   writeoff = WriteOffAmount.FirstOrDefault(e => e.ConsInfoID == reimageConsInfo.Id);

            return(Ok(new
            {
                Rein = rein,
                Writeoff = writeoff
            }));
        }
Ejemplo n.º 3
0
        public WriteOffAmountExcelData(FileInfo fileInfo)
            : base(fileInfo)
        {
            SheetName = "PMT";

            StartRow    = 2;
            EndRow      = 43;
            StartColumn = "D";
            EndColumn   = "E";

            _outputCol = "E";

            _writeOffAmount = new WriteOffAmount();
            Entity          = _writeOffAmount;
        }
Ejemplo n.º 4
0
        public IHttpActionResult GetFinancialPreAnalysis(string projectId, string usCode, string pageType = "")
        {
            var financial  = new FinancialPreanalysis();
            var reimageSum = ReimageSummary.FirstOrDefault(e => e.ProjectId == projectId && e.IsHistory == false);

            if (reimageSum != null)
            {
                financial = FinancialPreanalysis.FirstOrDefault(e => e.RefId == reimageSum.Id);
            }
            if (financial != null)
            {
                if (financial.Id != 0)
                {
                    pageType = "save";
                }
            }
            if (pageType == "")
            {
                //FinancialPreanalysis financial = reimageSummary.LoadFinancialPreanalysisInfo();

                var enti = ReimageConsInfo.FirstOrDefault(e => e.ProjectId.Equals(projectId) && e.IsHistory == true);
                if (enti == null)
                {
                    enti = ReimageConsInfo.FirstOrDefault(e => e.ProjectId.Equals(projectId) && e.IsHistory == false);
                }
                WriteOffAmount writeOff = WriteOffAmount.FirstOrDefault(e => e.ConsInfoID == enti.Id);
                if (financial == null)
                {
                    financial = new FinancialPreanalysis();
                }
                if (writeOff != null)
                {
                    financial.EstimatedWriteOffCost = writeOff.TotalII;
                }
                var ContributionMargin    = StoreCM.Get(usCode).ContributionMargin.ToString();
                var reimageConsInfo       = ReimageConsInfo.GetConsInfo(projectId, "");
                var reinvestmentBasicInfo = ReinvestmentBasicInfo.FirstOrDefault(e => e.ConsInfoID == reimageConsInfo.Id);

                //ReinvestmentCost reinCost = ReinvestmentCost.FirstOrDefault(e => e.ConsInfoID == enti.Id);
                financial.IsMcCafe = reinvestmentBasicInfo.NewMcCafe;

                financial.IsKiosk           = reinvestmentBasicInfo.NewKiosk;
                financial.IsMDS             = reinvestmentBasicInfo.NewMDS;
                financial.IsTwientyFourHour = reinvestmentBasicInfo.NewTwientyFourHour;
                financial.StoreCM           = ContributionMargin;
            }
            return(Ok(financial));
        }
Ejemplo n.º 5
0
        public override void Import()
        {
            var writeoff =
                WriteOffAmount.FirstOrDefault(e => e.ConsInfoID.ToString().Equals(_writeOffAmount.ConsInfoID.ToString()));

            if (writeoff != null)
            {
                _writeOffAmount.Id = writeoff.Id;
            }
            if (WriteOffAmount.Any(a => a.Id == _writeOffAmount.Id))
            {
                WriteOffAmount.Update(_writeOffAmount);
            }
            else
            {
                WriteOffAmount.Add(_writeOffAmount);
            }
        }