예제 #1
0
        private void PackageIssueInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("PackageIssues", "PackageIssueID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.PackageIssue));

            this.totalSmartPortalEntities.CreateTrigger("PackageIssueInitReference", simpleInitReference.CreateQuery());

            string queryString = " @PackageIssueID int " + "\r\n";

            queryString = queryString + " WITH ENCRYPTION " + "\r\n";
            queryString = queryString + " AS " + "\r\n";
            queryString = queryString + "       SELECT TOP 1 Reference FROM PackageIssues WHERE PackageIssueID = @PackageIssueID " + "\r\n";
            this.totalSmartPortalEntities.CreateStoredProcedure("PackageIssueGetReference", queryString);
        }
예제 #2
0
        private void PurchaseOrderInitReference()
        {
            ////CHU Y: FOR EACH PROJECT: STANDARD TRIGGER KHÔNG CÓ TÙY BIẾN BY ProjectID. NOW:  PurchaseOrderInitReference HAS BEEN MODIFY DIRECTLY BY SQL TOOL. HERE WE HAVE A COPY OF THE T-SQL
            ////BELOW IS THE FINAL (CORRECT) TRIGGER. WE MODIFY THIS TRIGGER FROM THE STANDARD TRIGGER

            ////USE [ProjectManager]
            ////GO
            /////****** Object:  Trigger [dbo].[PurchaseOrderInitReference]    Script Date: 24/07/2017 10:18:03 ******/
            ////SET ANSI_NULLS ON
            ////GO
            ////SET QUOTED_IDENTIFIER ON
            ////GO
            ////ALTER TRIGGER [dbo].[PurchaseOrderInitReference]
            //// ON [dbo].[PurchaseOrders] AFTER INSERT
            //// AS
            ////          DECLARE     @LocationID int         SET @LocationID = (SELECT LocationID FROM Inserted)
            ////   DECLARE     @EntityID int           SET @EntityID = (SELECT PurchaseOrderID FROM Inserted)
            ////   DECLARE     @EntryDate DateTime     SET @EntryDate = (SELECT EntryDate FROM Inserted)

            ////   DECLARE     @ProjectID int           SET @ProjectID = (SELECT ProjectID FROM Inserted)

            ////          DECLARE     @PrefixLetter varchar(10)   SET @PrefixLetter = 'D'

            ////   DECLARE     @columnNameMax int
            ////   SET         @columnNameMax = (SELECT MAX(CAST( SUBSTRING(Reference, LEN(@PrefixLetter) + 1, CASE PATINDEX('%.%', Reference) WHEN 0 THEN LEN(Reference) - LEN(@PrefixLetter) ELSE PATINDEX('%.%', Reference) - 1 - LEN(@PrefixLetter) END) AS Int)) AS columnNameMax FROM PurchaseOrders  WHERE LocationID = @LocationID AND ProjectID = @ProjectID
            ////)    IF          @columnNameMax IS NULL SET @columnNameMax = 1 ELSE SET @columnNameMax = @columnNameMax + 1    UPDATE      PurchaseOrders
            ////   SET         Reference = @PrefixLetter + RIGHT(CAST(100000000 + @columnNameMax as varchar), 6 - LEN(@PrefixLetter))
            ////   WHERE       PurchaseOrderID = @EntityID
            //// UPDATE PurchaseOrders SET PoNumber = RIGHT(Reference, 5) WHERE PurchaseOrderID = @EntityID


            //14-JUL-2017: MR TUAN: NO NEED TO INIT REFERENCE BY PROJECT. JUST USE THE STANDARD TRIGGERR
            SimpleInitReference simpleInitReference = new SimpleInitReference("PurchaseOrders", "PurchaseOrderID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.PurchaseOrder));

            this.projectManagerEntities.CreateTrigger("PurchaseOrderInitReference", simpleInitReference.CreateQuery() + " UPDATE PurchaseOrders SET PoNumber = RIGHT(Reference, 5) WHERE PurchaseOrderID = @EntityID ");
        }
예제 #3
0
        private void SalesOrderInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("SalesOrders", "SalesOrderID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.SalesOrder));

            this.totalSmartPortalEntities.CreateTrigger("SalesOrderInitReference", simpleInitReference.CreateQuery());
        }
예제 #4
0
        private void BatchMasterInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("BatchMasters", "BatchMasterID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.BatchMaster));

            this.totalSmartCodingEntities.CreateTrigger("BatchMasterInitReference", simpleInitReference.CreateQuery());
        }
예제 #5
0
 private void AccountInvoiceInitReference()
 {
     SimpleInitReference simpleInitReference = new SimpleInitReference("AccountInvoices", "AccountInvoiceID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.AccountInvoice));
     this.totalBikePortalsEntities.CreateTrigger("AccountInvoiceInitReference", simpleInitReference.CreateQuery());
 }
예제 #6
0
        private void HandlingUnitInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("HandlingUnits", "HandlingUnitID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.HandlingUnit));

            this.totalSalesPortalEntities.CreateTrigger("HandlingUnitInitReference", simpleInitReference.CreateQuery());
        }
예제 #7
0
        private void SemifinishedProductInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("SemifinishedProducts", "SemifinishedProductID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.SemifinishedProduct));

            this.totalSmartPortalEntities.CreateTrigger("SemifinishedProductInitReference", simpleInitReference.CreateQuery());
        }
예제 #8
0
        private void FinishedItemInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("FinishedItems", "FinishedItemID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.FinishedItem));

            this.totalSmartPortalEntities.CreateTrigger("FinishedItemInitReference", simpleInitReference.CreateQuery());
        }
예제 #9
0
        private void GoodsReceiptInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("GoodsReceipts", "GoodsReceiptID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.GoodsReceipt));

            this.totalBikePortalsEntities.CreateTrigger("GoodsReceiptInitReference", simpleInitReference.CreateQuery());
        }
예제 #10
0
        private void PurchaseOrderInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("PurchaseOrders", "PurchaseOrderID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.PurchaseOrder));

            this.totalBikePortalsEntities.CreateTrigger("PurchaseOrderInitReference", simpleInitReference.CreateQuery());
        }
예제 #11
0
        private void AccountInvoiceInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("AccountInvoices", "AccountInvoiceID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.AccountInvoice));

            this.totalSalesPortalEntities.CreateTrigger("AccountInvoiceInitReference", simpleInitReference.CreateQuery());
        }
예제 #12
0
 private void ServiceContractInitReference()
 {
     SimpleInitReference simpleInitReference = new SimpleInitReference("ServiceContracts", "ServiceContractID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.ServiceContract));
     this.totalBikePortalsEntities.CreateTrigger("ServiceContractInitReference", simpleInitReference.CreateQuery());
 }
예제 #13
0
        private void QuotationInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("Quotations", "QuotationID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.Quotation));

            this.totalBikePortalsEntities.CreateTrigger("QuotationInitReference", simpleInitReference.CreateQuery());
        }
예제 #14
0
 private void GoodsReceiptInitReference()
 {
     SimpleInitReference simpleInitReference = new SimpleInitReference("GoodsReceipts", "GoodsReceiptID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.GoodsReceipt));
     this.totalBikePortalsEntities.CreateTrigger("GoodsReceiptInitReference", simpleInitReference.CreateQuery());
 }
예제 #15
0
        private void ServiceContractInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("ServiceContracts", "ServiceContractID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.ServiceContract));

            this.totalBikePortalsEntities.CreateTrigger("ServiceContractInitReference", simpleInitReference.CreateQuery());
        }
예제 #16
0
 private void DeliveryAdviceInitReference()
 {
     SimpleInitReference simpleInitReference = new SimpleInitReference("DeliveryAdvices", "DeliveryAdviceID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.DeliveryAdvices));
     this.totalSmartCodingEntities.CreateTrigger("DeliveryAdviceInitReference", simpleInitReference.CreateQuery());
 }
예제 #17
0
        private void BlendingInstructionInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("BlendingInstructions", "BlendingInstructionID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.BlendingInstruction));

            this.totalSmartPortalEntities.CreateTrigger("BlendingInstructionInitReference", simpleInitReference.CreateQuery());
        }
예제 #18
0
        private void WarehouseAdjustmentInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("WarehouseAdjustments", "WarehouseAdjustmentID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.WarehouseAdjustments));

            this.totalSmartCodingEntities.CreateTrigger("WarehouseAdjustmentInitReference", simpleInitReference.CreateQuery());
        }
예제 #19
0
        private void GoodsDeliveryInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("GoodsDeliveries", "GoodsDeliveryID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.GoodsDelivery));

            this.totalSmartPortalEntities.CreateTrigger("GoodsDeliveryInitReference", simpleInitReference.CreateQuery());
        }
예제 #20
0
        private void MaterialIssueInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("MaterialIssues", "MaterialIssueID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.MaterialIssue));

            this.totalSmartPortalEntities.CreateTrigger("MaterialIssueInitReference", simpleInitReference.CreateQuery());
        }
예제 #21
0
 private void QuotationInitReference()
 {
     SimpleInitReference simpleInitReference = new SimpleInitReference("Quotations", "QuotationID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.Quotation));
     this.totalBikePortalsEntities.CreateTrigger("QuotationInitReference", simpleInitReference.CreateQuery());
 }
예제 #22
0
 private void TransferOrderInitReference()
 {
     SimpleInitReference simpleInitReference = new SimpleInitReference("TransferOrders", "TransferOrderID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.TransferOrder));
     this.totalBikePortalsEntities.CreateTrigger("TransferOrderInitReference", simpleInitReference.CreateQuery());
 }
예제 #23
0
        private void CommoditySettingInitReference()
        {
            SimpleInitReference simpleInitReference = new SimpleInitReference("CommoditySettings", "CommoditySettingID", "Reference", ModelSettingManager.ReferenceLength, ModelSettingManager.ReferencePrefix(GlobalEnums.NmvnTaskID.CommoditySettings));

            this.totalSmartCodingEntities.CreateTrigger("CommoditySettingInitReference", simpleInitReference.CreateQuery());
        }