Ejemplo n.º 1
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(this.ProjectId);

            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
            {
                ProjectProgress.SetProgress(ProjectId, "90%");
                var taskcontract = TaskWork.Search(e => e.RefID == ProjectId && e.TypeCode == FlowCode.Renewal_ContractInfo).FirstOrDefault();
                if (taskcontract == null)
                {
                    info.GenerateSubmitTask(FlowCode.Renewal_ContractInfo);
                }
                var taskSiteinfo = TaskWork.Search(e => e.RefID == ProjectId && e.TypeCode == FlowCode.Renewal_SiteInfo).FirstOrDefault();
                if (taskSiteinfo == null)
                {
                    info.GenerateSubmitTask(FlowCode.Renewal_SiteInfo);
                }

                ProjectInfo.CompleteMainIfEnable(ProjectId);
                ProjectInfo.FinishNode(ProjectId, WorkflowCode, NodeCode.Renewal_Package_Approval);
            }
            break;

            case TaskWorkStatus.K2ProcessDeclined:
            {
                ProjectInfo.UpdateProjectStatus(ProjectId, FlowCode.Renewal, ProjectStatus.Rejected);
                ProjectInfo.Reject(ProjectId, FlowCode.Renewal_Package);
            }
            break;
            }
        }
Ejemplo n.º 2
0
        public static RenewalPackageDTO InitPage(string projectId, string id = null)
        {
            RenewalPackageDTO dto = new RenewalPackageDTO();
            var entity            = RenewalPackage.Get(projectId, id);
            var project           = ProjectInfo.Get(projectId, FlowCode.Renewal_Package);
            var info = RenewalInfo.Get(projectId);

            entity.IsProjectFreezed = entity.CheckIfFreezeProject(projectId);
            entity.GenerateCover();
            var haveTask       = TaskWork.Any(t => t.RefID == projectId && t.TypeCode == FlowCode.Renewal_Package && t.Status == TaskWorkStatus.UnFinish && t.ReceiverAccount == ClientCookie.UserCode);
            var projectComment = ProjectComment.GetSavedComment(entity.Id, "RenewalPackage", ClientCookie.UserCode);
            var projectNode    = NodeInfo.GetNodeInfo(project.NodeCode);

            dto.Info             = info;
            dto.Entity           = entity;
            dto.Analysis         = RenewalAnalysis.Get(entity.AnalysisId.Value);
            dto.FinMeasureOutput = RenewalToolFinMeasureOutput.GetByToolId(entity.ToolId.Value);
            dto.Uploadable       = projectNode.Sequence >= 4 && ClientCookie.UserCode == dto.Info.AssetActorAccount;
            var editStatuses = new[] { ProjectStatus.Finished, ProjectStatus.Rejected };

            dto.ProjectComment = projectComment != null ? projectComment.Content : "";
            dto.Editable       = ProjectInfo.IsFlowEditable(projectId, FlowCode.Renewal_Package);
            dto.Recallable     = ProjectInfo.IsFlowRecallable(projectId, FlowCode.Renewal_Package);
            dto.Savable        = ProjectInfo.IsFlowSavable(projectId, FlowCode.Renewal_Package) && string.IsNullOrEmpty(id);
            if (entity.ProcInstId.HasValue)
            {
                var currentActivityName = K2FxContext.Current.GetCurrentActivityName(entity.ProcInstId.Value);
                dto.Rejectable = !entity.WorkflowNormalActors.Contains(currentActivityName);
            }
            dto.IsLindaLu = string.Compare(ClientCookie.UserCode, ConfigurationManager.AppSettings["AssetMgrCode"], true) == 0;
            return(dto);
        }
Ejemplo n.º 3
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(ProjectId);

            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
                ProjectProgress.SetProgress(ProjectId, "50%");
                ProjectInfo.FinishNode(ProjectId, FlowCode.Renewal_Analysis, NodeCode.Finish, ProjectStatus.Finished);
                if (info.RenewalYears > 2)
                {
                    if (!ProjectInfo.FlowHaveTask(ProjectId, FlowCode.Renewal_ClearanceReport))
                    {
                        info.GenerateSubmitTask(FlowCode.Renewal_ClearanceReport);
                    }
                }
                else
                {
                    ProjectInfo.FinishProject(this.ProjectId, FlowCode.Renewal_ClearanceReport);
                    if (!ProjectInfo.FlowHaveTask(ProjectId, FlowCode.Renewal_ConfirmLetter))
                    {
                        info.GenerateSubmitTask(FlowCode.Renewal_ConfirmLetter);
                    }
                }

                break;

            case TaskWorkStatus.K2ProcessDeclined:
                break;
            }
        }
Ejemplo n.º 4
0
        public override string Edit()
        {
            using (TransactionScope tranScope = new TransactionScope())
            {
                var info = RenewalInfo.Get(ProjectId);

                this.IsHistory = true;
                this.Update();
                var entity = Duplicator.AutoCopy(this);
                entity.Id        = Guid.NewGuid();
                entity.IsHistory = false;
                entity.Add();
                var attachments = Attachment.GetList(this.TableName, Id.ToString(), string.Empty);
                attachments.ForEach(att =>
                {
                    att.RefTableID = entity.Id.ToString();
                    att.ID         = Guid.NewGuid();
                });
                Attachment.Add(attachments.ToArray());
                TaskWork.Cancel(e => e.TypeCode == this.WorkflowCode && e.RefID == ProjectId && e.Status == TaskWorkStatus.UnFinish);
                ProjectInfo.Reset(ProjectId, this.WorkflowCode);
                var task = info.GenerateSubmitTask(this.WorkflowCode);
                tranScope.Complete();

                return(task.Url);
            }
        }
Ejemplo n.º 5
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(this.ProjectId);

            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
            {
                using (TransactionScope tranScope = new TransactionScope())
                {
                    ProjectProgress.SetProgress(ProjectId, "40%");
                    ProjectInfo.FinishNode(ProjectId, this.WorkflowCode, NodeCode.Finish);
                    var anlysisProj = ProjectInfo.FirstOrDefault(e => e.FlowCode == FlowCode.Renewal_Analysis &&
                                                                 e.Status == ProjectStatus.UnFinish && e.ProjectId == ProjectId);
                    if (anlysisProj != null)
                    {
                        info.GenerateSubmitTask(FlowCode.Renewal_Analysis);
                    }
                    else
                    {
                        //Renewal Tool重新Edit并完成后,系统自动重新生成一次Renewal Analysis文件
                        var anlysis = RenewalAnalysis.Get(ProjectId);
                        if (anlysis != null)
                        {
                            anlysis.GenerateAttachment();
                        }
                    }
                    tranScope.Complete();
                }
            }
            break;
            }
        }
Ejemplo n.º 6
0
        public override string Edit()
        {
            var info = RenewalInfo.Get(this.ProjectId);

            using (var tranScope = new TransactionScope())
            {
                var legalApproval = Duplicator.AutoCopy(this);
                legalApproval.Id                = Guid.NewGuid();
                legalApproval.IsHistory         = false;
                legalApproval.LegalComments     = "";
                legalApproval.CreateUserAccount = ClientCookie.UserCode;
                legalApproval.Add();
                IsHistory = true;
                this.Update();
                ProjectInfo.Reset(ProjectId, this.WorkflowCode);
                var attachments = Attachment.GetList(this.TableName, Id.ToString(), string.Empty);
                attachments.ForEach(att =>
                {
                    att.RefTableID = legalApproval.Id.ToString();
                    att.ID         = Guid.NewGuid();
                });
                Attachment.Add(attachments.ToArray());
                var assetActor = ProjectUsers.FirstOrDefault(pu => pu.ProjectId == ProjectId && pu.RoleCode == ProjectUserRoleCode.AssetActor);
                TaskWork.Cancel(t => t.RefID == ProjectId && t.Status == TaskWorkStatus.UnFinish);
                var task = info.GenerateSubmitTask(this.WorkflowCode);
                tranScope.Complete();
                return(task.Url);
            }
        }
Ejemplo n.º 7
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(ProjectId);

            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
                ProjectInfo.FinishNode(ProjectId, FlowCode.Renewal_LLNegotiation, NodeCode.Finish, ProjectStatus.Finished);
                if (ProjectInfo.IsFlowFinished(ProjectId, FlowCode.Renewal_Letter))
                {
                    ProjectProgress.SetProgress(ProjectId, "30%");
                    if (info.NeedProjectCostEst)
                    {
                        if (!ProjectInfo.IsFlowStarted(ProjectId, FlowCode.Renewal_ConsInfo))
                        {
                            info.GenerateSubmitTask(FlowCode.Renewal_ConsInfo);
                        }
                    }
                    else
                    {
                        ProjectInfo.FinishNode(ProjectId, FlowCode.Renewal_ConsInfo, NodeCode.Finish, ProjectStatus.Finished);
                        if (!ProjectInfo.IsFlowStarted(ProjectId, FlowCode.Renewal_Tool))
                        {
                            info.GenerateSubmitTask(FlowCode.Renewal_Tool);
                        }
                    }
                }
                break;

            case TaskWorkStatus.K2ProcessDeclined:
                break;
            }
        }
