예제 #1
0
        //--------------  Edit Issuse Information --------------------------------


        public void EditIssueInformation(DBSite site, SalePurchaseDetail from_product, SalePurchaseDetail to_product, string product_ledger_number)
        {
            string qry = " ";

            qry = " UPDATE tblProductLedger SET "
                  + " BillDate = '" + from_product.MovementDate + " '"
                  + ", ProductId = " + from_product.productAutoId
                  + ", SoldQty = " + from_product.qty
                  + ", LocationId = " + from_product.locationId
                  + Util_BLL.GetUserWhereCondition(Util_BLL.User);

            qry += " AND ProductLedgerNumber = " + product_ledger_number
                   + " AND SourceId = " + TransactionType.StockMovement
                   + " AND drcr = 'C'";


            site.Execute(qry);


            qry = " UPDATE tblProductLedger SET "
                  + " BillDate = '" + to_product.MovementDate + " '"
                  + ", ProductId = " + to_product.productAutoId
                  + ", BoughtQty = " + to_product.qty
                  + ", LocationId = " + to_product.locationId
                  + Util_BLL.GetUserWhereCondition(Util_BLL.User);

            qry += " AND ProductLedgerNumber = " + product_ledger_number
                   + " AND SourceId = " + TransactionType.StockMovement
                   + " AND drcr = 'D'";


            site.Execute(qry);
        }
예제 #2
0
        //- -----------------------  Save Issue Information -------------------------------------------------------------------

        public void SaveIssueInformation(DBSite site, SalePurchaseDetail from_product, SalePurchaseDetail to_product)
        {
            int productLedgerNumber = util.GetAutoNumber(site, "ProductLedgerNumber");

            string qry = "";

            qry = " INSERT INTO tblProductLedger( ProductLedgerNumber, drcr , BillDate, ProductID, Soldqty, LocationID, ProductID2, BoughtQty2, LocationID2, SourceId,UserID,subuserId, FYear) "
                  + " VALUES ( "
                  + productLedgerNumber + " "
                  + ", 'C' "
                  + ", '" + from_product.MovementDate + "'"

                  + ", " + from_product.productAutoId
                  + ", " + from_product.qty
                  + ", " + from_product.locationId

                  + ", " + to_product.productAutoId
                  + ", " + to_product.qty
                  + ", " + to_product.locationId


                  + ", " + TransactionType.StockMovement
                  + ", " + util.GetUserInsertQry(Util_BLL.User) //--- current user
                  + " ) ";

            site.Execute(qry);



            qry = " INSERT INTO tblProductLedger( ProductLedgerNumber, drcr , BillDate , ProductID, BoughtQty, LocationID, ProductID2, SoldQty2, LocationID2, SourceId, UserID, subuserId, FYear) "
                  + " VALUES ( "
                  + productLedgerNumber
                  + ", 'D' "
                  + ", '" + to_product.MovementDate + "'"

                  + ", " + to_product.productAutoId
                  + ", " + to_product.qty
                  + ", " + to_product.locationId

                  + ", " + from_product.productAutoId
                  + ", " + from_product.qty
                  + ", " + from_product.locationId



                  + ", " + TransactionType.StockMovement
                  + ", " + util.GetUserInsertQry(Util_BLL.User) //-------  surrent user --------
                  + " ) ";

            site.Execute(qry);
        }