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); }
public static StoreInfo GetStore(string usCode) { string _USCode = usCode; List <StoreBasicInfo> lsStoreBasicInfo = new List <StoreBasicInfo>(); StoreBasicInfo mStoreBasicInfo = new StoreBasicInfo(); lsStoreBasicInfo = StoreBasicInfo.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking().ToList <StoreBasicInfo>(); if (lsStoreBasicInfo.Count > 0) { mStoreBasicInfo = lsStoreBasicInfo[0]; } List <StoreDevelop> lsStoreDevelop = new List <StoreDevelop>(); StoreDevelop mStoreDevelop = new StoreDevelop(); lsStoreDevelop = StoreDevelop.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking().ToList <StoreDevelop>(); if (lsStoreDevelop.Count > 0) { mStoreDevelop = lsStoreDevelop[0]; } List <StoreOps> lsStoreOp = new List <StoreOps>(); StoreOps mStoreOp = new StoreOps(); lsStoreOp = StoreOps.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking().ToList <StoreOps>(); if (lsStoreOp.Count > 0) { mStoreOp = lsStoreOp[0]; } List <StoreContractInfo> lsStoreContractInfo = new List <StoreContractInfo>(); StoreContractInfo mStoreContractInfo = new StoreContractInfo(); lsStoreContractInfo = StoreContractInfo.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking() .OrderByDescending(o => o.CreatedTime).ToList <StoreContractInfo>(); if (lsStoreContractInfo.Count > 0) { mStoreContractInfo = lsStoreContractInfo[0]; } List <StoreSTLocation> lsStoreSTLocation = new List <StoreSTLocation>(); StoreSTLocation mStoreSTLocation = new StoreSTLocation(); lsStoreSTLocation = StoreSTLocation.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking().ToList <StoreSTLocation>(); if (lsStoreSTLocation.Count > 0) { mStoreSTLocation = lsStoreSTLocation[0]; } List <StoreSTLLRecord> lsStoreSTLLRecord = new List <StoreSTLLRecord>(); StoreSTLLRecord mStoreSTLLRecord = new StoreSTLLRecord(); lsStoreSTLLRecord = StoreSTLLRecord.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking().ToList <StoreSTLLRecord>(); if (lsStoreSTLLRecord.Count > 0) { mStoreSTLLRecord = lsStoreSTLLRecord[0]; } int?beId = StoreBEInfo.Search(o => o.StoreCode.Contains(_USCode)).AsNoTracking().Select(be => be.BEID).FirstOrDefault(); StoreBEContractInfo storeBeContractInfo = StoreBEContractInfo.FirstOrDefault(c => c.BEID == beId); //StoreContractRevision = new StoreContractRevision(), // StoreContractInfoAttached = new StoreContractInfoAttached() var lsStoreBEInfo = StoreBEInfo.Search(o => o.StoreCode == _USCode).AsNoTracking().ToList <StoreBEInfo>(); List <StoreBEInfo> remoteBeList = new List <StoreBEInfo>(); List <StoreBEInfo> attachedBeList = new List <StoreBEInfo>(); List <StoreBEInfo> mdsList = new List <StoreBEInfo>(); List <StoreBEInfo> mcCafeList = new List <StoreBEInfo>(); List <StoreBEInfo> hour24List = new List <StoreBEInfo>(); if (lsStoreBEInfo.Count > 0) { foreach (var beInfo in lsStoreBEInfo) { switch (beInfo.BETypeName) { case "Remote Kiosk": remoteBeList.Add(beInfo); break; case "Attached Kiosk": attachedBeList.Add(beInfo); break; case "MDS": mdsList.Add(beInfo); break; case "McCafe": mcCafeList.Add(beInfo); break; case "24 Hour": hour24List.Add(beInfo); break; } } } var resultStoreAllInfo = new StoreInfo { StoreBasicInfo = mStoreBasicInfo, StoreDevelop = mStoreDevelop, StoreOp = mStoreOp, StoreContractInfo = mStoreContractInfo, StoreSTLocation = mStoreSTLocation, StoreSTLLRecord = mStoreSTLLRecord, StoreBeContractInfo = storeBeContractInfo, StoreBEInfoList = lsStoreBEInfo, CurrentYear = DateTime.Now.Year, RemoteBeCount = remoteBeList.Count, AttachedBeCount = attachedBeList.Count, MDSBeCount = mdsList.Count, MCCafeCount = mcCafeList.Count, Hour24Count = hour24List.Count }; return(resultStoreAllInfo); }
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> </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> </td><td> </td><td> </td><td> </td><td> </td><td> </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); }