Ejemplo n.º 8
0
        public static ConsInfoDTO <RenewalInfo, RenewalConsInfo> InitPage(string projectId, string id = "")
        {
            RenewalInfo info     = RenewalInfo.Get(projectId);
            var         consInfo = RenewalConsInfo.Get(projectId, id);

            if (consInfo == null)
            {
                consInfo           = new RenewalConsInfo();
                consInfo.ProjectId = projectId;
            }
            var isOriginator = ClientCookie.UserCode == info.PMAccount;

            consInfo.IsProjectFreezed = consInfo.CheckIfFreezeProject(projectId);
            var nextRefTableId  = new Guid(FlowInfo.GetRefTableId("RenewalTool", projectId));
            var nextFlowStarted = ProjectInfo.IsFlowStarted(projectId, FlowCode.Renewal_Tool);
            var haveTask        = TaskWork.Any(t => t.RefID == projectId && t.TypeCode == FlowCode.Renewal_Tool && t.Status == TaskWorkStatus.UnFinish && t.ReceiverAccount == ClientCookie.UserCode);
            var projectComment  = ProjectComment.GetSavedComment(consInfo.Id, "RenewalConsInfo", ClientCookie.UserCode);

            if (string.IsNullOrEmpty(id))
            {
                consInfo.HasReinvenstment = info.NeedProjectCostEst;
            }
            ConsInfoDTO <RenewalInfo, RenewalConsInfo> dto = new ConsInfoDTO <RenewalInfo, RenewalConsInfo>();

            dto.Entity         = consInfo;
            dto.Info           = info;
            dto.ReinBasicInfo  = ReinvestmentBasicInfo.GetByConsInfoId(consInfo.Id);
            dto.ReinCost       = ReinvestmentCost.GetByConsInfoId(consInfo.Id);
            dto.WriteOff       = WriteOffAmount.GetByConsInfoId(consInfo.Id);
            dto.ProjectComment = projectComment != null ? projectComment.Content : "";
            dto.Editable       = ProjectInfo.IsFlowEditable(projectId, FlowCode.Renewal_ConsInfo);
            dto.Recallable     = ProjectInfo.IsFlowRecallable(projectId, FlowCode.Renewal_ConsInfo);
            dto.Savable        = ProjectInfo.IsFlowSavable(projectId, FlowCode.Renewal_ConsInfo) && string.IsNullOrEmpty(id);
            return(dto);
        }
Ejemplo n.º 9
0
        public void Submit(string comment, Action onExecuting = null)
        {
            try
            {
                RenewalInfo info = RenewalInfo.Get(this.ProjectId);
                var         task = TaskWork.GetTaskWork(ProjectId, ClientCookie.UserCode, TaskWorkStatus.UnFinish,
                                                        FlowCode.Renewal, WorkflowCode);

                var dataFields = SetWorkflowDataFields(task);
                var procInstId = K2FxContext.Current.StartProcess(WorkflowProcessCode, ClientCookie.UserCode, dataFields);
                if (procInstId > 0)
                {
                    using (var tranScope = new TransactionScope())
                    {
                        task.Finish();
                        this.ProcInstId        = procInstId;
                        this.CreateTime        = DateTime.Now;
                        this.CreateUserAccount = ClientCookie.UserCode;
                        this.Update();
                        var project = ProjectInfo.Get(this.ProjectId, this.WorkflowCode);
                        project.CreateUserAccount = ClientCookie.UserCode;
                        project.Update();
                        var SavedComment = ProjectComment.GetSavedComment(this.Id, this.TableName, ClientCookie.UserCode);
                        if (SavedComment != null)
                        {
                            SavedComment.Status     = ProjectCommentStatus.Submit;
                            SavedComment.Content    = comment;
                            SavedComment.CreateTime = DateTime.Now;
                            SavedComment.Update();
                        }
                        else
                        {
                            ProjectComment.AddComment(
                                ProjectCommentAction.Submit,
                                comment,
                                this.Id,
                                this.TableName,
                                FlowCode.Renewal,
                                procInstId,
                                ProjectCommentStatus.Submit
                                );
                        }
                        ProjectInfo.FinishNode(this.ProjectId, this.WorkflowCode, NodeCode.Renewal_Tool_Input);
                        if (onExecuting != null)
                        {
                            onExecuting();
                        }
                        tranScope.Complete();
                    }
                }
            }
            catch (Exception ex)
            {
                Log4netHelper.WriteInfo("[[Renewal Too]]:" + JsonConvert.SerializeObject(ex));
                throw ex;
            }
        }
Ejemplo n.º 10
0
        public override void PrepareTask(TaskWork taskWork)
        {
            var info = RenewalInfo.Get(ProjectId);

            if (taskWork.ReceiverAccount == info.AssetActorAccount && taskWork.ActivityName == "AssetActor")
            {
                ProjectInfo.FinishNode(ProjectId, this.WorkflowCode, NodeCode.Renewal_Tool_Approval);
                if (!ProjectInfo.IsFlowFinished(ProjectId, FlowCode.Renewal_ConsInfo))
                {
                    taskWork.Cancel();
                }
            }
        }
Ejemplo n.º 11
0
        public override List <ProcessDataField> SetWorkflowDataFields(TaskWork task)
        {
            RenewalInfo info = RenewalInfo.Get(this.ProjectId);
            var         processDataFields = new List <ProcessDataField>()
            {
                new ProcessDataField("dest_MCCLAssetManager", info.AssetManagerAccount),
                new ProcessDataField("ProcessCode", WorkflowProcessCode)
            };

            if (task != null)
            {
                processDataFields.Add(new ProcessDataField("dest_Creator", ClientCookie.UserCode));
                processDataFields.Add(new ProcessDataField("ProjectTaskInfo", JsonConvert.SerializeObject(task)));
            }
            return(processDataFields);
        }
Ejemplo n.º 12
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(this.ProjectId);

            Log4netHelper.WriteErrorLog(status.ToString());
            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
            {
                Log4netHelper.WriteErrorLog("111111111");
                ProjectProgress.SetProgress(ProjectId, "80%");
                info.GenerateSubmitTask(FlowCode.Renewal_Package);
                ProjectInfo.FinishNode(this.ProjectId, this.WorkflowCode, NodeCode.Renewal_LegalApproval_Approval, ProjectStatus.Finished);
                Log4netHelper.WriteErrorLog("22222222");
            }
            break;
            }
        }
Ejemplo n.º 13
0
        public override List <ProcessDataField> SetWorkflowDataFields(TaskWork task)
        {
            RenewalInfo info = RenewalInfo.Get(this.ProjectId);
            var         processDataFields = new List <ProcessDataField>()
            {
                new ProcessDataField("dest_ConsMgr", !this.HasReinvenstment?"": AppUsers.ConstructionManager.Code),
                new ProcessDataField("dest_MCCLConsMgr", !this.HasReinvenstment?"":AppUsers.MCCLConsManager.Code),
                new ProcessDataField("ProcessCode", WorkflowProcessCode),
                new ProcessDataField("IsNoReinvestment", (!this.HasReinvenstment).ToString(), "BOOLEAN")
            };

            if (task != null)
            {
                processDataFields.Add(new ProcessDataField("dest_Creator", ClientCookie.UserCode));
                processDataFields.Add(new ProcessDataField("ProjectTaskInfo", JsonConvert.SerializeObject(task)));
            }
            return(processDataFields);
        }
Ejemplo n.º 14
0
        public override void Finish(TaskWorkStatus status, TaskWork task)
        {
            var info = RenewalInfo.Get(ProjectId);

            switch (status)
            {
            case TaskWorkStatus.K2ProcessApproved:
                ProjectProgress.SetProgress(ProjectId, "60%");
                ProjectInfo.FinishNode(ProjectId, this.WorkflowCode, NodeCode.Finish, ProjectStatus.Finished);
                if (!ProjectInfo.FlowHaveTask(ProjectId, FlowCode.Renewal_ConfirmLetter))
                {
                    info.GenerateSubmitTask(FlowCode.Renewal_ConfirmLetter);
                }
                break;

            case TaskWorkStatus.K2ProcessDeclined:
                break;
            }
        }
Ejemplo n.º 15
0
 public void GenerateCover()
 {
     if (!Attachment.Any(att => att.RefTableID == this.Id.ToString() && att.RequirementId == new Guid("9D1E247C-AAE0-44F6-869E-F50B3E633C1C")))
     {
         var info             = RenewalInfo.Get(this.ProjectId);
         var store            = StoreBasicInfo.GetStorInfo(info.USCode);
         var contract         = StoreContractInfo.Get(info.USCode);
         var context          = HttpContext.Current;
         var templateFileName = context.Server.MapPath("~/Template/RenewalCover_Template_v20130922.xlsx");
         var fileName         = context.Server.MapPath(string.Format("~/UploadFiles/{0}.xlsx", Guid.NewGuid()));
         File.Copy(templateFileName, fileName);
         var fileInfo = new FileInfo(fileName);
         ExcelDataInputDirector excelDirector = new ExcelDataInputDirector(fileInfo, ExcelDataInputType.RenewalCover);
         ExcelInputDTO          excelInput    = new ExcelInputDTO();
         excelInput.Region              = store.RegionENUS;
         excelInput.Province            = store.ProvinceZHCN;
         excelInput.City                = store.CityENUS;
         excelInput.Market              = store.MarketENUS;
         excelInput.StoreName           = store.NameZHCN;
         excelInput.USCode              = store.StoreCode;
         excelInput.OpenDate            = store.OpenDate;
         excelInput.LeaseExpirationDate = contract.EndDate.Value;
         excelInput.Priority            = info.Priority;
         excelDirector.Input(excelInput);
         var att = new Attachment();
         att.ID              = Guid.NewGuid();
         att.RefTableID      = this.Id.ToString();
         att.RefTableName    = this.TableName;
         att.RelativePath    = "/";
         att.TypeCode        = "Cover";
         att.RequirementId   = Guid.Parse("9D1E247C-AAE0-44F6-869E-F50B3E633C1C");
         att.Name            = "Cover";
         att.Extension       = fileInfo.Extension;
         att.InternalName    = fileInfo.Name;
         att.ContentType     = "application/vnd.ms-excel";
         att.Length          = (int)fileInfo.Length;
         att.CreatorID       = ClientCookie.UserCode;
         att.CreatorNameENUS = ClientCookie.UserNameENUS;
         att.CreatorNameZHCN = ClientCookie.UserNameZHCN;
         att.CreateTime      = DateTime.Now;
         att.Add();
     }
 }
