Example #1
0
        public void Insert(MatrixPackagePriceHistoryDetails Details)
        {
            try
            {
                string SQL = "CALL procMatrixPackagePriceHistoryInsert(@UID, @PackageID, @ChangeDate, @PurchasePriceNow, @SellingPriceNow, @VAT, @EVAT, @LocalTax, @Remarks);";



                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@UID", Details.UID);
                cmd.Parameters.AddWithValue("@PackageID", Details.PackageID);
                cmd.Parameters.AddWithValue("@ChangeDate", Details.ChangeDate.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.Parameters.AddWithValue("@PurchasePriceNow", Details.PurchasePrice);
                cmd.Parameters.AddWithValue("@SellingPriceNow", Details.Price);
                cmd.Parameters.AddWithValue("@VAT", Details.VAT);
                cmd.Parameters.AddWithValue("@EVAT", Details.EVAT);
                cmd.Parameters.AddWithValue("@LocalTax", Details.LocalTax);
                cmd.Parameters.AddWithValue("@Remarks", Details.Remarks);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                {
                }

                throw base.ThrowException(ex);
            }
        }
Example #2
0
        public void Update(MatrixPackageDetails Details, long pvtUID, DateTime pvtChangeDate, string pvtHistoryRemarks)
        {
            try
            {
                // Update MatrixPackagePriceHistory first to get the history
                MatrixPackagePriceHistoryDetails clsMatrixPackagePriceHistoryDetails = new MatrixPackagePriceHistoryDetails();
                clsMatrixPackagePriceHistoryDetails.UID           = pvtUID;
                clsMatrixPackagePriceHistoryDetails.PackageID     = Details.PackageID;
                clsMatrixPackagePriceHistoryDetails.ChangeDate    = pvtChangeDate;
                clsMatrixPackagePriceHistoryDetails.PurchasePrice = Details.PurchasePrice;
                clsMatrixPackagePriceHistoryDetails.Price         = Details.Price;
                clsMatrixPackagePriceHistoryDetails.VAT           = Details.VAT;
                clsMatrixPackagePriceHistoryDetails.EVAT          = Details.EVAT;
                clsMatrixPackagePriceHistoryDetails.LocalTax      = Details.LocalTax;
                clsMatrixPackagePriceHistoryDetails.Remarks       = pvtHistoryRemarks;

                MatrixPackagePriceHistory clsMatrixPackagePriceHistory = new MatrixPackagePriceHistory(base.Connection, base.Transaction);
                clsMatrixPackagePriceHistory.Insert(clsMatrixPackagePriceHistoryDetails);

                string SQL = "CALL procMatrixPackageUpdate(@PackageID, @MatrixID, @UnitID, @Price, @WSPrice, @PurchasePrice, @Quantity, @VAT, @EVAT, @LocalTax);";

                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@PackageID", Details.PackageID);
                cmd.Parameters.AddWithValue("@MatrixID", Details.MatrixID);
                cmd.Parameters.AddWithValue("@UnitID", Details.UnitID);
                cmd.Parameters.AddWithValue("@Price", Details.Price);
                cmd.Parameters.AddWithValue("@WSPrice", Details.WSPrice);
                cmd.Parameters.AddWithValue("@PurchasePrice", Details.PurchasePrice);
                cmd.Parameters.AddWithValue("@Quantity", Details.Quantity);
                cmd.Parameters.AddWithValue("@VAT", Details.VAT);
                cmd.Parameters.AddWithValue("@EVAT", Details.EVAT);
                cmd.Parameters.AddWithValue("@LocalTax", Details.LocalTax);

                base.ExecuteNonQuery(cmd);

                if (Details.Quantity == 1)
                {
                    ProductVariationsMatrix clsProductVariationsMatrix = new ProductVariationsMatrix(base.Connection, base.Transaction);
                    //clsProductVariationsMatrix.UpdateByPackage(Details.MatrixID, Details.UnitID, Details.Price, Details.WSPrice, Details.PurchasePrice, Details.VAT, Details.EVAT, Details.LocalTax);
                }
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
        public void Insert(MatrixPackagePriceHistoryDetails Details)
        {
            try
            {
                string SQL = "CALL procMatrixPackagePriceHistoryInsert(@UID, @PackageID, @ChangeDate, @PurchasePriceNow, @SellingPriceNow, @VAT, @EVAT, @LocalTax, @Remarks);";

                

                MySqlCommand cmd = new MySqlCommand();
                
                
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@UID", Details.UID);
                cmd.Parameters.AddWithValue("@PackageID", Details.PackageID);
                cmd.Parameters.AddWithValue("@ChangeDate", Details.ChangeDate.ToString("yyyy-MM-dd HH:mm:ss"));
                cmd.Parameters.AddWithValue("@PurchasePriceNow", Details.PurchasePrice);
                cmd.Parameters.AddWithValue("@SellingPriceNow", Details.Price);
                cmd.Parameters.AddWithValue("@VAT", Details.VAT);
                cmd.Parameters.AddWithValue("@EVAT", Details.EVAT);
                cmd.Parameters.AddWithValue("@LocalTax", Details.LocalTax);
                cmd.Parameters.AddWithValue("@Remarks", Details.Remarks);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                
                
                {
                    
                    
                    
                    
                }

                throw base.ThrowException(ex);
            }
        }
Example #4
0
        public void Update(MatrixPackageDetails Details, long pvtUID, DateTime pvtChangeDate, string pvtHistoryRemarks)
        {
            try
            {


                // Update MatrixPackagePriceHistory first to get the history
                MatrixPackagePriceHistoryDetails clsMatrixPackagePriceHistoryDetails = new MatrixPackagePriceHistoryDetails();
                clsMatrixPackagePriceHistoryDetails.UID = pvtUID;
                clsMatrixPackagePriceHistoryDetails.PackageID = Details.PackageID;
                clsMatrixPackagePriceHistoryDetails.ChangeDate = pvtChangeDate;
                clsMatrixPackagePriceHistoryDetails.PurchasePrice = Details.PurchasePrice;
                clsMatrixPackagePriceHistoryDetails.Price = Details.Price;
                clsMatrixPackagePriceHistoryDetails.VAT = Details.VAT;
                clsMatrixPackagePriceHistoryDetails.EVAT = Details.EVAT;
                clsMatrixPackagePriceHistoryDetails.LocalTax = Details.LocalTax;
                clsMatrixPackagePriceHistoryDetails.Remarks = pvtHistoryRemarks;

                MatrixPackagePriceHistory clsMatrixPackagePriceHistory = new MatrixPackagePriceHistory(base.Connection, base.Transaction);
                clsMatrixPackagePriceHistory.Insert(clsMatrixPackagePriceHistoryDetails);

                string SQL = "CALL procMatrixPackageUpdate(@PackageID, @MatrixID, @UnitID, @Price, @WSPrice, @PurchasePrice, @Quantity, @VAT, @EVAT, @LocalTax);";

                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@PackageID", Details.PackageID);
                cmd.Parameters.AddWithValue("@MatrixID", Details.MatrixID);
                cmd.Parameters.AddWithValue("@UnitID", Details.UnitID);
                cmd.Parameters.AddWithValue("@Price", Details.Price);
                cmd.Parameters.AddWithValue("@WSPrice", Details.WSPrice);
                cmd.Parameters.AddWithValue("@PurchasePrice", Details.PurchasePrice);
                cmd.Parameters.AddWithValue("@Quantity", Details.Quantity);
                cmd.Parameters.AddWithValue("@VAT", Details.VAT);
                cmd.Parameters.AddWithValue("@EVAT", Details.EVAT);
                cmd.Parameters.AddWithValue("@LocalTax", Details.LocalTax);

                base.ExecuteNonQuery(cmd);

                if (Details.Quantity == 1)
                {
                    ProductVariationsMatrix clsProductVariationsMatrix = new ProductVariationsMatrix(base.Connection, base.Transaction);
                    //clsProductVariationsMatrix.UpdateByPackage(Details.MatrixID, Details.UnitID, Details.Price, Details.WSPrice, Details.PurchasePrice, Details.VAT, Details.EVAT, Details.LocalTax);
                }
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }