namespace OSS.Migrations { using System; using System.Data.Entity.Migrations; public partial class my_mygration : DbMigration { public override void Up() { CreateTable( "dbo.ApplicationManagers", c => new { ApplicationID = c.Long(nullable: false, identity: true), CompanyName = c.String(), ProjectName = c.String(), Comments = c.String(), CompanyTIN = c.String(maxLength: 40), ProjectCode = c.String(), EvaluationStatus = c.String(), MobileNo = c.String(), FullName = c.String(), InvoiceID = c.Long(), Station = c.String(), Currency = c.String(), GePGComment = c.String(), StartDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), Expiredate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), Amount = c.Decimal(nullable: false, precision: 18, scale: 2), ControlNo = c.String(), UpdatedDate = c.DateTime(precision: 7, storeType: "datetime2"), PaymentStatus = c.String(), CompanyEmail = c.String(maxLength: 40), ReceiptNo = c.String(), PayedDate = c.DateTime(precision: 7, storeType: "datetime2"), CertificateNo = c.String(), ServiceName = c.String(), }) .PrimaryKey(t => t.ApplicationID) .ForeignKey("dbo.CompanyProfileExternals", t => t.CompanyTIN) .ForeignKey("dbo.InvestorProfileExternals", t => t.CompanyEmail) .Index(t => t.CompanyTIN) .Index(t => t.CompanyEmail); CreateTable( "dbo.CompanyProfileExternals", c => new { CompanyTIN = c.String(nullable: false, maxLength: 40), CompanyID = c.Int(nullable: false, identity: true), CompanyName = c.String(nullable: false, maxLength: 50), CompanyEmail = c.String(nullable: false), StepName = c.String(), LandMarkType = c.String(), PlotNumber = c.String(), HouseNo = c.String(), Area = c.String(), LandMarkDescription = c.String(), Street = c.String(), Ward = c.String(), ReportingStatus = c.String(), StrategicInvestor = c.Boolean(nullable: false), Telephone = c.String(nullable: false), Category = c.String(), PostalAddress = c.String(nullable: false), BlockPlotNumber = c.String(maxLength: 255), PhysicalAddress = c.String(maxLength: 255), CompanyCode = c.String(maxLength: 255), Latitude = c.Single(nullable: false), longitude = c.Single(nullable: false), CompanyMobile = c.String(), CompanyType = c.String(maxLength: 255), Region = c.String(nullable: false, maxLength: 255), District = c.String(nullable: false, maxLength: 255), AddedBy = c.String(), OperatingStatus = c.String(maxLength: 255), IncorpCertNo = c.String(), AreaType = c.String(), CleaningStatus = c.String(), IncorpCertDate = c.DateTime(precision: 7, storeType: "datetime2"), LastLoginDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedBy = c.String(), }) .PrimaryKey(t => t.CompanyTIN) .ForeignKey("dbo.InvestorProfileExternals", t => t.CompanyTIN) .Index(t => t.CompanyTIN); CreateTable( "dbo.InvestorProfileExternals", c => new { CompanyEmail = c.String(nullable: false, maxLength: 40), NIDAOrPassport = c.String(), Nationality = c.String(), AlternativeEmail = c.String(maxLength: 40), InvestorID = c.Int(nullable: false, identity: true), CompanyTIN = c.String(), FirstName = c.String(nullable: false, maxLength: 15), MiddleName = c.String(maxLength: 15), LastName = c.String(nullable: false, maxLength: 15), CompanyName = c.String(), LoginPassword = c.String(nullable: false), Mobile = c.String(nullable: false, maxLength: 10), Position = c.String(), Status = c.Boolean(nullable: false), VerificationStatus = c.String(), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.CompanyEmail); CreateTable( "dbo.Attachments", c => new { AttachmentID = c.Int(nullable: false, identity: true), AttachmentName = c.String(), AttachmentPath = c.String(), ProjectCode = c.String(), UploadedBy = c.String(), UploadedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.AttachmentID); CreateTable( "dbo.CompanyAmmendments", c => new { AmendmentID = c.Int(nullable: false, identity: true), CompanyTIN = c.String(nullable: false), ProjectID = c.Long(nullable: false), ChangeofCompanyName = c.Boolean(nullable: false), ProjectName = c.String(), ProjectCode = c.String(), ChangeofMajorityShare = c.Boolean(nullable: false), ChangeOfAddress = c.Boolean(nullable: false), ChangeOfLocation = c.Boolean(nullable: false), ChangeofShareholders = c.Boolean(nullable: false), ChangeofImplementationPeriod = c.Boolean(nullable: false), LostCertificate = c.Boolean(nullable: false), CancellingProject = c.Boolean(nullable: false), ReIssueCertificate = c.Boolean(nullable: false), ProcessingStatus = c.String(), CurrentlyWith = c.String(), ApprovalStatus = c.String(), CompanyName = c.String(), ApprovedBy = c.String(), UpdatedBy = c.String(), LoadgeBy = c.String(), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), ApprovedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CertificateNo = c.String(), IssuedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), EvaluationDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.AmendmentID); CreateTable( "dbo.CompanyAmmendmentExternals", c => new { AmendmentID = c.Int(nullable: false, identity: true), CompanyTIN = c.String(nullable: false), AssignedStatus = c.String(), AssignedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), AssignedTo = c.String(), PVVCommentOfficer = c.String(), PVVCommentDIF = c.String(), PVVCommentEXD = c.String(), PVVReportingDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), DefferedReason = c.String(), ProjectCode = c.String(), ProjectName = c.String(), ProjectID = c.Long(nullable: false), ChangeofCompanyName = c.Boolean(nullable: false), ChangeofMajorityShare = c.Boolean(nullable: false), ChangeOfAddress = c.Boolean(nullable: false), ChangeOfLocation = c.Boolean(nullable: false), ChangeofShareholders = c.Boolean(nullable: false), ChangeofImplementationPeriod = c.Boolean(nullable: false), LostCertificate = c.Boolean(nullable: false), CancellingProject = c.Boolean(nullable: false), ReIssueCertificate = c.Boolean(nullable: false), ApprovalStatus = c.String(), Reason = c.String(), CompanyName = c.String(), ApprovedBy = c.String(), UpdatedBy = c.String(), CertificateNo = c.String(), LoadgeBy = c.String(), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), ApprovedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), IssuedDate = c.DateTime(precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.AmendmentID); CreateTable( "dbo.CompanyShareholderExternals", c => new { ShareholderID = c.Int(nullable: false, identity: true), CompanyTIN = c.String(nullable: false, maxLength: 40), FirstName = c.String(nullable: false, maxLength: 255), MiddleName = c.String(), LastName = c.String(nullable: false), ShareStatus = c.String(), Country = c.String(nullable: false), CategoryofShares = c.String(), TypeofShare = c.String(), SharePercent = c.Single(nullable: false), NIDAorPassport = c.String(), AddedBy = c.String(), UpdatedBy = c.String(), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.ShareholderID) .ForeignKey("dbo.CompanyProfileExternals", t => t.CompanyTIN, cascadeDelete: true) .Index(t => t.CompanyTIN); CreateTable( "dbo.Countries", c => new { CountryID = c.Int(nullable: false, identity: true), CountryName = c.String(), CountryValue = c.String(), }) .PrimaryKey(t => t.CountryID); CreateTable( "dbo.CountryInvestments", c => new { CountryInvestmentID = c.Long(nullable: false, identity: true), ShareholderID = c.Int(nullable: false), CompanyTIN = c.String(nullable: false), ProjectID = c.Long(nullable: false), CategoryofShares = c.String(), FirstName = c.String(nullable: false, maxLength: 255), CompanyName = c.String(), ShareStatus = c.String(), LastName = c.String(nullable: false), Country = c.String(nullable: false), TypeofShare = c.String(), Region = c.String(), District = c.String(), ProjectName = c.String(), MajorityShare = c.String(), SharePercent = c.Double(nullable: false), ShareCapital = c.Double(nullable: false), ShareJob = c.Double(nullable: false), NIDAorPassport = c.String(), ReportingStatus = c.String(), Sector = c.String(), SubSector = c.String(), Activity = c.String(), RegisteredDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), ApprovedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), AddedBy = c.String(), UpdatedBy = c.String(), ApprovedBy = c.String(), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.CountryInvestmentID) .ForeignKey("dbo.ProjectProfileExternals", t => t.ProjectID, cascadeDelete: true) .Index(t => t.ProjectID); CreateTable( "dbo.ProjectProfileExternals", c => new { ProjectID = c.Long(nullable: false, identity: true), ProjectCode = c.String(), ProjectName = c.String(nullable: false), CompanyTIN = c.String(), MainActivity = c.String(), ProductionCapacity = c.String(), CompanyName = c.String(maxLength: 255), ContactEmail = c.String(nullable: false), StepName = c.String(), ServiceName = c.String(), LandMarkType = c.String(), PlotNumber = c.String(), HouseNo = c.String(), Area = c.String(), LandMarkDescription = c.String(), Ward = c.String(), Street = c.String(), Sector = c.String(), SubSector = c.String(), UnitMeasure = c.String(), TypeofOwnership = c.String(), MenForeign = c.Long(nullable: false), WomenForeign = c.Long(nullable: false), MenLocal = c.Long(nullable: false), WomenLocal = c.Long(nullable: false), Telephone = c.String(nullable: false), PostalAddress = c.String(), BlockPlotNumber = c.String(maxLength: 255), ContactMobile = c.String(maxLength: 255), CompanyType = c.String(maxLength: 255), Region = c.String(nullable: false, maxLength: 255), District = c.String(nullable: false, maxLength: 255), AddedBy = c.String(), TICCertificateNo = c.String(), OriginalCOI = c.String(), IssuedDate = c.String(), ContactPerson = c.String(), Title = c.String(), Mobile = c.String(), Email = c.String(), AreaType = c.String(), ApprovalStatus = c.String(), EvaluationStatus = c.String(), LastUpdateDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedBy = c.String(), }) .PrimaryKey(t => t.ProjectID); CreateTable( "dbo.DefferementHistories", c => new { DefferedD = c.Int(nullable: false, identity: true), ProjectCode = c.String(nullable: false), ProjectID = c.Long(nullable: false), DIFMsg = c.String(), InvestorMsg = c.String(), AddedBy = c.String(), UpdatedBy = c.String(), CompanyName = c.String(), ProjectName = c.String(), ServiceName = c.String(), ApplicationID = c.Long(nullable: false), CreatedBy = c.String(), ApprovedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), }) .PrimaryKey(t => t.DefferedD); CreateTable( "dbo.Districts", c => new { DistrictCode = c.String(nullable: false, maxLength: 128), DistrictID = c.Long(nullable: false, identity: true), RegionCode = c.String(nullable: false, maxLength: 128), DistrictName = c.String(nullable: false), RegionName = c.String(), }) .PrimaryKey(t => t.DistrictCode) .ForeignKey("dbo.Regions", t => t.RegionCode, cascadeDelete: true) .Index(t => t.RegionCode); CreateTable( "dbo.Regions", c => new { RegionCode = c.String(nullable: false, maxLength: 128), RegionID = c.Long(nullable: false, identity: true), RegionName = c.String(), }) .PrimaryKey(t => t.RegionCode); CreateTable( "dbo.FinancingProfileExternals", c => new { FinancingID = c.Int(nullable: false, identity: true), ProjectID = c.Long(nullable: false), CompanyTIN = c.String(nullable: false), ProjectCode = c.String(), StepName = c.String(), AddedBy = c.String(), SourceCountryLoan = c.String(), SourceCountryEquity = c.String(), TypeofApp = c.String(), FixedAsset = c.Double(nullable: false), WorkingCapital = c.Double(nullable: false), TotalDDI = c.Double(nullable: false), LocalEquity = c.Double(nullable: false), LocalLoan = c.Double(nullable: false), UpdatedBy = c.String(), CreatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), ForeignEquity = c.Double(nullable: false), ForeignLoan = c.Double(nullable: false), MTotalFDI = c.Double(nullable: false), TotalForeign = c.Double(nullable: false), TotalLocal = c.Double(nullable: false), TotalCapital = c.Double(nullable: false), MFixedAsset = c.Double(nullable: false), MWorkingCapital = c.Double(nullable: false), Jobs = c.Long(nullable: false), MInvestmentBreakDown = c.Double(nullable: false), TotalFDI = c.Double(nullable: false), MTotalDDI = c.Double(nullable: false), MLocalEquity = c.Double(nullable: false), MLocalLoan = c.Double(nullable: false), MForeignEquity = c.Double(nullable: false), MForeignLoan = c.Double(nullable: false), MTotalForeign = c.Double(nullable: false), MTotalLocal = c.Double(nullable: false), MTotalCapital = c.Double(nullable: false), }) .PrimaryKey(t => t.FinancingID); CreateTable( "dbo.ProjectProfiles", c => new { ProjectID = c.Long(nullable: false, identity: true), ProjectCode = c.String(), ProjectName = c.String(nullable: false), CompanyTIN = c.String(nullable: false), RegionName = c.String(nullable: false), WardName = c.String(), AreaType = c.String(), Unsurveyedaddress = c.String(), HouseNo = c.String(), Road = c.String(), LoanConditions = c.String(), Location = c.String(nullable: false), CompanyName = c.String(), ZonalName = c.String(), DistrictName = c.String(nullable: false), ExpansionNo = c.String(), OriginalCOI = c.String(), SerialNumber = c.String(), TotalCapital = c.Double(), Jobs = c.Long(nullable: false), MenLocal = c.Long(nullable: false), TotalEmploymentLocal = c.Long(nullable: false), TotalEmploymentForeign = c.Long(nullable: false), WomenLocal = c.Long(nullable: false), MenForeign = c.Long(nullable: false), WomenForeign = c.Long(nullable: false), ApprovedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), LastExpansionDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), LodgedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), TypeofApplication = c.String(nullable: false, maxLength: 255), Email = c.String(nullable: false), latitude = c.Single(), longitude = c.Single(), ProcessingStatus = c.String(nullable: false), CurrentlyWith = c.String(), ApprovedStatus = c.String(), ApprovedBy = c.String(), Telephone = c.String(nullable: false), Address = c.String(), Mobile = c.String(nullable: false), SectorIcon = c.String(), BlockNumber = c.String(maxLength: 255), PlotNumber = c.String(maxLength: 255), PhysicalAddress = c.String(nullable: false, maxLength: 255), SubSector = c.String(nullable: false, maxLength: 255), Street = c.String(nullable: false, maxLength: 255), ProductionCapacity = c.String(nullable: false, maxLength: 255), Sector = c.String(nullable: false, maxLength: 255), ContactPerson = c.String(nullable: false, maxLength: 255), Position = c.String(nullable: false, maxLength: 255), AmendmentSection = c.String(), MajorityShare = c.String(nullable: false), StrategicInvestor = c.String(), CleaningStatus = c.String(), PrintingStatus = c.String(), PrintingStatusAmendment = c.String(), PrintedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), PrintedDateAmendment = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), AmendmentStatus = c.String(), Conditions = c.String(), PrintedBy = c.String(), PrintedByAmendment = c.String(), ReportingStatus = c.String(), PostalAddress = c.String(), UpdatedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), OperativeDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), UpdatedBy = c.String(), VerifiedBy = c.String(), VerifiedDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CleaningComment = c.String(), ReportingComent = c.String(), LandMarkType = c.String(), Area = c.String(), LandMarkDescription = c.String(), ReportingApprovedBy = c.String(), Activity = c.String(nullable: false), LodgedBy = c.String(nullable: false, maxLength: 255), ImplementationStartDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), ImplementationEndDate = c.DateTime(nullable: false, precision: 7, storeType: "datetime2"), CertificateOfIncentiveNo = c.String(maxLength: 255), FileNo = c.String(), }) .PrimaryKey(t => t.ProjectID); CreateTable( "dbo.Sectors", c => new { SectorID = c.Int(nullable: false, identity: true), SectorName = c.String(), }) .PrimaryKey(t => t.SectorID); CreateTable( "dbo.StepsManagements", c => new { StepID = c.Int(nullable: false, identity: true), CompanyName = c.String(nullable: false), CompanyTIN = c.String(maxLength: 40), ProjectCode = c.String(maxLength: 255), CompanyEmail = c.String(maxLength: 40), ApplicationType = c.String(), StepNo = c.String(), CreatedDate = c.DateTime(nullable: false), UpdatedDate = c.DateTime(nullable: false), SubmittedStatus = c.String(), EvaluationStatus = c.String(), }) .PrimaryKey(t => t.StepID) .ForeignKey("dbo.CompanyProfileExternals", t => t.CompanyTIN) .ForeignKey("dbo.InvestorProfileExternals", t => t.CompanyEmail) .Index(t => t.CompanyTIN) .Index(t => t.CompanyEmail); CreateTable( "dbo.SubSectors", c => new { SubSectorID = c.Int(nullable: false, identity: true), SubSectorName = c.String(), SectorName = c.String(), }) .PrimaryKey(t => t.SubSectorID); CreateTable( "dbo.Wards", c => new { WardID = c.Long(nullable: false, identity: true), DistrictCode = c.String(nullable: false, maxLength: 128), WardName = c.String(nullable: false), DistrictName = c.String(), }) .PrimaryKey(t => t.WardID) .ForeignKey("dbo.Districts", t => t.DistrictCode, cascadeDelete: true) .Index(t => t.DistrictCode); CreateStoredProcedure( "dbo.Add_Application", p => new { CompanyName = p.String(), ProjectName = p.String(), Comments = p.String(), CompanyTIN = p.String(maxLength: 40), ProjectCode = p.String(), EvaluationStatus = p.String(), MobileNo = p.String(), FullName = p.String(), InvoiceID = p.Long(), Station = p.String(), Currency = p.String(), GePGComment = p.String(), StartDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), Expiredate = p.DateTime(storeType: "datetime2"), Amount = p.Decimal(precision: 18, scale: 2), ControlNo = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), PaymentStatus = p.String(), CompanyEmail = p.String(maxLength: 40), ReceiptNo = p.String(), PayedDate = p.DateTime(storeType: "datetime2"), CertificateNo = p.String(), ServiceName = p.String(), }, body: @"INSERT [dbo].[ApplicationManagers]([CompanyName], [ProjectName], [Comments], [CompanyTIN], [ProjectCode], [EvaluationStatus], [MobileNo], [FullName], [InvoiceID], [Station], [Currency], [GePGComment], [StartDate], [CreatedDate], [Expiredate], [Amount], [ControlNo], [UpdatedDate], [PaymentStatus], [CompanyEmail], [ReceiptNo], [PayedDate], [CertificateNo], [ServiceName]) VALUES (@CompanyName, @ProjectName, @Comments, @CompanyTIN, @ProjectCode, @EvaluationStatus, @MobileNo, @FullName, @InvoiceID, @Station, @Currency, @GePGComment, @StartDate, @CreatedDate, @Expiredate, @Amount, @ControlNo, @UpdatedDate, @PaymentStatus, @CompanyEmail, @ReceiptNo, @PayedDate, @CertificateNo, @ServiceName) DECLARE @ApplicationID bigint SELECT @ApplicationID = [ApplicationID] FROM [dbo].[ApplicationManagers] WHERE @@ROWCOUNT > 0 AND [ApplicationID] = scope_identity() SELECT t0.[ApplicationID] FROM [dbo].[ApplicationManagers] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[ApplicationID] = @ApplicationID" ); CreateStoredProcedure( "dbo.Update_Application", p => new { ApplicationID = p.Long(), CompanyName = p.String(), ProjectName = p.String(), Comments = p.String(), CompanyTIN = p.String(maxLength: 40), ProjectCode = p.String(), EvaluationStatus = p.String(), MobileNo = p.String(), FullName = p.String(), InvoiceID = p.Long(), Station = p.String(), Currency = p.String(), GePGComment = p.String(), StartDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), Expiredate = p.DateTime(storeType: "datetime2"), Amount = p.Decimal(precision: 18, scale: 2), ControlNo = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), PaymentStatus = p.String(), CompanyEmail = p.String(maxLength: 40), ReceiptNo = p.String(), PayedDate = p.DateTime(storeType: "datetime2"), CertificateNo = p.String(), ServiceName = p.String(), }, body: @"UPDATE [dbo].[ApplicationManagers] SET [CompanyName] = @CompanyName, [ProjectName] = @ProjectName, [Comments] = @Comments, [CompanyTIN] = @CompanyTIN, [ProjectCode] = @ProjectCode, [EvaluationStatus] = @EvaluationStatus, [MobileNo] = @MobileNo, [FullName] = @FullName, [InvoiceID] = @InvoiceID, [Station] = @Station, [Currency] = @Currency, [GePGComment] = @GePGComment, [StartDate] = @StartDate, [CreatedDate] = @CreatedDate, [Expiredate] = @Expiredate, [Amount] = @Amount, [ControlNo] = @ControlNo, [UpdatedDate] = @UpdatedDate, [PaymentStatus] = @PaymentStatus, [CompanyEmail] = @CompanyEmail, [ReceiptNo] = @ReceiptNo, [PayedDate] = @PayedDate, [CertificateNo] = @CertificateNo, [ServiceName] = @ServiceName WHERE ([ApplicationID] = @ApplicationID)" ); CreateStoredProcedure( "dbo.ApplicationManager_Delete", p => new { ApplicationID = p.Long(), }, body: @"DELETE [dbo].[ApplicationManagers] WHERE ([ApplicationID] = @ApplicationID)" ); CreateStoredProcedure( "dbo.Add_CompanyProfileExternal", p => new { CompanyTIN = p.String(maxLength: 40), CompanyName = p.String(maxLength: 50), CompanyEmail = p.String(), StepName = p.String(), LandMarkType = p.String(), PlotNumber = p.String(), HouseNo = p.String(), Area = p.String(), LandMarkDescription = p.String(), Street = p.String(), Ward = p.String(), ReportingStatus = p.String(), StrategicInvestor = p.Boolean(), Telephone = p.String(), Category = p.String(), PostalAddress = p.String(), BlockPlotNumber = p.String(maxLength: 255), PhysicalAddress = p.String(maxLength: 255), CompanyCode = p.String(maxLength: 255), Latitude = p.Single(), longitude = p.Single(), CompanyMobile = p.String(), CompanyType = p.String(maxLength: 255), Region = p.String(maxLength: 255), District = p.String(maxLength: 255), AddedBy = p.String(), OperatingStatus = p.String(maxLength: 255), IncorpCertNo = p.String(), AreaType = p.String(), CleaningStatus = p.String(), IncorpCertDate = p.DateTime(storeType: "datetime2"), LastLoginDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedBy = p.String(), }, body: @"INSERT [dbo].[CompanyProfileExternals]([CompanyTIN], [CompanyName], [CompanyEmail], [StepName], [LandMarkType], [PlotNumber], [HouseNo], [Area], [LandMarkDescription], [Street], [Ward], [ReportingStatus], [StrategicInvestor], [Telephone], [Category], [PostalAddress], [BlockPlotNumber], [PhysicalAddress], [CompanyCode], [Latitude], [longitude], [CompanyMobile], [CompanyType], [Region], [District], [AddedBy], [OperatingStatus], [IncorpCertNo], [AreaType], [CleaningStatus], [IncorpCertDate], [LastLoginDate], [CreatedDate], [UpdatedBy]) VALUES (@CompanyTIN, @CompanyName, @CompanyEmail, @StepName, @LandMarkType, @PlotNumber, @HouseNo, @Area, @LandMarkDescription, @Street, @Ward, @ReportingStatus, @StrategicInvestor, @Telephone, @Category, @PostalAddress, @BlockPlotNumber, @PhysicalAddress, @CompanyCode, @Latitude, @longitude, @CompanyMobile, @CompanyType, @Region, @District, @AddedBy, @OperatingStatus, @IncorpCertNo, @AreaType, @CleaningStatus, @IncorpCertDate, @LastLoginDate, @CreatedDate, @UpdatedBy) SELECT t0.[CompanyID] FROM [dbo].[CompanyProfileExternals] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[CompanyTIN] = @CompanyTIN" ); CreateStoredProcedure( "dbo.Update_CompanyProfileExternal", p => new { CompanyTIN = p.String(maxLength: 40), CompanyID = p.Int(), CompanyName = p.String(maxLength: 50), CompanyEmail = p.String(), StepName = p.String(), LandMarkType = p.String(), PlotNumber = p.String(), HouseNo = p.String(), Area = p.String(), LandMarkDescription = p.String(), Street = p.String(), Ward = p.String(), ReportingStatus = p.String(), StrategicInvestor = p.Boolean(), Telephone = p.String(), Category = p.String(), PostalAddress = p.String(), BlockPlotNumber = p.String(maxLength: 255), PhysicalAddress = p.String(maxLength: 255), CompanyCode = p.String(maxLength: 255), Latitude = p.Single(), longitude = p.Single(), CompanyMobile = p.String(), CompanyType = p.String(maxLength: 255), Region = p.String(maxLength: 255), District = p.String(maxLength: 255), AddedBy = p.String(), OperatingStatus = p.String(maxLength: 255), IncorpCertNo = p.String(), AreaType = p.String(), CleaningStatus = p.String(), IncorpCertDate = p.DateTime(storeType: "datetime2"), LastLoginDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedBy = p.String(), }, body: @"UPDATE [dbo].[CompanyProfileExternals] SET [CompanyName] = @CompanyName, [CompanyEmail] = @CompanyEmail, [StepName] = @StepName, [LandMarkType] = @LandMarkType, [PlotNumber] = @PlotNumber, [HouseNo] = @HouseNo, [Area] = @Area, [LandMarkDescription] = @LandMarkDescription, [Street] = @Street, [Ward] = @Ward, [ReportingStatus] = @ReportingStatus, [StrategicInvestor] = @StrategicInvestor, [Telephone] = @Telephone, [Category] = @Category, [PostalAddress] = @PostalAddress, [BlockPlotNumber] = @BlockPlotNumber, [PhysicalAddress] = @PhysicalAddress, [CompanyCode] = @CompanyCode, [Latitude] = @Latitude, [longitude] = @longitude, [CompanyMobile] = @CompanyMobile, [CompanyType] = @CompanyType, [Region] = @Region, [District] = @District, [AddedBy] = @AddedBy, [OperatingStatus] = @OperatingStatus, [IncorpCertNo] = @IncorpCertNo, [AreaType] = @AreaType, [CleaningStatus] = @CleaningStatus, [IncorpCertDate] = @IncorpCertDate, [LastLoginDate] = @LastLoginDate, [CreatedDate] = @CreatedDate, [UpdatedBy] = @UpdatedBy WHERE ([CompanyTIN] = @CompanyTIN)" ); CreateStoredProcedure( "dbo.CompanyProfileExternal_Delete", p => new { CompanyTIN = p.String(maxLength: 40), }, body: @"DELETE [dbo].[CompanyProfileExternals] WHERE ([CompanyTIN] = @CompanyTIN)" ); CreateStoredProcedure( "dbo.Add_InvestorProfileExternal", p => new { CompanyEmail = p.String(maxLength: 40), NIDAOrPassport = p.String(), Nationality = p.String(), AlternativeEmail = p.String(maxLength: 40), CompanyTIN = p.String(), FirstName = p.String(maxLength: 15), MiddleName = p.String(maxLength: 15), LastName = p.String(maxLength: 15), CompanyName = p.String(), LoginPassword = p.String(), Mobile = p.String(maxLength: 10), Position = p.String(), Status = p.Boolean(), VerificationStatus = p.String(), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedDate = p.DateTime(storeType: "datetime2"), }, body: @"INSERT [dbo].[InvestorProfileExternals]([CompanyEmail], [NIDAOrPassport], [Nationality], [AlternativeEmail], [CompanyTIN], [FirstName], [MiddleName], [LastName], [CompanyName], [LoginPassword], [Mobile], [Position], [Status], [VerificationStatus], [CreatedDate], [UpdatedDate]) VALUES (@CompanyEmail, @NIDAOrPassport, @Nationality, @AlternativeEmail, @CompanyTIN, @FirstName, @MiddleName, @LastName, @CompanyName, @LoginPassword, @Mobile, @Position, @Status, @VerificationStatus, @CreatedDate, @UpdatedDate) SELECT t0.[InvestorID] FROM [dbo].[InvestorProfileExternals] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[CompanyEmail] = @CompanyEmail" ); CreateStoredProcedure( "dbo.Update_InvestorProfilexternal", p => new { CompanyEmail = p.String(maxLength: 40), NIDAOrPassport = p.String(), Nationality = p.String(), AlternativeEmail = p.String(maxLength: 40), InvestorID = p.Int(), CompanyTIN = p.String(), FirstName = p.String(maxLength: 15), MiddleName = p.String(maxLength: 15), LastName = p.String(maxLength: 15), CompanyName = p.String(), LoginPassword = p.String(), Mobile = p.String(maxLength: 10), Position = p.String(), Status = p.Boolean(), VerificationStatus = p.String(), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedDate = p.DateTime(storeType: "datetime2"), }, body: @"UPDATE [dbo].[InvestorProfileExternals] SET [NIDAOrPassport] = @NIDAOrPassport, [Nationality] = @Nationality, [AlternativeEmail] = @AlternativeEmail, [CompanyTIN] = @CompanyTIN, [FirstName] = @FirstName, [MiddleName] = @MiddleName, [LastName] = @LastName, [CompanyName] = @CompanyName, [LoginPassword] = @LoginPassword, [Mobile] = @Mobile, [Position] = @Position, [Status] = @Status, [VerificationStatus] = @VerificationStatus, [CreatedDate] = @CreatedDate, [UpdatedDate] = @UpdatedDate WHERE ([CompanyEmail] = @CompanyEmail)" ); CreateStoredProcedure( "dbo.InvestorProfileExternal_Delete", p => new { CompanyEmail = p.String(maxLength: 40), }, body: @"DELETE [dbo].[InvestorProfileExternals] WHERE ([CompanyEmail] = @CompanyEmail)" ); CreateStoredProcedure( "dbo.Add_Attachments", p => new { AttachmentName = p.String(), AttachmentPath = p.String(), ProjectCode = p.String(), UploadedBy = p.String(), UploadedDate = p.DateTime(storeType: "datetime2"), }, body: @"INSERT [dbo].[Attachments]([AttachmentName], [AttachmentPath], [ProjectCode], [UploadedBy], [UploadedDate]) VALUES (@AttachmentName, @AttachmentPath, @ProjectCode, @UploadedBy, @UploadedDate) DECLARE @AttachmentID int SELECT @AttachmentID = [AttachmentID] FROM [dbo].[Attachments] WHERE @@ROWCOUNT > 0 AND [AttachmentID] = scope_identity() SELECT t0.[AttachmentID] FROM [dbo].[Attachments] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[AttachmentID] = @AttachmentID" ); CreateStoredProcedure( "dbo.Update_Attachments", p => new { AttachmentID = p.Int(), AttachmentName = p.String(), AttachmentPath = p.String(), ProjectCode = p.String(), UploadedBy = p.String(), UploadedDate = p.DateTime(storeType: "datetime2"), }, body: @"UPDATE [dbo].[Attachments] SET [AttachmentName] = @AttachmentName, [AttachmentPath] = @AttachmentPath, [ProjectCode] = @ProjectCode, [UploadedBy] = @UploadedBy, [UploadedDate] = @UploadedDate WHERE ([AttachmentID] = @AttachmentID)" ); CreateStoredProcedure( "dbo.Attachments_Delete", p => new { AttachmentID = p.Int(), }, body: @"DELETE [dbo].[Attachments] WHERE ([AttachmentID] = @AttachmentID)" ); CreateStoredProcedure( "dbo.Add_CompanyAmmendment", p => new { CompanyTIN = p.String(), ProjectID = p.Long(), ChangeofCompanyName = p.Boolean(), ProjectName = p.String(), ProjectCode = p.String(), ChangeofMajorityShare = p.Boolean(), ChangeOfAddress = p.Boolean(), ChangeOfLocation = p.Boolean(), ChangeofShareholders = p.Boolean(), ChangeofImplementationPeriod = p.Boolean(), LostCertificate = p.Boolean(), CancellingProject = p.Boolean(), ReIssueCertificate = p.Boolean(), ProcessingStatus = p.String(), CurrentlyWith = p.String(), ApprovalStatus = p.String(), CompanyName = p.String(), ApprovedBy = p.String(), UpdatedBy = p.String(), LoadgeBy = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), ApprovedDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), CertificateNo = p.String(), IssuedDate = p.DateTime(storeType: "datetime2"), EvaluationDate = p.DateTime(storeType: "datetime2"), }, body: @"INSERT [dbo].[CompanyAmmendments]([CompanyTIN], [ProjectID], [ChangeofCompanyName], [ProjectName], [ProjectCode], [ChangeofMajorityShare], [ChangeOfAddress], [ChangeOfLocation], [ChangeofShareholders], [ChangeofImplementationPeriod], [LostCertificate], [CancellingProject], [ReIssueCertificate], [ProcessingStatus], [CurrentlyWith], [ApprovalStatus], [CompanyName], [ApprovedBy], [UpdatedBy], [LoadgeBy], [UpdatedDate], [ApprovedDate], [CreatedDate], [CertificateNo], [IssuedDate], [EvaluationDate]) VALUES (@CompanyTIN, @ProjectID, @ChangeofCompanyName, @ProjectName, @ProjectCode, @ChangeofMajorityShare, @ChangeOfAddress, @ChangeOfLocation, @ChangeofShareholders, @ChangeofImplementationPeriod, @LostCertificate, @CancellingProject, @ReIssueCertificate, @ProcessingStatus, @CurrentlyWith, @ApprovalStatus, @CompanyName, @ApprovedBy, @UpdatedBy, @LoadgeBy, @UpdatedDate, @ApprovedDate, @CreatedDate, @CertificateNo, @IssuedDate, @EvaluationDate) DECLARE @AmendmentID int SELECT @AmendmentID = [AmendmentID] FROM [dbo].[CompanyAmmendments] WHERE @@ROWCOUNT > 0 AND [AmendmentID] = scope_identity() SELECT t0.[AmendmentID] FROM [dbo].[CompanyAmmendments] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[AmendmentID] = @AmendmentID" ); CreateStoredProcedure( "dbo.Update_CompanyAmmendment", p => new { AmendmentID = p.Int(), CompanyTIN = p.String(), ProjectID = p.Long(), ChangeofCompanyName = p.Boolean(), ProjectName = p.String(), ProjectCode = p.String(), ChangeofMajorityShare = p.Boolean(), ChangeOfAddress = p.Boolean(), ChangeOfLocation = p.Boolean(), ChangeofShareholders = p.Boolean(), ChangeofImplementationPeriod = p.Boolean(), LostCertificate = p.Boolean(), CancellingProject = p.Boolean(), ReIssueCertificate = p.Boolean(), ProcessingStatus = p.String(), CurrentlyWith = p.String(), ApprovalStatus = p.String(), CompanyName = p.String(), ApprovedBy = p.String(), UpdatedBy = p.String(), LoadgeBy = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), ApprovedDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), CertificateNo = p.String(), IssuedDate = p.DateTime(storeType: "datetime2"), EvaluationDate = p.DateTime(storeType: "datetime2"), }, body: @"UPDATE [dbo].[CompanyAmmendments] SET [CompanyTIN] = @CompanyTIN, [ProjectID] = @ProjectID, [ChangeofCompanyName] = @ChangeofCompanyName, [ProjectName] = @ProjectName, [ProjectCode] = @ProjectCode, [ChangeofMajorityShare] = @ChangeofMajorityShare, [ChangeOfAddress] = @ChangeOfAddress, [ChangeOfLocation] = @ChangeOfLocation, [ChangeofShareholders] = @ChangeofShareholders, [ChangeofImplementationPeriod] = @ChangeofImplementationPeriod, [LostCertificate] = @LostCertificate, [CancellingProject] = @CancellingProject, [ReIssueCertificate] = @ReIssueCertificate, [ProcessingStatus] = @ProcessingStatus, [CurrentlyWith] = @CurrentlyWith, [ApprovalStatus] = @ApprovalStatus, [CompanyName] = @CompanyName, [ApprovedBy] = @ApprovedBy, [UpdatedBy] = @UpdatedBy, [LoadgeBy] = @LoadgeBy, [UpdatedDate] = @UpdatedDate, [ApprovedDate] = @ApprovedDate, [CreatedDate] = @CreatedDate, [CertificateNo] = @CertificateNo, [IssuedDate] = @IssuedDate, [EvaluationDate] = @EvaluationDate WHERE ([AmendmentID] = @AmendmentID)" ); CreateStoredProcedure( "dbo.CompanyAmmendment_Delete", p => new { AmendmentID = p.Int(), }, body: @"DELETE [dbo].[CompanyAmmendments] WHERE ([AmendmentID] = @AmendmentID)" ); CreateStoredProcedure( "dbo.Add_CompanyAmmendmentExternal", p => new { CompanyTIN = p.String(), AssignedStatus = p.String(), AssignedDate = p.DateTime(storeType: "datetime2"), AssignedTo = p.String(), PVVCommentOfficer = p.String(), PVVCommentDIF = p.String(), PVVCommentEXD = p.String(), PVVReportingDate = p.DateTime(storeType: "datetime2"), DefferedReason = p.String(), ProjectCode = p.String(), ProjectName = p.String(), ProjectID = p.Long(), ChangeofCompanyName = p.Boolean(), ChangeofMajorityShare = p.Boolean(), ChangeOfAddress = p.Boolean(), ChangeOfLocation = p.Boolean(), ChangeofShareholders = p.Boolean(), ChangeofImplementationPeriod = p.Boolean(), LostCertificate = p.Boolean(), CancellingProject = p.Boolean(), ReIssueCertificate = p.Boolean(), ApprovalStatus = p.String(), Reason = p.String(), CompanyName = p.String(), ApprovedBy = p.String(), UpdatedBy = p.String(), CertificateNo = p.String(), LoadgeBy = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), ApprovedDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), IssuedDate = p.DateTime(storeType: "datetime2"), }, body: @"INSERT [dbo].[CompanyAmmendmentExternals]([CompanyTIN], [AssignedStatus], [AssignedDate], [AssignedTo], [PVVCommentOfficer], [PVVCommentDIF], [PVVCommentEXD], [PVVReportingDate], [DefferedReason], [ProjectCode], [ProjectName], [ProjectID], [ChangeofCompanyName], [ChangeofMajorityShare], [ChangeOfAddress], [ChangeOfLocation], [ChangeofShareholders], [ChangeofImplementationPeriod], [LostCertificate], [CancellingProject], [ReIssueCertificate], [ApprovalStatus], [Reason], [CompanyName], [ApprovedBy], [UpdatedBy], [CertificateNo], [LoadgeBy], [UpdatedDate], [ApprovedDate], [CreatedDate], [IssuedDate]) VALUES (@CompanyTIN, @AssignedStatus, @AssignedDate, @AssignedTo, @PVVCommentOfficer, @PVVCommentDIF, @PVVCommentEXD, @PVVReportingDate, @DefferedReason, @ProjectCode, @ProjectName, @ProjectID, @ChangeofCompanyName, @ChangeofMajorityShare, @ChangeOfAddress, @ChangeOfLocation, @ChangeofShareholders, @ChangeofImplementationPeriod, @LostCertificate, @CancellingProject, @ReIssueCertificate, @ApprovalStatus, @Reason, @CompanyName, @ApprovedBy, @UpdatedBy, @CertificateNo, @LoadgeBy, @UpdatedDate, @ApprovedDate, @CreatedDate, @IssuedDate) DECLARE @AmendmentID int SELECT @AmendmentID = [AmendmentID] FROM [dbo].[CompanyAmmendmentExternals] WHERE @@ROWCOUNT > 0 AND [AmendmentID] = scope_identity() SELECT t0.[AmendmentID] FROM [dbo].[CompanyAmmendmentExternals] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[AmendmentID] = @AmendmentID" ); CreateStoredProcedure( "dbo.Update_CompanyAmmendmentExternal", p => new { AmendmentID = p.Int(), CompanyTIN = p.String(), AssignedStatus = p.String(), AssignedDate = p.DateTime(storeType: "datetime2"), AssignedTo = p.String(), PVVCommentOfficer = p.String(), PVVCommentDIF = p.String(), PVVCommentEXD = p.String(), PVVReportingDate = p.DateTime(storeType: "datetime2"), DefferedReason = p.String(), ProjectCode = p.String(), ProjectName = p.String(), ProjectID = p.Long(), ChangeofCompanyName = p.Boolean(), ChangeofMajorityShare = p.Boolean(), ChangeOfAddress = p.Boolean(), ChangeOfLocation = p.Boolean(), ChangeofShareholders = p.Boolean(), ChangeofImplementationPeriod = p.Boolean(), LostCertificate = p.Boolean(), CancellingProject = p.Boolean(), ReIssueCertificate = p.Boolean(), ApprovalStatus = p.String(), Reason = p.String(), CompanyName = p.String(), ApprovedBy = p.String(), UpdatedBy = p.String(), CertificateNo = p.String(), LoadgeBy = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), ApprovedDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), IssuedDate = p.DateTime(storeType: "datetime2"), }, body: @"UPDATE [dbo].[CompanyAmmendmentExternals] SET [CompanyTIN] = @CompanyTIN, [AssignedStatus] = @AssignedStatus, [AssignedDate] = @AssignedDate, [AssignedTo] = @AssignedTo, [PVVCommentOfficer] = @PVVCommentOfficer, [PVVCommentDIF] = @PVVCommentDIF, [PVVCommentEXD] = @PVVCommentEXD, [PVVReportingDate] = @PVVReportingDate, [DefferedReason] = @DefferedReason, [ProjectCode] = @ProjectCode, [ProjectName] = @ProjectName, [ProjectID] = @ProjectID, [ChangeofCompanyName] = @ChangeofCompanyName, [ChangeofMajorityShare] = @ChangeofMajorityShare, [ChangeOfAddress] = @ChangeOfAddress, [ChangeOfLocation] = @ChangeOfLocation, [ChangeofShareholders] = @ChangeofShareholders, [ChangeofImplementationPeriod] = @ChangeofImplementationPeriod, [LostCertificate] = @LostCertificate, [CancellingProject] = @CancellingProject, [ReIssueCertificate] = @ReIssueCertificate, [ApprovalStatus] = @ApprovalStatus, [Reason] = @Reason, [CompanyName] = @CompanyName, [ApprovedBy] = @ApprovedBy, [UpdatedBy] = @UpdatedBy, [CertificateNo] = @CertificateNo, [LoadgeBy] = @LoadgeBy, [UpdatedDate] = @UpdatedDate, [ApprovedDate] = @ApprovedDate, [CreatedDate] = @CreatedDate, [IssuedDate] = @IssuedDate WHERE ([AmendmentID] = @AmendmentID)" ); CreateStoredProcedure( "dbo.CompanyAmmendmentExternal_Delete", p => new { AmendmentID = p.Int(), }, body: @"DELETE [dbo].[CompanyAmmendmentExternals] WHERE ([AmendmentID] = @AmendmentID)" ); CreateStoredProcedure( "dbo.Add_CompanyShareholder", p => new { CompanyTIN = p.String(maxLength: 40), FirstName = p.String(maxLength: 255), MiddleName = p.String(), LastName = p.String(), ShareStatus = p.String(), Country = p.String(), CategoryofShares = p.String(), TypeofShare = p.String(), SharePercent = p.Single(), NIDAorPassport = p.String(), AddedBy = p.String(), UpdatedBy = p.String(), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedDate = p.DateTime(storeType: "datetime2"), }, body: @"INSERT [dbo].[CompanyShareholderExternals]([CompanyTIN], [FirstName], [MiddleName], [LastName], [ShareStatus], [Country], [CategoryofShares], [TypeofShare], [SharePercent], [NIDAorPassport], [AddedBy], [UpdatedBy], [CreatedDate], [UpdatedDate]) VALUES (@CompanyTIN, @FirstName, @MiddleName, @LastName, @ShareStatus, @Country, @CategoryofShares, @TypeofShare, @SharePercent, @NIDAorPassport, @AddedBy, @UpdatedBy, @CreatedDate, @UpdatedDate) DECLARE @ShareholderID int SELECT @ShareholderID = [ShareholderID] FROM [dbo].[CompanyShareholderExternals] WHERE @@ROWCOUNT > 0 AND [ShareholderID] = scope_identity() SELECT t0.[ShareholderID] FROM [dbo].[CompanyShareholderExternals] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[ShareholderID] = @ShareholderID" ); CreateStoredProcedure( "dbo.Update_CompanyShareholder", p => new { ShareholderID = p.Int(), CompanyTIN = p.String(maxLength: 40), FirstName = p.String(maxLength: 255), MiddleName = p.String(), LastName = p.String(), ShareStatus = p.String(), Country = p.String(), CategoryofShares = p.String(), TypeofShare = p.String(), SharePercent = p.Single(), NIDAorPassport = p.String(), AddedBy = p.String(), UpdatedBy = p.String(), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedDate = p.DateTime(storeType: "datetime2"), }, body: @"UPDATE [dbo].[CompanyShareholderExternals] SET [CompanyTIN] = @CompanyTIN, [FirstName] = @FirstName, [MiddleName] = @MiddleName, [LastName] = @LastName, [ShareStatus] = @ShareStatus, [Country] = @Country, [CategoryofShares] = @CategoryofShares, [TypeofShare] = @TypeofShare, [SharePercent] = @SharePercent, [NIDAorPassport] = @NIDAorPassport, [AddedBy] = @AddedBy, [UpdatedBy] = @UpdatedBy, [CreatedDate] = @CreatedDate, [UpdatedDate] = @UpdatedDate WHERE ([ShareholderID] = @ShareholderID)" ); CreateStoredProcedure( "dbo.CompanyShareholderExternal_Delete", p => new { ShareholderID = p.Int(), }, body: @"DELETE [dbo].[CompanyShareholderExternals] WHERE ([ShareholderID] = @ShareholderID)" ); CreateStoredProcedure( "dbo.Add_ProjectProfileExternal", p => new { ProjectCode = p.String(), ProjectName = p.String(), CompanyTIN = p.String(), MainActivity = p.String(), ProductionCapacity = p.String(), CompanyName = p.String(maxLength: 255), ContactEmail = p.String(), StepName = p.String(), ServiceName = p.String(), LandMarkType = p.String(), PlotNumber = p.String(), HouseNo = p.String(), Area = p.String(), LandMarkDescription = p.String(), Ward = p.String(), Street = p.String(), Sector = p.String(), SubSector = p.String(), UnitMeasure = p.String(), TypeofOwnership = p.String(), MenForeign = p.Long(), WomenForeign = p.Long(), MenLocal = p.Long(), WomenLocal = p.Long(), Telephone = p.String(), PostalAddress = p.String(), BlockPlotNumber = p.String(maxLength: 255), ContactMobile = p.String(maxLength: 255), CompanyType = p.String(maxLength: 255), Region = p.String(maxLength: 255), District = p.String(maxLength: 255), AddedBy = p.String(), TICCertificateNo = p.String(), OriginalCOI = p.String(), IssuedDate = p.String(), ContactPerson = p.String(), Title = p.String(), Mobile = p.String(), Email = p.String(), AreaType = p.String(), ApprovalStatus = p.String(), EvaluationStatus = p.String(), LastUpdateDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedBy = p.String(), }, body: @"INSERT [dbo].[ProjectProfileExternals]([ProjectCode], [ProjectName], [CompanyTIN], [MainActivity], [ProductionCapacity], [CompanyName], [ContactEmail], [StepName], [ServiceName], [LandMarkType], [PlotNumber], [HouseNo], [Area], [LandMarkDescription], [Ward], [Street], [Sector], [SubSector], [UnitMeasure], [TypeofOwnership], [MenForeign], [WomenForeign], [MenLocal], [WomenLocal], [Telephone], [PostalAddress], [BlockPlotNumber], [ContactMobile], [CompanyType], [Region], [District], [AddedBy], [TICCertificateNo], [OriginalCOI], [IssuedDate], [ContactPerson], [Title], [Mobile], [Email], [AreaType], [ApprovalStatus], [EvaluationStatus], [LastUpdateDate], [CreatedDate], [UpdatedBy]) VALUES (@ProjectCode, @ProjectName, @CompanyTIN, @MainActivity, @ProductionCapacity, @CompanyName, @ContactEmail, @StepName, @ServiceName, @LandMarkType, @PlotNumber, @HouseNo, @Area, @LandMarkDescription, @Ward, @Street, @Sector, @SubSector, @UnitMeasure, @TypeofOwnership, @MenForeign, @WomenForeign, @MenLocal, @WomenLocal, @Telephone, @PostalAddress, @BlockPlotNumber, @ContactMobile, @CompanyType, @Region, @District, @AddedBy, @TICCertificateNo, @OriginalCOI, @IssuedDate, @ContactPerson, @Title, @Mobile, @Email, @AreaType, @ApprovalStatus, @EvaluationStatus, @LastUpdateDate, @CreatedDate, @UpdatedBy) DECLARE @ProjectID bigint SELECT @ProjectID = [ProjectID] FROM [dbo].[ProjectProfileExternals] WHERE @@ROWCOUNT > 0 AND [ProjectID] = scope_identity() SELECT t0.[ProjectID] FROM [dbo].[ProjectProfileExternals] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[ProjectID] = @ProjectID" ); CreateStoredProcedure( "dbo.Update_ProjectProfileExternal", p => new { ProjectID = p.Long(), ProjectCode = p.String(), ProjectName = p.String(), CompanyTIN = p.String(), MainActivity = p.String(), ProductionCapacity = p.String(), CompanyName = p.String(maxLength: 255), ContactEmail = p.String(), StepName = p.String(), ServiceName = p.String(), LandMarkType = p.String(), PlotNumber = p.String(), HouseNo = p.String(), Area = p.String(), LandMarkDescription = p.String(), Ward = p.String(), Street = p.String(), Sector = p.String(), SubSector = p.String(), UnitMeasure = p.String(), TypeofOwnership = p.String(), MenForeign = p.Long(), WomenForeign = p.Long(), MenLocal = p.Long(), WomenLocal = p.Long(), Telephone = p.String(), PostalAddress = p.String(), BlockPlotNumber = p.String(maxLength: 255), ContactMobile = p.String(maxLength: 255), CompanyType = p.String(maxLength: 255), Region = p.String(maxLength: 255), District = p.String(maxLength: 255), AddedBy = p.String(), TICCertificateNo = p.String(), OriginalCOI = p.String(), IssuedDate = p.String(), ContactPerson = p.String(), Title = p.String(), Mobile = p.String(), Email = p.String(), AreaType = p.String(), ApprovalStatus = p.String(), EvaluationStatus = p.String(), LastUpdateDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedBy = p.String(), }, body: @"UPDATE [dbo].[ProjectProfileExternals] SET [ProjectCode] = @ProjectCode, [ProjectName] = @ProjectName, [CompanyTIN] = @CompanyTIN, [MainActivity] = @MainActivity, [ProductionCapacity] = @ProductionCapacity, [CompanyName] = @CompanyName, [ContactEmail] = @ContactEmail, [StepName] = @StepName, [ServiceName] = @ServiceName, [LandMarkType] = @LandMarkType, [PlotNumber] = @PlotNumber, [HouseNo] = @HouseNo, [Area] = @Area, [LandMarkDescription] = @LandMarkDescription, [Ward] = @Ward, [Street] = @Street, [Sector] = @Sector, [SubSector] = @SubSector, [UnitMeasure] = @UnitMeasure, [TypeofOwnership] = @TypeofOwnership, [MenForeign] = @MenForeign, [WomenForeign] = @WomenForeign, [MenLocal] = @MenLocal, [WomenLocal] = @WomenLocal, [Telephone] = @Telephone, [PostalAddress] = @PostalAddress, [BlockPlotNumber] = @BlockPlotNumber, [ContactMobile] = @ContactMobile, [CompanyType] = @CompanyType, [Region] = @Region, [District] = @District, [AddedBy] = @AddedBy, [TICCertificateNo] = @TICCertificateNo, [OriginalCOI] = @OriginalCOI, [IssuedDate] = @IssuedDate, [ContactPerson] = @ContactPerson, [Title] = @Title, [Mobile] = @Mobile, [Email] = @Email, [AreaType] = @AreaType, [ApprovalStatus] = @ApprovalStatus, [EvaluationStatus] = @EvaluationStatus, [LastUpdateDate] = @LastUpdateDate, [CreatedDate] = @CreatedDate, [UpdatedBy] = @UpdatedBy WHERE ([ProjectID] = @ProjectID)" ); CreateStoredProcedure( "dbo.ProjectProfileExternal_Delete", p => new { ProjectID = p.Long(), }, body: @"DELETE [dbo].[ProjectProfileExternals] WHERE ([ProjectID] = @ProjectID)" ); CreateStoredProcedure( "dbo.Add_DefferementHistory", p => new { ProjectCode = p.String(), ProjectID = p.Long(), DIFMsg = p.String(), InvestorMsg = p.String(), AddedBy = p.String(), UpdatedBy = p.String(), CompanyName = p.String(), ProjectName = p.String(), ServiceName = p.String(), ApplicationID = p.Long(), CreatedBy = p.String(), ApprovedDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), }, body: @"INSERT [dbo].[DefferementHistories]([ProjectCode], [ProjectID], [DIFMsg], [InvestorMsg], [AddedBy], [UpdatedBy], [CompanyName], [ProjectName], [ServiceName], [ApplicationID], [CreatedBy], [ApprovedDate], [CreatedDate]) VALUES (@ProjectCode, @ProjectID, @DIFMsg, @InvestorMsg, @AddedBy, @UpdatedBy, @CompanyName, @ProjectName, @ServiceName, @ApplicationID, @CreatedBy, @ApprovedDate, @CreatedDate) DECLARE @DefferedD int SELECT @DefferedD = [DefferedD] FROM [dbo].[DefferementHistories] WHERE @@ROWCOUNT > 0 AND [DefferedD] = scope_identity() SELECT t0.[DefferedD] FROM [dbo].[DefferementHistories] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[DefferedD] = @DefferedD" ); CreateStoredProcedure( "dbo.Update_DefferementHistory", p => new { DefferedD = p.Int(), ProjectCode = p.String(), ProjectID = p.Long(), DIFMsg = p.String(), InvestorMsg = p.String(), AddedBy = p.String(), UpdatedBy = p.String(), CompanyName = p.String(), ProjectName = p.String(), ServiceName = p.String(), ApplicationID = p.Long(), CreatedBy = p.String(), ApprovedDate = p.DateTime(storeType: "datetime2"), CreatedDate = p.DateTime(storeType: "datetime2"), }, body: @"UPDATE [dbo].[DefferementHistories] SET [ProjectCode] = @ProjectCode, [ProjectID] = @ProjectID, [DIFMsg] = @DIFMsg, [InvestorMsg] = @InvestorMsg, [AddedBy] = @AddedBy, [UpdatedBy] = @UpdatedBy, [CompanyName] = @CompanyName, [ProjectName] = @ProjectName, [ServiceName] = @ServiceName, [ApplicationID] = @ApplicationID, [CreatedBy] = @CreatedBy, [ApprovedDate] = @ApprovedDate, [CreatedDate] = @CreatedDate WHERE ([DefferedD] = @DefferedD)" ); CreateStoredProcedure( "dbo.DefferementHistory_Delete", p => new { DefferedD = p.Int(), }, body: @"DELETE [dbo].[DefferementHistories] WHERE ([DefferedD] = @DefferedD)" ); CreateStoredProcedure( "dbo.Add_District", p => new { DistrictCode = p.String(maxLength: 128), RegionCode = p.String(maxLength: 128), DistrictName = p.String(), RegionName = p.String(), }, body: @"INSERT [dbo].[Districts]([DistrictCode], [RegionCode], [DistrictName], [RegionName]) VALUES (@DistrictCode, @RegionCode, @DistrictName, @RegionName) SELECT t0.[DistrictID] FROM [dbo].[Districts] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[DistrictCode] = @DistrictCode" ); CreateStoredProcedure( "dbo.Update_District", p => new { DistrictCode = p.String(maxLength: 128), DistrictID = p.Long(), RegionCode = p.String(maxLength: 128), DistrictName = p.String(), RegionName = p.String(), }, body: @"UPDATE [dbo].[Districts] SET [RegionCode] = @RegionCode, [DistrictName] = @DistrictName, [RegionName] = @RegionName WHERE ([DistrictCode] = @DistrictCode)" ); CreateStoredProcedure( "dbo.District_Delete", p => new { DistrictCode = p.String(maxLength: 128), }, body: @"DELETE [dbo].[Districts] WHERE ([DistrictCode] = @DistrictCode)" ); CreateStoredProcedure( "dbo.Add_Region", p => new { RegionCode = p.String(maxLength: 128), RegionName = p.String(), }, body: @"INSERT [dbo].[Regions]([RegionCode], [RegionName]) VALUES (@RegionCode, @RegionName) SELECT t0.[RegionID] FROM [dbo].[Regions] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[RegionCode] = @RegionCode" ); CreateStoredProcedure( "dbo.Update_Region", p => new { RegionCode = p.String(maxLength: 128), RegionID = p.Long(), RegionName = p.String(), }, body: @"UPDATE [dbo].[Regions] SET [RegionName] = @RegionName WHERE ([RegionCode] = @RegionCode)" ); CreateStoredProcedure( "dbo.Region_Delete", p => new { RegionCode = p.String(maxLength: 128), }, body: @"DELETE [dbo].[Regions] WHERE ([RegionCode] = @RegionCode)" ); CreateStoredProcedure( "dbo.Add_FinancialExternal", p => new { ProjectID = p.Long(), CompanyTIN = p.String(), ProjectCode = p.String(), StepName = p.String(), AddedBy = p.String(), SourceCountryLoan = p.String(), SourceCountryEquity = p.String(), TypeofApp = p.String(), FixedAsset = p.Double(), WorkingCapital = p.Double(), TotalDDI = p.Double(), LocalEquity = p.Double(), LocalLoan = p.Double(), UpdatedBy = p.String(), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedDate = p.DateTime(storeType: "datetime2"), ForeignEquity = p.Double(), ForeignLoan = p.Double(), MTotalFDI = p.Double(), TotalForeign = p.Double(), TotalLocal = p.Double(), TotalCapital = p.Double(), MFixedAsset = p.Double(), MWorkingCapital = p.Double(), Jobs = p.Long(), MInvestmentBreakDown = p.Double(), TotalFDI = p.Double(), MTotalDDI = p.Double(), MLocalEquity = p.Double(), MLocalLoan = p.Double(), MForeignEquity = p.Double(), MForeignLoan = p.Double(), MTotalForeign = p.Double(), MTotalLocal = p.Double(), MTotalCapital = p.Double(), }, body: @"INSERT [dbo].[FinancingProfileExternals]([ProjectID], [CompanyTIN], [ProjectCode], [StepName], [AddedBy], [SourceCountryLoan], [SourceCountryEquity], [TypeofApp], [FixedAsset], [WorkingCapital], [TotalDDI], [LocalEquity], [LocalLoan], [UpdatedBy], [CreatedDate], [UpdatedDate], [ForeignEquity], [ForeignLoan], [MTotalFDI], [TotalForeign], [TotalLocal], [TotalCapital], [MFixedAsset], [MWorkingCapital], [Jobs], [MInvestmentBreakDown], [TotalFDI], [MTotalDDI], [MLocalEquity], [MLocalLoan], [MForeignEquity], [MForeignLoan], [MTotalForeign], [MTotalLocal], [MTotalCapital]) VALUES (@ProjectID, @CompanyTIN, @ProjectCode, @StepName, @AddedBy, @SourceCountryLoan, @SourceCountryEquity, @TypeofApp, @FixedAsset, @WorkingCapital, @TotalDDI, @LocalEquity, @LocalLoan, @UpdatedBy, @CreatedDate, @UpdatedDate, @ForeignEquity, @ForeignLoan, @MTotalFDI, @TotalForeign, @TotalLocal, @TotalCapital, @MFixedAsset, @MWorkingCapital, @Jobs, @MInvestmentBreakDown, @TotalFDI, @MTotalDDI, @MLocalEquity, @MLocalLoan, @MForeignEquity, @MForeignLoan, @MTotalForeign, @MTotalLocal, @MTotalCapital) DECLARE @FinancingID int SELECT @FinancingID = [FinancingID] FROM [dbo].[FinancingProfileExternals] WHERE @@ROWCOUNT > 0 AND [FinancingID] = scope_identity() SELECT t0.[FinancingID] FROM [dbo].[FinancingProfileExternals] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[FinancingID] = @FinancingID" ); CreateStoredProcedure( "dbo.Update_FinancialExternal", p => new { FinancingID = p.Int(), ProjectID = p.Long(), CompanyTIN = p.String(), ProjectCode = p.String(), StepName = p.String(), AddedBy = p.String(), SourceCountryLoan = p.String(), SourceCountryEquity = p.String(), TypeofApp = p.String(), FixedAsset = p.Double(), WorkingCapital = p.Double(), TotalDDI = p.Double(), LocalEquity = p.Double(), LocalLoan = p.Double(), UpdatedBy = p.String(), CreatedDate = p.DateTime(storeType: "datetime2"), UpdatedDate = p.DateTime(storeType: "datetime2"), ForeignEquity = p.Double(), ForeignLoan = p.Double(), MTotalFDI = p.Double(), TotalForeign = p.Double(), TotalLocal = p.Double(), TotalCapital = p.Double(), MFixedAsset = p.Double(), MWorkingCapital = p.Double(), Jobs = p.Long(), MInvestmentBreakDown = p.Double(), TotalFDI = p.Double(), MTotalDDI = p.Double(), MLocalEquity = p.Double(), MLocalLoan = p.Double(), MForeignEquity = p.Double(), MForeignLoan = p.Double(), MTotalForeign = p.Double(), MTotalLocal = p.Double(), MTotalCapital = p.Double(), }, body: @"UPDATE [dbo].[FinancingProfileExternals] SET [ProjectID] = @ProjectID, [CompanyTIN] = @CompanyTIN, [ProjectCode] = @ProjectCode, [StepName] = @StepName, [AddedBy] = @AddedBy, [SourceCountryLoan] = @SourceCountryLoan, [SourceCountryEquity] = @SourceCountryEquity, [TypeofApp] = @TypeofApp, [FixedAsset] = @FixedAsset, [WorkingCapital] = @WorkingCapital, [TotalDDI] = @TotalDDI, [LocalEquity] = @LocalEquity, [LocalLoan] = @LocalLoan, [UpdatedBy] = @UpdatedBy, [CreatedDate] = @CreatedDate, [UpdatedDate] = @UpdatedDate, [ForeignEquity] = @ForeignEquity, [ForeignLoan] = @ForeignLoan, [MTotalFDI] = @MTotalFDI, [TotalForeign] = @TotalForeign, [TotalLocal] = @TotalLocal, [TotalCapital] = @TotalCapital, [MFixedAsset] = @MFixedAsset, [MWorkingCapital] = @MWorkingCapital, [Jobs] = @Jobs, [MInvestmentBreakDown] = @MInvestmentBreakDown, [TotalFDI] = @TotalFDI, [MTotalDDI] = @MTotalDDI, [MLocalEquity] = @MLocalEquity, [MLocalLoan] = @MLocalLoan, [MForeignEquity] = @MForeignEquity, [MForeignLoan] = @MForeignLoan, [MTotalForeign] = @MTotalForeign, [MTotalLocal] = @MTotalLocal, [MTotalCapital] = @MTotalCapital WHERE ([FinancingID] = @FinancingID)" ); CreateStoredProcedure( "dbo.FinancingProfileExternal_Delete", p => new { FinancingID = p.Int(), }, body: @"DELETE [dbo].[FinancingProfileExternals] WHERE ([FinancingID] = @FinancingID)" ); CreateStoredProcedure( "dbo.Add_ProjectProfile", p => new { ProjectCode = p.String(), ProjectName = p.String(), CompanyTIN = p.String(), RegionName = p.String(), WardName = p.String(), AreaType = p.String(), Unsurveyedaddress = p.String(), HouseNo = p.String(), Road = p.String(), LoanConditions = p.String(), Location = p.String(), CompanyName = p.String(), ZonalName = p.String(), DistrictName = p.String(), ExpansionNo = p.String(), OriginalCOI = p.String(), SerialNumber = p.String(), TotalCapital = p.Double(), Jobs = p.Long(), MenLocal = p.Long(), TotalEmploymentLocal = p.Long(), TotalEmploymentForeign = p.Long(), WomenLocal = p.Long(), MenForeign = p.Long(), WomenForeign = p.Long(), ApprovedDate = p.DateTime(storeType: "datetime2"), LastExpansionDate = p.DateTime(storeType: "datetime2"), LodgedDate = p.DateTime(storeType: "datetime2"), TypeofApplication = p.String(maxLength: 255), Email = p.String(), latitude = p.Single(), longitude = p.Single(), ProcessingStatus = p.String(), CurrentlyWith = p.String(), ApprovedStatus = p.String(), ApprovedBy = p.String(), Telephone = p.String(), Address = p.String(), Mobile = p.String(), SectorIcon = p.String(), BlockNumber = p.String(maxLength: 255), PlotNumber = p.String(maxLength: 255), PhysicalAddress = p.String(maxLength: 255), SubSector = p.String(maxLength: 255), Street = p.String(maxLength: 255), ProductionCapacity = p.String(maxLength: 255), Sector = p.String(maxLength: 255), ContactPerson = p.String(maxLength: 255), Position = p.String(maxLength: 255), AmendmentSection = p.String(), MajorityShare = p.String(), StrategicInvestor = p.String(), CleaningStatus = p.String(), PrintingStatus = p.String(), PrintingStatusAmendment = p.String(), PrintedDate = p.DateTime(storeType: "datetime2"), PrintedDateAmendment = p.DateTime(storeType: "datetime2"), AmendmentStatus = p.String(), Conditions = p.String(), PrintedBy = p.String(), PrintedByAmendment = p.String(), ReportingStatus = p.String(), PostalAddress = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), OperativeDate = p.DateTime(storeType: "datetime2"), UpdatedBy = p.String(), VerifiedBy = p.String(), VerifiedDate = p.DateTime(storeType: "datetime2"), CleaningComment = p.String(), ReportingComent = p.String(), LandMarkType = p.String(), Area = p.String(), LandMarkDescription = p.String(), ReportingApprovedBy = p.String(), Activity = p.String(), LodgedBy = p.String(maxLength: 255), ImplementationStartDate = p.DateTime(storeType: "datetime2"), ImplementationEndDate = p.DateTime(storeType: "datetime2"), CertificateOfIncentiveNo = p.String(maxLength: 255), FileNo = p.String(), }, body: @"INSERT [dbo].[ProjectProfiles]([ProjectCode], [ProjectName], [CompanyTIN], [RegionName], [WardName], [AreaType], [Unsurveyedaddress], [HouseNo], [Road], [LoanConditions], [Location], [CompanyName], [ZonalName], [DistrictName], [ExpansionNo], [OriginalCOI], [SerialNumber], [TotalCapital], [Jobs], [MenLocal], [TotalEmploymentLocal], [TotalEmploymentForeign], [WomenLocal], [MenForeign], [WomenForeign], [ApprovedDate], [LastExpansionDate], [LodgedDate], [TypeofApplication], [Email], [latitude], [longitude], [ProcessingStatus], [CurrentlyWith], [ApprovedStatus], [ApprovedBy], [Telephone], [Address], [Mobile], [SectorIcon], [BlockNumber], [PlotNumber], [PhysicalAddress], [SubSector], [Street], [ProductionCapacity], [Sector], [ContactPerson], [Position], [AmendmentSection], [MajorityShare], [StrategicInvestor], [CleaningStatus], [PrintingStatus], [PrintingStatusAmendment], [PrintedDate], [PrintedDateAmendment], [AmendmentStatus], [Conditions], [PrintedBy], [PrintedByAmendment], [ReportingStatus], [PostalAddress], [UpdatedDate], [OperativeDate], [UpdatedBy], [VerifiedBy], [VerifiedDate], [CleaningComment], [ReportingComent], [LandMarkType], [Area], [LandMarkDescription], [ReportingApprovedBy], [Activity], [LodgedBy], [ImplementationStartDate], [ImplementationEndDate], [CertificateOfIncentiveNo], [FileNo]) VALUES (@ProjectCode, @ProjectName, @CompanyTIN, @RegionName, @WardName, @AreaType, @Unsurveyedaddress, @HouseNo, @Road, @LoanConditions, @Location, @CompanyName, @ZonalName, @DistrictName, @ExpansionNo, @OriginalCOI, @SerialNumber, @TotalCapital, @Jobs, @MenLocal, @TotalEmploymentLocal, @TotalEmploymentForeign, @WomenLocal, @MenForeign, @WomenForeign, @ApprovedDate, @LastExpansionDate, @LodgedDate, @TypeofApplication, @Email, @latitude, @longitude, @ProcessingStatus, @CurrentlyWith, @ApprovedStatus, @ApprovedBy, @Telephone, @Address, @Mobile, @SectorIcon, @BlockNumber, @PlotNumber, @PhysicalAddress, @SubSector, @Street, @ProductionCapacity, @Sector, @ContactPerson, @Position, @AmendmentSection, @MajorityShare, @StrategicInvestor, @CleaningStatus, @PrintingStatus, @PrintingStatusAmendment, @PrintedDate, @PrintedDateAmendment, @AmendmentStatus, @Conditions, @PrintedBy, @PrintedByAmendment, @ReportingStatus, @PostalAddress, @UpdatedDate, @OperativeDate, @UpdatedBy, @VerifiedBy, @VerifiedDate, @CleaningComment, @ReportingComent, @LandMarkType, @Area, @LandMarkDescription, @ReportingApprovedBy, @Activity, @LodgedBy, @ImplementationStartDate, @ImplementationEndDate, @CertificateOfIncentiveNo, @FileNo) DECLARE @ProjectID bigint SELECT @ProjectID = [ProjectID] FROM [dbo].[ProjectProfiles] WHERE @@ROWCOUNT > 0 AND [ProjectID] = scope_identity() SELECT t0.[ProjectID] FROM [dbo].[ProjectProfiles] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[ProjectID] = @ProjectID" ); CreateStoredProcedure( "dbo.Update_ProjectProfile", p => new { ProjectID = p.Long(), ProjectCode = p.String(), ProjectName = p.String(), CompanyTIN = p.String(), RegionName = p.String(), WardName = p.String(), AreaType = p.String(), Unsurveyedaddress = p.String(), HouseNo = p.String(), Road = p.String(), LoanConditions = p.String(), Location = p.String(), CompanyName = p.String(), ZonalName = p.String(), DistrictName = p.String(), ExpansionNo = p.String(), OriginalCOI = p.String(), SerialNumber = p.String(), TotalCapital = p.Double(), Jobs = p.Long(), MenLocal = p.Long(), TotalEmploymentLocal = p.Long(), TotalEmploymentForeign = p.Long(), WomenLocal = p.Long(), MenForeign = p.Long(), WomenForeign = p.Long(), ApprovedDate = p.DateTime(storeType: "datetime2"), LastExpansionDate = p.DateTime(storeType: "datetime2"), LodgedDate = p.DateTime(storeType: "datetime2"), TypeofApplication = p.String(maxLength: 255), Email = p.String(), latitude = p.Single(), longitude = p.Single(), ProcessingStatus = p.String(), CurrentlyWith = p.String(), ApprovedStatus = p.String(), ApprovedBy = p.String(), Telephone = p.String(), Address = p.String(), Mobile = p.String(), SectorIcon = p.String(), BlockNumber = p.String(maxLength: 255), PlotNumber = p.String(maxLength: 255), PhysicalAddress = p.String(maxLength: 255), SubSector = p.String(maxLength: 255), Street = p.String(maxLength: 255), ProductionCapacity = p.String(maxLength: 255), Sector = p.String(maxLength: 255), ContactPerson = p.String(maxLength: 255), Position = p.String(maxLength: 255), AmendmentSection = p.String(), MajorityShare = p.String(), StrategicInvestor = p.String(), CleaningStatus = p.String(), PrintingStatus = p.String(), PrintingStatusAmendment = p.String(), PrintedDate = p.DateTime(storeType: "datetime2"), PrintedDateAmendment = p.DateTime(storeType: "datetime2"), AmendmentStatus = p.String(), Conditions = p.String(), PrintedBy = p.String(), PrintedByAmendment = p.String(), ReportingStatus = p.String(), PostalAddress = p.String(), UpdatedDate = p.DateTime(storeType: "datetime2"), OperativeDate = p.DateTime(storeType: "datetime2"), UpdatedBy = p.String(), VerifiedBy = p.String(), VerifiedDate = p.DateTime(storeType: "datetime2"), CleaningComment = p.String(), ReportingComent = p.String(), LandMarkType = p.String(), Area = p.String(), LandMarkDescription = p.String(), ReportingApprovedBy = p.String(), Activity = p.String(), LodgedBy = p.String(maxLength: 255), ImplementationStartDate = p.DateTime(storeType: "datetime2"), ImplementationEndDate = p.DateTime(storeType: "datetime2"), CertificateOfIncentiveNo = p.String(maxLength: 255), FileNo = p.String(), }, body: @"UPDATE [dbo].[ProjectProfiles] SET [ProjectCode] = @ProjectCode, [ProjectName] = @ProjectName, [CompanyTIN] = @CompanyTIN, [RegionName] = @RegionName, [WardName] = @WardName, [AreaType] = @AreaType, [Unsurveyedaddress] = @Unsurveyedaddress, [HouseNo] = @HouseNo, [Road] = @Road, [LoanConditions] = @LoanConditions, [Location] = @Location, [CompanyName] = @CompanyName, [ZonalName] = @ZonalName, [DistrictName] = @DistrictName, [ExpansionNo] = @ExpansionNo, [OriginalCOI] = @OriginalCOI, [SerialNumber] = @SerialNumber, [TotalCapital] = @TotalCapital, [Jobs] = @Jobs, [MenLocal] = @MenLocal, [TotalEmploymentLocal] = @TotalEmploymentLocal, [TotalEmploymentForeign] = @TotalEmploymentForeign, [WomenLocal] = @WomenLocal, [MenForeign] = @MenForeign, [WomenForeign] = @WomenForeign, [ApprovedDate] = @ApprovedDate, [LastExpansionDate] = @LastExpansionDate, [LodgedDate] = @LodgedDate, [TypeofApplication] = @TypeofApplication, [Email] = @Email, [latitude] = @latitude, [longitude] = @longitude, [ProcessingStatus] = @ProcessingStatus, [CurrentlyWith] = @CurrentlyWith, [ApprovedStatus] = @ApprovedStatus, [ApprovedBy] = @ApprovedBy, [Telephone] = @Telephone, [Address] = @Address, [Mobile] = @Mobile, [SectorIcon] = @SectorIcon, [BlockNumber] = @BlockNumber, [PlotNumber] = @PlotNumber, [PhysicalAddress] = @PhysicalAddress, [SubSector] = @SubSector, [Street] = @Street, [ProductionCapacity] = @ProductionCapacity, [Sector] = @Sector, [ContactPerson] = @ContactPerson, [Position] = @Position, [AmendmentSection] = @AmendmentSection, [MajorityShare] = @MajorityShare, [StrategicInvestor] = @StrategicInvestor, [CleaningStatus] = @CleaningStatus, [PrintingStatus] = @PrintingStatus, [PrintingStatusAmendment] = @PrintingStatusAmendment, [PrintedDate] = @PrintedDate, [PrintedDateAmendment] = @PrintedDateAmendment, [AmendmentStatus] = @AmendmentStatus, [Conditions] = @Conditions, [PrintedBy] = @PrintedBy, [PrintedByAmendment] = @PrintedByAmendment, [ReportingStatus] = @ReportingStatus, [PostalAddress] = @PostalAddress, [UpdatedDate] = @UpdatedDate, [OperativeDate] = @OperativeDate, [UpdatedBy] = @UpdatedBy, [VerifiedBy] = @VerifiedBy, [VerifiedDate] = @VerifiedDate, [CleaningComment] = @CleaningComment, [ReportingComent] = @ReportingComent, [LandMarkType] = @LandMarkType, [Area] = @Area, [LandMarkDescription] = @LandMarkDescription, [ReportingApprovedBy] = @ReportingApprovedBy, [Activity] = @Activity, [LodgedBy] = @LodgedBy, [ImplementationStartDate] = @ImplementationStartDate, [ImplementationEndDate] = @ImplementationEndDate, [CertificateOfIncentiveNo] = @CertificateOfIncentiveNo, [FileNo] = @FileNo WHERE ([ProjectID] = @ProjectID)" ); CreateStoredProcedure( "dbo.ProjectProfile_Delete", p => new { ProjectID = p.Long(), }, body: @"DELETE [dbo].[ProjectProfiles] WHERE ([ProjectID] = @ProjectID)" ); CreateStoredProcedure( "dbo.Add_Sector", p => new { SectorName = p.String(), }, body: @"INSERT [dbo].[Sectors]([SectorName]) VALUES (@SectorName) DECLARE @SectorID int SELECT @SectorID = [SectorID] FROM [dbo].[Sectors] WHERE @@ROWCOUNT > 0 AND [SectorID] = scope_identity() SELECT t0.[SectorID] FROM [dbo].[Sectors] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[SectorID] = @SectorID" ); CreateStoredProcedure( "dbo.Update_Sector", p => new { SectorID = p.Int(), SectorName = p.String(), }, body: @"UPDATE [dbo].[Sectors] SET [SectorName] = @SectorName WHERE ([SectorID] = @SectorID)" ); CreateStoredProcedure( "dbo.Sector_Delete", p => new { SectorID = p.Int(), }, body: @"DELETE [dbo].[Sectors] WHERE ([SectorID] = @SectorID)" ); CreateStoredProcedure( "dbo.Add_StepsManagement", p => new { CompanyName = p.String(), CompanyTIN = p.String(maxLength: 40), ProjectCode = p.String(maxLength: 255), CompanyEmail = p.String(maxLength: 40), ApplicationType = p.String(), StepNo = p.String(), CreatedDate = p.DateTime(), UpdatedDate = p.DateTime(), SubmittedStatus = p.String(), EvaluationStatus = p.String(), }, body: @"INSERT [dbo].[StepsManagements]([CompanyName], [CompanyTIN], [ProjectCode], [CompanyEmail], [ApplicationType], [StepNo], [CreatedDate], [UpdatedDate], [SubmittedStatus], [EvaluationStatus]) VALUES (@CompanyName, @CompanyTIN, @ProjectCode, @CompanyEmail, @ApplicationType, @StepNo, @CreatedDate, @UpdatedDate, @SubmittedStatus, @EvaluationStatus) DECLARE @StepID int SELECT @StepID = [StepID] FROM [dbo].[StepsManagements] WHERE @@ROWCOUNT > 0 AND [StepID] = scope_identity() SELECT t0.[StepID] FROM [dbo].[StepsManagements] AS t0 WHERE @@ROWCOUNT > 0 AND t0.[StepID] = @StepID" ); CreateStoredProcedure( "dbo.Update_StepsManagement", p => new { StepID = p.Int(), CompanyName = p.String(), CompanyTIN = p.String(maxLength: 40), ProjectCode = p.String(maxLength: 255), CompanyEmail = p.String(maxLength: 40), ApplicationType = p.String(), StepNo = p.String(), CreatedDate = p.DateTime(), UpdatedDate = p.DateTime(), SubmittedStatus = p.String(), EvaluationStatus = p.String(), }, body: @"UPDATE [dbo].[StepsManagements] SET [CompanyName] = @CompanyName, [CompanyTIN] = @CompanyTIN, [ProjectCode] = @ProjectCode, [CompanyEmail] = @CompanyEmail, [ApplicationType] = @ApplicationType, [StepNo] = @StepNo, [CreatedDate] = @CreatedDate, [UpdatedDate] = @UpdatedDate, [SubmittedStatus] = @SubmittedStatus, [EvaluationStatus] = @EvaluationStatus WHERE ([StepID] = @StepID)" ); CreateStoredProcedure( "dbo.StepsManagement_Delete", p => new { StepID = p.Int(), }, body: @"DELETE [dbo].[StepsManagements] WHERE ([StepID] = @StepID)" ); } public override void Down() { DropStoredProcedure("dbo.StepsManagement_Delete"); DropStoredProcedure("dbo.Update_StepsManagement"); DropStoredProcedure("dbo.Add_StepsManagement"); DropStoredProcedure("dbo.Sector_Delete"); DropStoredProcedure("dbo.Update_Sector"); DropStoredProcedure("dbo.Add_Sector"); DropStoredProcedure("dbo.ProjectProfile_Delete"); DropStoredProcedure("dbo.Update_ProjectProfile"); DropStoredProcedure("dbo.Add_ProjectProfile"); DropStoredProcedure("dbo.FinancingProfileExternal_Delete"); DropStoredProcedure("dbo.Update_FinancialExternal"); DropStoredProcedure("dbo.Add_FinancialExternal"); DropStoredProcedure("dbo.Region_Delete"); DropStoredProcedure("dbo.Update_Region"); DropStoredProcedure("dbo.Add_Region"); DropStoredProcedure("dbo.District_Delete"); DropStoredProcedure("dbo.Update_District"); DropStoredProcedure("dbo.Add_District"); DropStoredProcedure("dbo.DefferementHistory_Delete"); DropStoredProcedure("dbo.Update_DefferementHistory"); DropStoredProcedure("dbo.Add_DefferementHistory"); DropStoredProcedure("dbo.ProjectProfileExternal_Delete"); DropStoredProcedure("dbo.Update_ProjectProfileExternal"); DropStoredProcedure("dbo.Add_ProjectProfileExternal"); DropStoredProcedure("dbo.CompanyShareholderExternal_Delete"); DropStoredProcedure("dbo.Update_CompanyShareholder"); DropStoredProcedure("dbo.Add_CompanyShareholder"); DropStoredProcedure("dbo.CompanyAmmendmentExternal_Delete"); DropStoredProcedure("dbo.Update_CompanyAmmendmentExternal"); DropStoredProcedure("dbo.Add_CompanyAmmendmentExternal"); DropStoredProcedure("dbo.CompanyAmmendment_Delete"); DropStoredProcedure("dbo.Update_CompanyAmmendment"); DropStoredProcedure("dbo.Add_CompanyAmmendment"); DropStoredProcedure("dbo.Attachments_Delete"); DropStoredProcedure("dbo.Update_Attachments"); DropStoredProcedure("dbo.Add_Attachments"); DropStoredProcedure("dbo.InvestorProfileExternal_Delete"); DropStoredProcedure("dbo.Update_InvestorProfilexternal"); DropStoredProcedure("dbo.Add_InvestorProfileExternal"); DropStoredProcedure("dbo.CompanyProfileExternal_Delete"); DropStoredProcedure("dbo.Update_CompanyProfileExternal"); DropStoredProcedure("dbo.Add_CompanyProfileExternal"); DropStoredProcedure("dbo.ApplicationManager_Delete"); DropStoredProcedure("dbo.Update_Application"); DropStoredProcedure("dbo.Add_Application"); DropForeignKey("dbo.Wards", "DistrictCode", "dbo.Districts"); DropForeignKey("dbo.StepsManagements", "CompanyEmail", "dbo.InvestorProfileExternals"); DropForeignKey("dbo.StepsManagements", "CompanyTIN", "dbo.CompanyProfileExternals"); DropForeignKey("dbo.Districts", "RegionCode", "dbo.Regions"); DropForeignKey("dbo.CountryInvestments", "ProjectID", "dbo.ProjectProfileExternals"); DropForeignKey("dbo.CompanyShareholderExternals", "CompanyTIN", "dbo.CompanyProfileExternals"); DropForeignKey("dbo.ApplicationManagers", "CompanyEmail", "dbo.InvestorProfileExternals"); DropForeignKey("dbo.ApplicationManagers", "CompanyTIN", "dbo.CompanyProfileExternals"); DropForeignKey("dbo.CompanyProfileExternals", "CompanyTIN", "dbo.InvestorProfileExternals"); DropIndex("dbo.Wards", new[] { "DistrictCode" }); DropIndex("dbo.StepsManagements", new[] { "CompanyEmail" }); DropIndex("dbo.StepsManagements", new[] { "CompanyTIN" }); DropIndex("dbo.Districts", new[] { "RegionCode" }); DropIndex("dbo.CountryInvestments", new[] { "ProjectID" }); DropIndex("dbo.CompanyShareholderExternals", new[] { "CompanyTIN" }); DropIndex("dbo.CompanyProfileExternals", new[] { "CompanyTIN" }); DropIndex("dbo.ApplicationManagers", new[] { "CompanyEmail" }); DropIndex("dbo.ApplicationManagers", new[] { "CompanyTIN" }); DropTable("dbo.Wards"); DropTable("dbo.SubSectors"); DropTable("dbo.StepsManagements"); DropTable("dbo.Sectors"); DropTable("dbo.ProjectProfiles"); DropTable("dbo.FinancingProfileExternals"); DropTable("dbo.Regions"); DropTable("dbo.Districts"); DropTable("dbo.DefferementHistories"); DropTable("dbo.ProjectProfileExternals"); DropTable("dbo.CountryInvestments"); DropTable("dbo.Countries"); DropTable("dbo.CompanyShareholderExternals"); DropTable("dbo.CompanyAmmendmentExternals"); DropTable("dbo.CompanyAmmendments"); DropTable("dbo.Attachments"); DropTable("dbo.InvestorProfileExternals"); DropTable("dbo.CompanyProfileExternals"); DropTable("dbo.ApplicationManagers"); } } }