Ejemplo n.º 16
0
        public void UpdateStoreLLRecord()
        {
            var info         = RenewalInfo.Get(this.ProjectId);
            var negotiations = RenewalLLNegotiationRecord.GetRecords(this.Id);

            if (negotiations.Count > 0)
            {
                StoreSTLLRecord record = StoreSTLLRecord.Get(info.USCode);
                if (record == null)
                {
                    var storeBasic = StoreBasicInfo.GetStorInfo(info.USCode);
                    record           = new StoreSTLLRecord();
                    record.StoreCode = info.USCode;
                    record.StoreID   = storeBasic.StoreID;
                    record.Id        = Guid.NewGuid();
                }
                record.LLparticipants  = negotiations[0].LLParticipants;
                record.Location        = negotiations[0].Location;
                record.McdParticipants = negotiations[0].McdParticipants;
                record.Content         = negotiations[0].Content;
                record.CreatedTime     = negotiations[0].CreateTime;
                record.Topic           = negotiations[0].Topic;
                record.Save();
                var storeNegos = negotiations.Select(n => new StoreSTNegotiation
                {
                    Id                = Guid.NewGuid(),
                    StoreID           = record.StoreID,
                    StoreCode         = record.StoreCode,
                    IsBroker          = record.IsBroker,
                    BrokerName        = record.BrokerName,
                    DateTime          = n.Date.Value.ToString("yyyy-MM-dd"),
                    Location          = n.Location,
                    Topic             = n.Topic,
                    McdParticipants   = n.McdParticipants,
                    McdParticipantsAD = record.McdParticipantsAD,
                    LLparticipants    = n.LLParticipants,
                    Content           = n.Content,
                    CreatedTime       = n.CreateTime
                }).ToArray();
                StoreSTNegotiation.Add(storeNegos);
            }
        }
Ejemplo n.º 17
0
        public override string Edit()
        {
            var info     = RenewalInfo.Get(ProjectId);
            var analysis = Duplicator.AutoCopy(this);

            analysis.Id        = Guid.NewGuid();
            analysis.IsHistory = false;
            analysis.Add();
            this.IsHistory = true;
            this.Update();
            ProjectInfo.Reset(ProjectId, this.WorkflowCode);
            RenewalPackage package = RenewalPackage.Get(ProjectId);

            package.AnalysisId = analysis.Id;
            package.Update();
            TaskWork.Cancel(e => e.TypeCode == FlowCode.Renewal_Analysis && e.RefID == ProjectId && e.Status == TaskWorkStatus.UnFinish);
            var task = info.GenerateSubmitTask(FlowCode.Renewal_Analysis);

            return(task.Url);
        }
Ejemplo n.º 18
0
        public override string Edit()
        {
            using (var tranScope = new TransactionScope())
            {
                var info   = RenewalInfo.Get(this.ProjectId);
                var entity = Duplicator.AutoCopy(this);
                entity.Id                = Guid.NewGuid();
                entity.IsHistory         = false;
                entity.CreateTime        = DateTime.Now;
                entity.CreateUserAccount = ClientCookie.UserCode;
                entity.Add();
                this.IsHistory = true;
                this.Update();
                ProjectInfo.Reset(ProjectId, this.WorkflowCode);
                var attachments = Attachment.GetList(this.TableName, Id.ToString(), string.Empty);
                attachments.ForEach(att =>
                {
                    att.RefTableID = entity.Id.ToString();
                    att.ID         = Guid.NewGuid();
                });
                Attachment.Add(attachments.ToArray());

                //var TypeCodes = new[] { FlowCode.Renewal_ContractInfo, FlowCode.Renewal_SiteInfo };
                //foreach (var typeCode in TypeCodes)
                //{
                //    var proj = ProjectInfo.Search(e => e.ProjectId == ProjectId && e.FlowCode == typeCode).FirstOrDefault();
                //    if (proj != null && proj.Status != ProjectStatus.Finished)
                //    {
                //        var oldTask = TaskWork.Search(t => t.RefID == ProjectId && t.Status == TaskWorkStatus.UnFinish && t.TypeCode == typeCode).FirstOrDefault();
                //        if (oldTask != null)
                //        {
                //            oldTask.Status = TaskWorkStatus.Cancel;
                //            TaskWork.Update(oldTask);
                //        }
                //    }
                //}
                var task = info.GenerateSubmitTask(this.WorkflowCode);
                tranScope.Complete();
                return(task.Url);
            }
        }
Ejemplo n.º 19
0
        public static RenewalAnalysisDTO InitPage(string projectId)
        {
            RenewalAnalysisDTO dto = new RenewalAnalysisDTO();
            var consInfo           = RenewalConsInfo.Get(projectId);
            var analysis           = Get(projectId);

            if (consInfo.HasReinvenstment)
            {
                var reinBasic = ReinvestmentBasicInfo.GetByConsInfoId(consInfo.Id) ?? new ReinvestmentBasicInfo();
                analysis.OperationSize = reinBasic.NewOperationSize;
            }
            dto.Info = RenewalInfo.Get(projectId);
            analysis.LastRemodeling = GetLastRemodeling(dto.Info.USCode);
            dto.Entity           = analysis;
            dto.HasReinvenstment = consInfo.HasReinvenstment;
            dto.StoreInfo        = PrepareStoreInfo(projectId, dto.Info.USCode);
            dto.Editable         = ProjectInfo.IsFlowEditable(projectId, FlowCode.Renewal_Analysis);
            dto.Recallable       = ProjectInfo.IsFlowRecallable(projectId, FlowCode.Renewal_Analysis);
            dto.Savable          = ProjectInfo.IsFlowSavable(projectId, FlowCode.Renewal_Analysis);
            return(dto);
        }
Ejemplo n.º 20
0
        public static RenewalLegalApprovalDTO InitPage(string projectId, string id = null)
        {
            RenewalLegalApprovalDTO dto = new RenewalLegalApprovalDTO();
            var entity  = Get(projectId, id);
            var info    = RenewalInfo.Get(projectId);
            var isActor = ClientCookie.UserCode == info.AssetActorAccount;

            entity.IsProjectFreezed = entity.CheckIfFreezeProject(projectId);
            var nextRefTableId  = new Guid(FlowInfo.GetRefTableId(entity.TableName, projectId));
            var nextFlowStarted = ProjectInfo.IsFlowStarted(projectId, FlowCode.Renewal_Package);
            var haveTask        = TaskWork.Any(t => t.RefID == projectId && t.TypeCode == FlowCode.Renewal_LegalApproval && t.Status == TaskWorkStatus.UnFinish && t.ReceiverAccount == ClientCookie.UserCode);
            var projectComment  = ProjectComment.GetSavedComment(entity.Id, entity.TableName, ClientCookie.UserCode);
            var appUser         = ApproveDialogUser.GetApproveDialogUser(entity.Id.ToString());

            dto.Info             = info;
            dto.Entity           = entity;
            dto.ProjectComment   = projectComment != null ? projectComment.Content : "";
            dto.IsGeneralCounsel = appUser != null && appUser.GeneralCounselCode == ClientCookie.UserCode;
            dto.Editable         = ProjectInfo.IsFlowEditable(projectId, FlowCode.Renewal_LegalApproval);
            dto.Recallable       = ProjectInfo.IsFlowRecallable(projectId, FlowCode.Renewal_LegalApproval);
            dto.Savable          = ProjectInfo.IsFlowSavable(projectId, FlowCode.Renewal_LegalApproval) && string.IsNullOrEmpty(id);
            return(dto);
        }
Ejemplo n.º 21
0
        public override string Edit()
        {
            var info   = RenewalInfo.Get(ProjectId);
            var entity = Duplicator.AutoCopy(this);

            entity.Id        = Guid.NewGuid();
            entity.IsHistory = false;
            entity.Add();
            this.IsHistory = true;
            this.Update();
            var records = RenewalLLNegotiationRecord.GetRecords(this.Id);

            records.ForEach(rec =>
            {
                rec.Id = Guid.NewGuid();
                rec.RenewalLLNegotiationId = entity.Id;
            });
            RenewalLLNegotiationRecord.Add(records.ToArray());
            TaskWork.Cancel(e => e.TypeCode == this.WorkflowCode && e.RefID == ProjectId && e.Status == TaskWorkStatus.UnFinish);
            ProjectInfo.Reset(ProjectId, this.WorkflowCode);
            var task = info.GenerateSubmitTask(this.WorkflowCode);

            return(task.Url);
        }
Ejemplo n.º 22
0
 public override void Finish(TaskWorkStatus status, TaskWork task)
 {
     switch (status)
     {
     case TaskWorkStatus.K2ProcessApproved:
     {
         ProjectInfo.FinishNode(ProjectId, this.WorkflowCode, NodeCode.Finish);
         ProjectInfo.FinishNode(ProjectId, FlowCode.Renewal_LLNegotiation, NodeCode.Renewal_LLNegotiation_ConfirmLetter);
         if (!ProjectInfo.IsFlowStarted(ProjectId, FlowCode.Renewal_ConsInfo))
         {
             var info = RenewalInfo.Get(task.RefID);
             if (ProjectInfo.IsFlowFinished(ProjectId, FlowCode.Renewal_LLNegotiation))
             {
                 ProjectProgress.SetProgress(ProjectId, "30%");
                 if (info.NeedProjectCostEst)
                 {
                     if (!ProjectInfo.IsFlowStarted(ProjectId, FlowCode.Renewal_ConsInfo))
                     {
                         info.GenerateSubmitTask(FlowCode.Renewal_ConsInfo);
                     }
                 }
                 else
                 {
                     ProjectInfo.FinishNode(ProjectId, FlowCode.Renewal_ConsInfo, NodeCode.Finish, ProjectStatus.Finished);
                     if (!ProjectInfo.IsFlowStarted(ProjectId, FlowCode.Renewal_Tool))
                     {
                         info.GenerateSubmitTask(FlowCode.Renewal_Tool);
                     }
                 }
             }
         }
         TaskWork.Finish(t => t.TypeCode == this.WorkflowCode && t.RefID == this.ProjectId && t.Status == TaskWorkStatus.UnFinish);
     }
     break;
     }
 }
Ejemplo n.º 23
0
        public static RenewalGBMemo GetGBMemo(string projectId, string entityId = "")
        {
            var memo = (string.IsNullOrEmpty(entityId) ?
                        FirstOrDefault(e => e.ProjectId.Equals(projectId) && !e.IsHistory)
                : FirstOrDefault(e => e.Id.ToString().Equals(entityId))) ?? new RenewalGBMemo();

            memo.ProjectId = projectId;

            var rnInfo = RenewalInfo.Get(projectId);

            memo.Info   = rnInfo;
            memo.UsCode = rnInfo.USCode;

            memo.Store = StoreBasicInfo.GetStore(memo.UsCode);

            if (memo.Id == Guid.Empty)
            {
                memo.IsClosed      = (memo.Store.StoreBasicInfo.statusName == "Closed");
                memo.IsInOperation = false;
                var consInfo = new RenewalConsInfo();
                memo.ReinvestInfo = consInfo.GetReinvestmentBasicInfo(projectId);
                if (memo.ReinvestInfo != null)
                {
                    if ((memo.ReinvestInfo.NewAttachedKiosk.HasValue && memo.ReinvestInfo.NewAttachedKiosk.Value) ||
                        (memo.ReinvestInfo.NewRemoteKiosk.HasValue && memo.ReinvestInfo.NewRemoteKiosk.Value))
                    {
                        memo.IsKiosk = true;
                    }
                    memo.IsMcCafe = memo.ReinvestInfo.NewMcCafe.HasValue && memo.ReinvestInfo.NewMcCafe.Value;
                    memo.IsMDS    = memo.ReinvestInfo.NewMDS.HasValue && memo.ReinvestInfo.NewMDS.Value;
                    memo.Is24Hour = memo.ReinvestInfo.NewTwientyFourHour.HasValue &&
                                    memo.ReinvestInfo.NewTwientyFourHour.Value;
                    memo.GBDate = memo.ReinvestInfo.GBDate;
                    memo.ConstCompletionDate = memo.ReinvestInfo.ConsCompletionDate;
                    memo.ReopenDate          = memo.ReinvestInfo.ReopenDate;
                }
                memo.Save();
            }
            else
            {
                var projectInfo = ProjectInfo.FirstOrDefault(e => e.ProjectId == projectId &&
                                                             e.FlowCode == FlowCode.Renewal_GBMemo);

                if (projectInfo != null)
                {
                    if (ClientCookie.UserCode.Equals(rnInfo.PMAccount))
                    {
                        var isFlowFlinshed =
                            TaskWork.Any(e =>
                                         e.RefID == projectId && e.TypeCode == FlowCode.Renewal_GBMemo &&
                                         e.Status == TaskWorkStatus.K2ProcessApproved && e.ProcInstID == memo.ProcInstID);
                        var isExistTask = TaskWork.Any(e => e.RefID == projectId &&
                                                       e.TypeCode == FlowCode.Renewal_GBMemo &&
                                                       e.Status == TaskWorkStatus.UnFinish &&
                                                       e.ReceiverAccount == ClientCookie.UserCode &&
                                                       (e.ActivityName == WFMajorLeaseLegalReview.Act_Originator || e.ActivityName == WFMajorLeaseLegalReview.Act_Start));
                        memo.IsShowEdit   = isFlowFlinshed;
                        memo.IsShowRecall = !isFlowFlinshed && !isExistTask;
                    }
                }
            }
            //if (ClientCookie.UserCode.Equals(rnInfo.PMAccount))
            //    memo.IsShowSave = ProjectInfo.IsFlowSavable(projectId, FlowCode.Renewal_GBMemo);
            PopulateAppUsers(memo);
            return(memo);
        }
Ejemplo n.º 24
0
        public Dictionary <string, string> GetPrintTemplateFields()
        {
            var project       = ProjectInfo.Get(ProjectId, FlowCode.Renewal_LegalApproval);
            var storeBasic    = StoreBasicInfo.GetStorInfo(project.USCode);
            var storeContract = StoreContractInfo.Search(c => c.StoreCode == project.USCode).OrderByDescending(c => c.CreatedTime).FirstOrDefault();
            var info          = RenewalInfo.Get(ProjectId);
            var flowInfo      = FlowInfo.Get(FlowCode.Renewal);
            var legal         = RenewalLegalApproval.Get(project.ProjectId) ?? new RenewalLegalApproval();
            Dictionary <string, string> templateFileds = new Dictionary <string, string>();

            templateFileds.Add("WorkflowName", flowInfo.NameENUS);
            templateFileds.Add("ProjectID", ProjectId);
            templateFileds.Add("USCode", storeBasic.StoreCode);
            templateFileds.Add("Region", storeBasic.Region);
            templateFileds.Add("StoreNameEN", storeBasic.NameENUS);
            templateFileds.Add("Market", storeBasic.Market);
            templateFileds.Add("City", storeBasic.CityZHCN);
            templateFileds.Add("StoreNameCN", storeBasic.NameZHCN);
            templateFileds.Add("StoreAge", Math.Floor((DateTime.Now - storeBasic.OpenDate).TotalDays / 365D).ToString());
            templateFileds.Add("OpenDate", storeBasic.OpenDate.ToString("yyyy-MM-dd"));
            templateFileds.Add("CloseDate", storeBasic.CloseDate.HasValue ? (storeBasic.CloseDate.Value.Year != 1900 ? storeBasic.CloseDate.Value.ToString("yyyy-MM-dd") : "") : "");

            if (storeContract != null)
            {
                templateFileds.Add("CurrentLeaseENDYear", storeContract.EndYear);
            }
            else
            {
                templateFileds.Add("CurrentLeaseENDYear", "");
            }

            templateFileds.Add("AssetsManager", info.AssetManagerNameENUS);
            templateFileds.Add("AssetsActor", info.AssetActorNameENUS);
            templateFileds.Add("AssetsRep", info.AssetRepNameENUS);
            templateFileds.Add("NewLeaseENDYear", info.NewLeaseEndDate.HasValue ? info.NewLeaseEndDate.Value.ToString("yyyy") : "");
            templateFileds.Add("ClosureDate", storeBasic.CloseDate.HasValue ? (storeBasic.CloseDate.Value.Year != 1900 ? storeBasic.CloseDate.Value.ToString("yyyy-MM-dd") : "") : "");

            var           contractData = Employee.GetEmployeeContact(ProjectId);
            StringBuilder sbd          = new StringBuilder();

            if (contractData != null && contractData.Count > 0)
            {
                foreach (var item in contractData)
                {
                    sbd.Append("<tr><td>&nbsp;</td>");
                    sbd.Append("<td>");
                    sbd.Append(item.NameENUS);
                    sbd.Append("</td>");
                    sbd.Append("<td>");
                    sbd.Append(item.PositionENUS);
                    sbd.Append("</td>");
                    sbd.Append("<td>");
                    sbd.Append(item.Mail);
                    sbd.Append("</td>");
                    sbd.Append("<td>");
                    sbd.Append(item.Phone);
                    sbd.Append("</td>");
                    sbd.Append("<td>");
                    sbd.Append(item.Mobile);
                    sbd.Append("</td>");
                    sbd.Append("</tr>");
                }
            }
            else
            {
                sbd.Append("<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>");
            }
            templateFileds.Add("ContactInfoData", sbd.ToString());

            //Special Application
            templateFileds.Add("isurgencyyes", legal.IsUrgency ? "checked" : "");
            templateFileds.Add("isurgencyno", !legal.IsUrgency ? "checked" : "");
            templateFileds.Add("urgencyreason", legal.UrgencyReason);

            //transaction involves
            templateFileds.Add("isrecenttransfer", legal.IsRecentTransfer ? "checked" : "");
            templateFileds.Add("isintermediaries", legal.IsIntermediaries ? "checked" : "");
            templateFileds.Add("isrelatedparties", legal.IsRelatedParties ? "checked" : "");
            templateFileds.Add("isbroker", legal.IsBroker ? "checked" : "");
            templateFileds.Add("ispttp", legal.IsPTTP ? "checked" : "");
            templateFileds.Add("isasiiwgo", legal.IsASIIWGO ? "checked" : "");
            templateFileds.Add("isnoblclause", legal.IsNoBLClause ? "checked" : "");
            templateFileds.Add("isofac", legal.IsOFAC ? "checked" : "");
            templateFileds.Add("isantic", legal.IsAntiC ? "checked" : "");
            templateFileds.Add("isbenefitconflict", legal.IsBenefitConflict ? "checked" : "");
            templateFileds.Add("noneofabove", legal.NoneOfAbove ? "checked" : "");

            //Any Legal Concerns
            templateFileds.Add("anylegalconcernno", !legal.AnyLegalConcern ? "checked" : "");
            templateFileds.Add("anylegalconcernyes", legal.AnyLegalConcern ? "checked" : "");
            templateFileds.Add("illegalstructure", legal.IllegalStructure ? "checked" : "");
            templateFileds.Add("occupying", legal.Occupying ? "checked" : "");
            templateFileds.Add("noauthoritytorelease", legal.NoAuthorityToRelease ? "checked" : "");
            templateFileds.Add("entrustlease", legal.EntrustLease ? "checked" : "");
            templateFileds.Add("sublease", legal.SubLease ? "checked" : "");
            templateFileds.Add("beingsealedup", legal.BeingSealedUp ? "checked" : "");
            templateFileds.Add("beingsealedupdesc", legal.BeingSealedUpDesc);
            templateFileds.Add("licensecantbeobtained", legal.LicenseCantBeObtained ? "checked" : "");
            templateFileds.Add("pendingordispute", legal.PendingOrDispute ? "checked" : "");
            templateFileds.Add("pendingordisputedesc", legal.PendingOrDisputeDesc);
            templateFileds.Add("otherissure", legal.OtherIssure ? "checked" : "");
            templateFileds.Add("OtherIssureDesc", legal.OtherIssureDesc);

            //SOX Audit
            templateFileds.Add("optionsforrenewalyes", legal.OptionsForRenewal ? "checked" : "");
            templateFileds.Add("optionsforrenewalno", !legal.OptionsForRenewal ? "checked" : "");
            templateFileds.Add("reinstatementrequirementyes", legal.ReinstatementRequirement ? "checked" : "");
            templateFileds.Add("reinstatementrequirementno", !legal.ReinstatementRequirement ? "checked" : "");

            //Legal Department Review
            templateFileds.Add("endorsed", legal.ReviewStatus == "Endorsed" ? "checked" : "");
            templateFileds.Add("legalcomments", (legal.ReviewStatus == "LegalComments") ? "checked" : "");
            templateFileds.Add("notendorsed", legal.ReviewStatus == "" ? "NotEndorsed" : "");
            templateFileds.Add("submitbeforesign", legal.SubmitBeforeSign ? "checked" : "");
            templateFileds.Add("SubmitBeforeSignDesc", legal.SubmitBeforeSignDesc);
            templateFileds.Add("landlordformleaseuserd", legal.LandlordFormLeaseUserd ? "checked" : "");
            templateFileds.Add("ownerrefusetohonorlease", legal.OwnerRefuseToHonorLease ? "checked" : "");
            templateFileds.Add("mortgageerefusetoguarantee", legal.MortgageeRefuseToGuarantee ? "checked" : "");
            templateFileds.Add("otherlegalcomment", legal.OtherLegalComment ? "checked" : "");
            templateFileds.Add("LegalComments", legal.LegalComments);
            templateFileds.Add("OtherLegalCommentDesc", legal.OtherLegalCommentDesc);
            templateFileds.Add("NotEndorsedIssureNo", legal.NotEndorsedIssureNo.HasValue?legal.NotEndorsedIssureNo.Value.ToString():"");

            //Endorsement by General Counsel
            templateFileds.Add("GCComment", legal.GCComment);
            return(templateFileds);
        }
Ejemplo n.º 25
0
        public string DownloadToolTemplate()
        {
            var    templateFileName = string.Concat(SiteFilePath.Template_DIRECTORY, "/", SiteFilePath.RenewalTool_Template);
            string fileName         = string.Format("{0}/{1}.xlsx", SiteFilePath.TEMP_DIRECTORY, Guid.NewGuid());

            File.Copy(templateFileName, fileName);
            FileInfo fileInfo = new FileInfo(fileName);
            ExcelDataInputDirector excelDirector = new ExcelDataInputDirector(fileInfo, ExcelDataInputType.RenewalTool);
            ExcelInputDTO          excelDto      = new ExcelInputDTO();
            var info          = RenewalInfo.Get(this.ProjectId);
            var storeBasic    = StoreBasicInfo.GetStorInfo(info.USCode);
            var storeContract = StoreContractInfo.Get(info.USCode);
            var finInput      = RenewalToolFinMeasureInput.Get(this.ProjectId, this.Id);
            var wfAndReinCost = RenewalToolWriteOffAndReinCost.Get(this.ProjectId, this.Id);

            excelDto.USCode    = info.USCode;
            excelDto.Market    = storeBasic.Market;
            excelDto.StoreName = storeBasic.NameZHCN + "/" + storeBasic.NameENUS;
            excelDto.OpenDate  = storeBasic.OpenDate;
            if (storeContract.EndDate.HasValue)
            {
                excelDto.LeaseExpirationDate = storeContract.EndDate.Value;
            }
            excelDto.RenewalYears     = info.RenewalYears;
            excelDto.ProductSales     = finInput.ProductSalesAdjustment;
            excelDto.Pac              = finInput.PacAdjustment;
            excelDto.Rent             = finInput.RentAdjustment;
            excelDto.DepreciationLhi  = finInput.DepreciationLhiAdjustment;
            excelDto.InterestLhi      = finInput.InterestLhiAdjustment;
            excelDto.ServiceFee       = finInput.ServiceFeeAdjustment;
            excelDto.Accounting       = finInput.AccountingAdjustment;
            excelDto.Insurance        = finInput.InsuranceAdjustment;
            excelDto.TaxesAndLicenses = finInput.TaxesAndLicensesAdjustment;
            excelDto.DepreciationEssd = finInput.DepreciationEssdAdjustment;
            excelDto.InterestEssd     = finInput.InterestEssdAdjustment;
            excelDto.OtherIncExp      = finInput.OtherIncExpAdjustment;
            excelDto.NonProductSales  = finInput.NonProductSalesAdjustment;
            excelDto.NonProductCosts  = finInput.NonProductCostsAdjustment;
            excelDto.REII             = wfAndReinCost.REII;
            excelDto.LHIII            = wfAndReinCost.LHIII;
            excelDto.ESSDII           = wfAndReinCost.ESSDII;
            excelDto.RENBV            = wfAndReinCost.RENBV;
            if (wfAndReinCost.LHINBV.HasValue)
            {
                excelDto.LHINBV = wfAndReinCost.LHINBV.Value;
            }
            if (wfAndReinCost.ESSDNBV.HasValue)
            {
                excelDto.ESSDNBV = wfAndReinCost.ESSDNBV.Value;
            }
            excelDto.RECost             = wfAndReinCost.RECost;
            excelDto.LHICost            = wfAndReinCost.LHICost;
            excelDto.ESSDCost           = wfAndReinCost.ESSDCost;
            excelDto.TotalWriteOff      = wfAndReinCost.REWriteOff + wfAndReinCost.LHIWriteOff + wfAndReinCost.ESSDWriteOff;
            excelDto.RentalStructure    = !string.IsNullOrEmpty(finInput.RentalStructure) ? (Nullable <decimal>)decimal.Parse(finInput.RentalStructure) : null;
            excelDto.ContributionMargin = finInput.ContributionMargin;
            excelDto.SalesCompYr1       = finInput.SalesCompYr1;
            excelDto.SalesCompYr2       = finInput.SalesCompYr2;
            excelDto.SalesCompYr3       = finInput.SalesCompYr3;
            excelDto.SalesCompYr4       = finInput.SalesCompYr4;
            excelDto.SalesCompYr5       = finInput.SalesCompYr5;
            excelDto.SalesCompYr6       = finInput.SalesCompYr6;
            excelDto.SalesCompYr7       = finInput.SalesCompYr7;
            excelDto.SalesCompYr8       = finInput.SalesCompYr8;
            excelDto.SalesCompYr9       = finInput.SalesCompYr9;
            excelDto.SalesCompYr10      = finInput.SalesCompYr10;
            excelDto.SalesCompYr11      = finInput.SalesCompYr11;
            excelDto.SalesCompYr12      = finInput.SalesCompYr12;
            excelDto.SalesCompYr13      = finInput.SalesCompYr13;
            excelDto.SalesCompYr14      = finInput.SalesCompYr14;
            excelDto.SalesCompYr15      = finInput.SalesCompYr15;
            excelDto.SalesCompYr16      = finInput.SalesCompYr16;
            excelDto.SalesCompYr17      = finInput.SalesCompYr17;
            excelDto.SalesCompYr18      = finInput.SalesCompYr18;
            excelDto.SalesCompYr19      = finInput.SalesCompYr19;
            excelDto.SalesCompYr20      = finInput.SalesCompYr20;
            excelDto.ComSalesDesc       = this.ComSalesDesc;
            excelDto.CompSales          = finInput.CompSalesAdjustment;
            excelDto.FinanceYear        = finInput.FinanceYear;
            excelDto.FinanceMonth       = finInput.FinanceMonth;
            excelDirector.Input(excelDto);
            return(fileName);
        }
Ejemplo n.º 26
0
        public override string Edit()
        {
            string url;

            using (var tranScope = new TransactionScope())
            {
                var info = RenewalInfo.Get(this.ProjectId);
                var tool = Duplicator.AutoCopy(this);
                tool.Id                = Guid.NewGuid();
                tool.IsHistory         = false;
                tool.CreateTime        = DateTime.Now;
                tool.CreateUserAccount = ClientCookie.UserCode;
                tool.Add();

                NewEntityId = tool.Id;
                IsHistory   = true;
                this.Update();
                ProjectInfo.Reset(ProjectId, this.WorkflowCode);
                var attachments = Attachment.GetList(this.TableName, Id.ToString(), string.Empty);
                attachments.ForEach(att =>
                {
                    att.RefTableID = tool.Id.ToString();
                    att.ID         = Guid.NewGuid();
                });
                Attachment.Add(attachments.ToArray());

                var FinMI    = RenewalToolFinMeasureInput.Get(this.ProjectId, this.Id);
                var newFinMI = Duplicator.AutoCopy(FinMI);
                newFinMI.Id     = Guid.NewGuid();
                newFinMI.ToolId = tool.Id;
                newFinMI.Add();

                var WfRc    = RenewalToolWriteOffAndReinCost.Get(this.ProjectId, this.Id);
                var newWfRc = Duplicator.AutoCopy(WfRc);
                newWfRc.Id     = Guid.NewGuid();
                newWfRc.ToolId = tool.Id;
                newWfRc.Add();

                var FinMO    = RenewalToolFinMeasureOutput.GetByToolId(this.Id);
                var newFinMO = Duplicator.AutoCopy(FinMO);
                newFinMO.Id     = Guid.NewGuid();
                newFinMO.ToolId = tool.Id;
                newFinMO.Add();

                var package = RenewalPackage.Get(this.ProjectId);
                package.ToolId = tool.Id;
                package.Update();

                var oldTasks = TaskWork.Search(t => t.RefID == ProjectId && t.Status == TaskWorkStatus.UnFinish && new string[] { this.WorkflowCode, FlowCode.Renewal_Analysis }.Contains(t.TypeCode)).ToList();
                oldTasks.ForEach(t =>
                {
                    t.Status = TaskWorkStatus.Cancel;
                });
                TaskWork.Update(oldTasks.ToArray());

                var anlysisProj = ProjectInfo.FirstOrDefault(e => e.FlowCode == FlowCode.Renewal_Analysis &&
                                                             e.Status == ProjectStatus.UnFinish && e.ProjectId == ProjectId);
                if (anlysisProj != null)
                {
                    var taskAnlysis = TaskWork.FirstOrDefault(e => e.TypeCode == FlowCode.Renewal_Analysis && e.RefID == ProjectId && e.Status == TaskWorkStatus.UnFinish);
                    if (taskAnlysis != null)
                    {
                        taskAnlysis.Status     = TaskWorkStatus.Finished;
                        taskAnlysis.FinishTime = DateTime.Now;
                        taskAnlysis.Update();
                    }
                }
                var task = info.GenerateSubmitTask(this.WorkflowCode);
                url = task.Url;
                tranScope.Complete();
            }

            return(url);
        }
Ejemplo n.º 27
0
        public static TTMFinanceData GetFinanceData(string projectId, string financeYear = "", string financeMonth = "")
        {
            var ldw_FinanceData = LDW_FinanceData.Get(projectId);
            var ttmData         = new TTMFinanceData();

            if (string.IsNullOrEmpty(financeYear) && string.IsNullOrEmpty(financeMonth) && ldw_FinanceData != null)
            {
                ttmData.Accounting       = DataConverter.ToDecimal(ldw_FinanceData.Accounting_TTM);
                ttmData.DepreciationEssd = DataConverter.ToDecimal(ldw_FinanceData.Depreciation_Essd_TTM);
                ttmData.DepreciationLhi  = DataConverter.ToDecimal(ldw_FinanceData.Depreciation_LHI_TTM);
                ttmData.NonProductCosts  = DataConverter.ToDecimal(ldw_FinanceData.Non_Product_Costs_TTM);
                ttmData.NonProductSales  = DataConverter.ToDecimal(ldw_FinanceData.Non_Product_Sales_TTM);
                ttmData.Insurance        = DataConverter.ToDecimal(ldw_FinanceData.Insurance_TTM);

                ttmData.InterestEssd     = DataConverter.ToDecimal(ldw_FinanceData.Interest_Essd_TTM);
                ttmData.InterestLhi      = DataConverter.ToDecimal(ldw_FinanceData.Interest_LHI_TTM);
                ttmData.OtherIncExp      = DataConverter.ToDecimal(ldw_FinanceData.Other_Exp_TTM);
                ttmData.Pac              = DataConverter.ToDecimal(ldw_FinanceData.Pac_TTM);
                ttmData.ProductSales     = DataConverter.ToDecimal(ldw_FinanceData.ProductSales_TTM);
                ttmData.Rent             = DataConverter.ToDecimal(ldw_FinanceData.Rent_TTM);
                ttmData.ServiceFee       = DataConverter.ToDecimal(ldw_FinanceData.Service_Fee_TTM);
                ttmData.TaxesAndLicenses = DataConverter.ToDecimal(ldw_FinanceData.Taxes_Licenses_TTM);
                ttmData.CompSales        = DataConverter.ToDecimal(ldw_FinanceData.comp_sales_ttm);
            }
            else
            {
                var yearMonthObj = StoreSTMonthlyFinaceInfoTTM.FirstOrDefault(f => true);
                if (string.IsNullOrEmpty(financeYear))
                {
                    if (yearMonthObj != null && !string.IsNullOrEmpty(yearMonthObj.TTMValue))
                    {
                        financeYear = yearMonthObj.TTMValue.Substring(0, yearMonthObj.TTMValue.IndexOf('-'));
                    }
                    else
                    {
                        financeYear = Utils.GetLatestYear();
                    }
                }
                if (string.IsNullOrEmpty(financeMonth))
                {
                    if (yearMonthObj != null && !string.IsNullOrEmpty(yearMonthObj.TTMValue))
                    {
                        financeMonth = yearMonthObj.TTMValue.Substring(yearMonthObj.TTMValue.IndexOf('-') + 1);
                    }
                    else
                    {
                        financeMonth = Utils.GetLatestMonth();
                    }
                }
                var uscode       = RenewalInfo.Get(projectId).USCode;
                var storeId      = StoreBasicInfo.Search(s => s.StoreCode.Equals(uscode)).Select(id => id.StoreID).FirstOrDefault();
                var financeData  = DataSync_LDW_AM_STFinanceData.FirstOrDefault(f => f.UsCode == uscode && f.FinanceYear.Equals(financeYear) && f.FinanceMonth.Equals(financeMonth));
                var financeData2 = DataSync_LDW_AM_STFinanceData2.FirstOrDefault(f => f.UsCode == uscode && f.FinanceYear.Equals(financeYear) && f.FinanceMonth.Equals(financeMonth));
                var re           = DataSync_LDW_AM_STMonthlyFinaceInfo.Search(f => f.StoreID == storeId).OrderByDescending(f => f.Year).FirstOrDefault();

                ttmData.Accounting       = DataConverter.ToDecimal(financeData2.Accounting_TTM);
                ttmData.DepreciationEssd = DataConverter.ToDecimal(financeData2.Depreciation_Essd_TTM);
                ttmData.DepreciationLhi  = DataConverter.ToDecimal(financeData2.Depreciation_LHI_TTM);
                ttmData.NonProductCosts  = DataConverter.ToDecimal(financeData2.Non_Product_Costs_TTM);
                ttmData.NonProductSales  = DataConverter.ToDecimal(financeData2.Non_Product_Sales_TTM);
                ttmData.Insurance        = DataConverter.ToDecimal(financeData2.Insurance_TTM);
                ttmData.InterestEssd     = DataConverter.ToDecimal(financeData2.Interest_Essd_TTM);
                ttmData.InterestLhi      = DataConverter.ToDecimal(financeData2.Interest_LHI_TTM);
                ttmData.OtherIncExp      = DataConverter.ToDecimal(financeData2.Other_Exp_TTM);
                ttmData.Pac              = DataConverter.ToDecimal(financeData2.Pac_TTM);
                ttmData.ProductSales     = DataConverter.ToDecimal(financeData.ProductSales_TTM);
                ttmData.Rent             = DataConverter.ToDecimal(financeData2.Rent_TTM);
                ttmData.ServiceFee       = DataConverter.ToDecimal(financeData2.Service_Fee_TTM);
                ttmData.TaxesAndLicenses = DataConverter.ToDecimal(financeData2.Taxes_Licenses_TTM);
                ttmData.CompSales        = DataConverter.ToDecimal(financeData2.comp_sales_ttm);
            }
            return(ttmData);
        }
Ejemplo n.º 28
0
        public static RenewalToolDTO InitPage(string projectId, string id = null)
        {
            RenewalToolDTO dto       = new RenewalToolDTO();
            var            tool      = RenewalTool.Get(projectId, id);
            var            project   = ProjectInfo.Get(projectId, FlowCode.Renewal_Tool);
            var            info      = RenewalInfo.Get(projectId);
            var            isFinance = ClientCookie.UserCode == info.FinanceAccount;

            tool.IsProjectFreezed = tool.CheckIfFreezeProject(projectId);
            var    nextRefTableId    = new Guid(FlowInfo.GetRefTableId("RenewalAnalysis", projectId));
            var    nextFlowStarted   = ProjectInfo.IsFlowStarted(projectId, FlowCode.Renewal_Analysis);
            var    haveTask          = TaskWork.Any(t => t.RefID == projectId && t.TypeCode == FlowCode.Renewal_Tool && t.Status == TaskWorkStatus.UnFinish && t.ReceiverAccount == ClientCookie.UserCode);
            var    projectComment    = ProjectComment.GetSavedComment(tool.Id, "RenewalTool", ClientCookie.UserCode);
            var    projectNode       = NodeInfo.GetNodeInfo(project.NodeCode);
            var    packageStarted    = ProjectInfo.IsFlowStarted(projectId, FlowCode.Renewal_Package);
            string selectedYearMonth = null;

            dto.Info              = info;
            dto.Entity            = tool;
            dto.TTMDataYearMonths = RenewalToolFinMeasureInput.GetYearMonths(projectId, out selectedYearMonth);
            dto.FinMeasureInput   = RenewalToolFinMeasureInput.Get(projectId, dto.Entity.Id);
            if (string.IsNullOrEmpty(dto.FinMeasureInput.FinanceYear) || string.IsNullOrEmpty(dto.FinMeasureInput.FinanceMonth))
            {
                var ym = selectedYearMonth.Split('-');
                dto.FinMeasureInput.FinanceYear  = ym[0];
                dto.FinMeasureInput.FinanceMonth = ym[1];
            }
            dto.FinMeasureInput.FinanceDataYearMonth = dto.FinMeasureInput.FinanceYear + "-" + dto.FinMeasureInput.FinanceMonth;
            //dto.FinMeasureInput.ContributionMargin = StoreCM.Get(dto.Info.USCode).ContributionMargin;
            McdAMEntities amdb  = new McdAMEntities();
            var           finfo = amdb.DataSync_LDW_AM_STFinanceData2.FirstOrDefault(f => f.UsCode == dto.Info.USCode &&
                                                                                     f.FinanceYear == dto.FinMeasureInput.FinanceYear && f.FinanceMonth == dto.FinMeasureInput.FinanceMonth);
            decimal cm = 0;

            if (finfo != null && !string.IsNullOrEmpty(finfo.contribution_marginPct))
            {
                cm = decimal.Parse(finfo.contribution_marginPct);
            }
            dto.FinMeasureInput.ContributionMargin = cm;
            var coninfo = RenewalConsInfo.FirstOrDefault(e => e.ProjectId == projectId && !e.IsHistory);
            var conProj = ProjectInfo.FirstOrDefault(e => e.ProjectId == projectId && e.FlowCode == "Renewal_ConsInfo");

            dto.WriteOffAndReinCost = RenewalToolWriteOffAndReinCost.Get(projectId, dto.Entity.Id, projectNode);
            if (coninfo != null && !coninfo.HasReinvenstment)
            {
                dto.WriteOffAndReinCost.REWriteOff   = null;
                dto.WriteOffAndReinCost.LHIWriteOff  = null;
                dto.WriteOffAndReinCost.ESSDWriteOff = null;
                dto.WriteOffAndReinCost.ESSDWriteOff = null;
                dto.WriteOffAndReinCost.RECost       = null;
                dto.WriteOffAndReinCost.LHICost      = null;
                dto.WriteOffAndReinCost.ESSDCost     = null;
            }

            dto.Uploadable     = projectNode.Sequence >= 3 && ClientCookie.UserCode == dto.Info.AssetActorAccount && !packageStarted;
            dto.ProjectComment = projectComment != null ? projectComment.Content : "";
            dto.Editable       = ProjectInfo.IsFlowEditable(projectId, FlowCode.Renewal_Tool);
            dto.Recallable     = ProjectInfo.IsFlowRecallable(projectId, FlowCode.Renewal_Tool);
            dto.Savable        = ProjectInfo.IsFlowSavable(projectId, FlowCode.Renewal_Tool) && string.IsNullOrEmpty(id);
            dto.IsFinished     =
                ProjectInfo.Any(
                    e =>
                    e.ProjectId == projectId && e.FlowCode == FlowCode.Renewal_Tool &&
                    e.Status == ProjectStatus.Finished);
            return(dto);
        }
Ejemplo n.º 29
0
        public void GenerateAttachment()
        {
            var    info             = RenewalInfo.Get(this.ProjectId);
            var    storeInfo        = PrepareStoreInfo(this.ProjectId, info.USCode);
            string templateFileName = string.Concat(SiteFilePath.Template_DIRECTORY, "/", SiteFilePath.RenewalAnalysis_Template);
            string fileName         = HttpContext.Current.Server.MapPath(string.Format("~/UploadFiles/{0}.xlsx", Guid.NewGuid()));
            var    extetion         = Path.GetExtension(fileName);
            var    internalName     = Path.GetFileName(fileName);

            File.Copy(templateFileName, fileName);
            FileInfo fileInfo = new FileInfo(fileName);
            ExcelDataInputDirector excelDirector = new ExcelDataInputDirector(fileInfo, ExcelDataInputType.RenewalAnalysis);
            ExcelInputDTO          excelDto      = new ExcelInputDTO();

            excelDto.USCode             = storeInfo.UsCode;
            excelDto.StoreNameEN        = storeInfo.NameENUS;
            excelDto.StoreNameCN        = storeInfo.NameZHCN;
            excelDto.MinimarketPriority = string.IsNullOrEmpty(storeInfo.MinimarketPriority) ? null : Dictionary.GetDictionary(storeInfo.MinimarketPriority).NameENUS;
            excelDto.TADesrability      = string.IsNullOrEmpty(storeInfo.TADesrability) ? null : Dictionary.GetDictionary(storeInfo.TADesrability).NameENUS;
            excelDto.MMTADescription    = this.MMTADescription;
            excelDto.MajorGenerators    = this.MajorGenerators;
            excelDto.SitePortfolioType  = storeInfo.SitePortfolioType;
            excelDto.SiteRerating       = string.IsNullOrEmpty(storeInfo.SiteRerating) ? null : Dictionary.GetDictionary(storeInfo.SiteRerating).NameENUS;
            excelDto.SiteDescription    = this.SiteDescription;
            excelDto.TADesrabilityNew   = string.IsNullOrEmpty(this.TADesirability) ? null : Dictionary.GetDictionary(this.TADesirability).NameENUS;
            excelDto.MMTADescriptionNew = this.MMTADescriptionNew;
            excelDto.MajorGeneratorsNew = this.MajorGeneratorsNew;
            excelDto.SiteRERatingFuture = string.IsNullOrEmpty(this.SiteRERating) ? null : Dictionary.GetDictionary(this.SiteRERating).NameENUS;
            excelDto.LeasedArea         = storeInfo.LeasedArea;
            excelDto.OperationSize      = storeInfo.OperationSize;
            excelDto.Floors             = storeInfo.Floors;
            excelDto.Seats                 = storeInfo.Seats;
            excelDto.BEType                = storeInfo.BEType;
            excelDto.LeaseTenureAndTerm    = storeInfo.LeaseTenureAndTerm;
            excelDto.FreeRentalPeriod      = storeInfo.FreeRentalPeriod;
            excelDto.RentStructure         = storeInfo.RentStructure;
            excelDto.MFStructure           = this.MFStructure;
            excelDto.LeasedAreaNew         = this.LeasedArea;
            excelDto.OperationSizeNew      = this.OperationSize;
            excelDto.FloorsNew             = this.Floors;
            excelDto.SeatsNew              = this.Seats;
            excelDto.BETypeNew             = this.BEType;
            excelDto.LeaseTenureAndTermNew = this.LeaseTenureAndTerm;
            excelDto.FreeRentalPeriodNew   = this.FreeRentalPeriod;
            excelDto.RentStructureNew      = this.RentStructure;
            excelDto.MFStructureNew        = this.MFStructureNew;
            excelDto.DRMFLastTY            = this.DRMFLastTY;
            excelDto.DRMFLastTYSales       = this.DRMFLastTYSales;
            excelDto.DRMF1stTY             = this.DRMF1stTY;
            excelDto.DRMF1stTYSales        = this.DRMF1stTYSales;
            excelDto.SRMFLastTY            = storeInfo.SRMFLastTY;
            excelDto.SRMFLastTYSales       = storeInfo.SRMFLastTYSales;
            excelDto.SRMF1stTY             = storeInfo.SRMF1stTY;
            excelDto.SRMF1stTYSales        = storeInfo.SRMF1stTYSales;
            excelDto.FairMarketRentAmount  = this.FairMarketRentAmount;
            excelDto.FairMarketRentAgent   = this.FairMarketRentAgent;
            excelDto.DR1stTYAmount         = this.DR1stTYAmount;
            excelDto.AnnualSOILastTY       = this.AnnualSOILastTY;
            excelDto.AnnualSOIAvg          = storeInfo.AnnualSOIAvg;
            excelDto.CashROILastTY         = this.CashROILastTY;
            excelDto.CashROIAvg            = storeInfo.CashROIAvg;
            excelDto.LastRemodeling        = this.LastRemodeling;
            excelDto.OriginalInvestment    = storeInfo.OriginalInvestment;
            excelDto.NBV = storeInfo.NBV;
            excelDto.AdditionalInvestmentCost  = storeInfo.AdditionalInvestmentCost;
            excelDto.ExclusivityClause         = DataConverter.ToYesNo(storeInfo.ExclusivityClause);
            excelDto.McDsEarlyTerminationRight = storeInfo.McDsEarlyTerminationRight;
            excelDto.McDsEPRight                  = this.McDsEPRight;
            excelDto.LandlordEntity               = storeInfo.LandlordEntity;
            excelDto.SpecialClauses               = this.SpecialClauses;
            excelDto.OtherIssues                  = this.OtherIssues;
            excelDto.ExclusivityClauseNew         = this.ExclusivityClauseNew;
            excelDto.McDsEarlyTerminationRightNew = this.McDsEarlyTerminationRightNew;
            excelDto.McDsEPRightNew               = this.McDsEPRightNew;
            excelDto.LandlordEntityNew            = this.LandlordEntityNew;
            excelDto.SpecialClausesNew            = this.SpecialClausesNew;
            excelDto.OtherIssuesNew               = this.OtherIssuesNew;
            excelDto.DecisionLogic                = this.DecisionLogic;
            excelDto.SpecialApprovalRequired      = this.SpecialApprovalRequired;
            excelDirector.Input(excelDto);
            var  att       = Attachment.FirstOrDefault(e => e.RefTableID == this.Id.ToString() && e.TypeCode == "RenewalAnalysis");
            bool hasAttach = true;

            if (att == null)
            {
                hasAttach = false;
                att       = new Attachment();
                att.ID    = Guid.NewGuid();
            }

            att.TypeCode        = "RenewalAnalysis";
            att.RefTableID      = this.Id.ToString();
            att.RefTableName    = "RenewalAnalysis";
            att.Name            = "Renewal Analysis";
            att.Extension       = extetion;
            att.RelativePath    = "/";
            att.InternalName    = internalName;
            att.ContentType     = "application/vnd.ms-excel";
            att.Length          = (int)fileInfo.Length;
            att.CreatorID       = ClientCookie.UserCode;
            att.CreatorNameENUS = ClientCookie.UserNameENUS;
            att.CreatorNameZHCN = ClientCookie.UserNameZHCN;
            att.CreateTime      = DateTime.Now;
            att.RequirementId   = new Guid("06F33F98-76B9-440F-8E8C-9167B4C202B9");
            if (hasAttach)
            {
                att.Update();
            }
            else
            {
                att.Add();
            }
        }
Ejemplo n.º 30
0
        public Dictionary <string, string> GetPrintTemplateFields()
        {
            var project       = ProjectInfo.Get(this.ProjectId, FlowCode.Renewal_Package);
            var storeBasic    = StoreBasicInfo.GetStorInfo(project.USCode);
            var storeContract = StoreContractInfo.Search(c => c.StoreCode == project.USCode).OrderByDescending(c => c.CreatedTime).FirstOrDefault();
            var info          = RenewalInfo.Get(ProjectId);
            var flowInfo      = FlowInfo.Get(FlowCode.Renewal);
            var analysis      = RenewalAnalysis.Get(this.AnalysisId.Value) ?? new RenewalAnalysis();
            var finOutput     = RenewalToolFinMeasureOutput.GetByToolId(this.ToolId.Value);
            Dictionary <string, string> templateFileds = new Dictionary <string, string>();

            templateFileds.Add("WorkflowName", flowInfo.NameENUS);
            templateFileds.Add("ProjectID", ProjectId);
            templateFileds.Add("USCode", storeBasic.StoreCode);
            templateFileds.Add("Region", storeBasic.Region);
            templateFileds.Add("StoreNameEN", storeBasic.NameENUS);
            templateFileds.Add("Market", storeBasic.Market);
            templateFileds.Add("City", storeBasic.CityZHCN);
            templateFileds.Add("StoreNameCN", storeBasic.NameZHCN);
            templateFileds.Add("StoreAge", Math.Floor((DateTime.Now - storeBasic.OpenDate).TotalDays / 365D).ToString());
            templateFileds.Add("OpenDate", storeBasic.OpenDate.ToString("yyyy-MM-dd"));
            templateFileds.Add("CloseDate", storeBasic.CloseDate.HasValue ? (storeBasic.CloseDate.Value.Year != 1900 ? storeBasic.CloseDate.Value.ToString("yyyy-MM-dd") : "") : "");

            if (storeContract != null)
            {
                templateFileds.Add("CurrentLeaseENDYear", storeContract.EndYear);
            }
            else
            {
                templateFileds.Add("CurrentLeaseENDYear", "");
            }

            templateFileds.Add("AssetsManager", info.AssetManagerNameENUS);
            templateFileds.Add("AssetsActor", info.AssetActorNameENUS);
            templateFileds.Add("AssetsRep", info.AssetRepNameENUS);
            templateFileds.Add("NewLeaseENDYear", info.NewLeaseEndDate.HasValue ? info.NewLeaseEndDate.Value.ToString("yyyy") : "");
            templateFileds.Add("ClosureDate", storeBasic.CloseDate.HasValue ? (storeBasic.CloseDate.Value.Year != 1900 ? storeBasic.CloseDate.Value.ToString("yyyy-MM-dd") : "") : "");
            templateFileds.Add("FairMarketRentPerAppraisal", analysis.FairMarketRentAmount.HasValue ? DataConverter.ToMoney(analysis.FairMarketRentAmount.Value) : "");
            templateFileds.Add("LeaseTenureAndTerm", analysis.LeaseTenureAndTerm);
            templateFileds.Add("DR1stTYAmount", analysis.DR1stTYAmount.HasValue ? DataConverter.ToMoney(analysis.DR1stTYAmount.Value) : "");
            templateFileds.Add("FreeRentalPeriod", analysis.FreeRentalPeriod);
            templateFileds.Add("RentDeviation", analysis.RentDeviation.HasValue ? DataConverter.ToPercentage(analysis.RentDeviation.Value.ToString()) : "");
            templateFileds.Add("RentStructureUR", analysis.RentStructure);
            templateFileds.Add("MFStructureUR", analysis.MFStructureNew);
            if (finOutput != null)
            {
                templateFileds.Add("AnnualRentExpenseLY", DataConverter.ToMoney(finOutput.AnnualRentExpenseLY));
                templateFileds.Add("AnnualRentExpenseYr1", DataConverter.ToMoney(finOutput.AnnualRentExpenseLY));
                templateFileds.Add("AnnualRentExpenseAvg", DataConverter.ToMoney(finOutput.AnnualRentExpenseLY));
                templateFileds.Add("RentAsProdSalesLY", DataConverter.ToPercentage(finOutput.RentAsProdSalesLY));
                templateFileds.Add("RentAsProdSalesYr1", DataConverter.ToPercentage(finOutput.RentAsProdSalesYr1));
                templateFileds.Add("RentAsProdSalesAvg", DataConverter.ToPercentage(finOutput.RentAsProdSalesAvg));
                templateFileds.Add("OccupancyProdSalesLY", DataConverter.ToPercentage(finOutput.OccupancyProdSalesLY));
                templateFileds.Add("OccupancyProdSalesYr1", DataConverter.ToPercentage(finOutput.OccupancyProdSalesYr1));
                templateFileds.Add("OccupancyProdSalesAvg", DataConverter.ToPercentage(finOutput.OccupancyProdSalesAvg));
                templateFileds.Add("SOIProdSalesLY", DataConverter.ToPercentage(finOutput.SOIProdSalesLY));
                templateFileds.Add("SOIProdSalesYr1", DataConverter.ToPercentage(finOutput.SOIProdSalesYr1));
                templateFileds.Add("SOIProdSalesAvg", DataConverter.ToPercentage(finOutput.SOIProdSalesAvg));
                templateFileds.Add("CashROILY", DataConverter.ToPercentage(finOutput.CashROILY));
                templateFileds.Add("CashROIYr1", DataConverter.ToPercentage(finOutput.CashROIYr1));
                templateFileds.Add("CashROIAvg", DataConverter.ToPercentage(finOutput.CashROIAvg));
            }
            else
            {
                templateFileds.Add("AnnualRentExpenseLY", "");
                templateFileds.Add("AnnualRentExpenseYr1", "");
                templateFileds.Add("AnnualRentExpenseAvg", "");
                templateFileds.Add("RentAsProdSalesLY", "");
                templateFileds.Add("RentAsProdSalesYr1", "");
                templateFileds.Add("RentAsProdSalesAvg", "");
                templateFileds.Add("OccupancyProdSalesLY", "");
                templateFileds.Add("OccupancyProdSalesYr1", "");
                templateFileds.Add("OccupancyProdSalesAvg", "");
                templateFileds.Add("SOIProdSalesLY", "");
                templateFileds.Add("SOIProdSalesYr1", "");
                templateFileds.Add("SOIProdSalesAvg", "");
                templateFileds.Add("CashROILY", "");
                templateFileds.Add("CashROIYr1", "");
                templateFileds.Add("CashROIAvg", "");
            }

            return(templateFileds);
        }