コード例 #1
0
ファイル: FAQ.cs プロジェクト: vgleddie19/VGLWMS-v1
    public static DataTable GetOMSIncomingDetails(String shipment_id)
    {
        Utils.SetConnectionDetails();
        dbConnectionSettings = Utils.DBConnection;
        DataSupport oms_dh = new DataSupport("Initial Catalog=" + Utils.DBConnection["OMS"]["DBNAME"] + ";Data Source=" + Utils.DBConnection["OMS"]["SERVER"] + ";User Id = " + Utils.DBConnection["OMS"]["USERNAME"] + "; Password = "******"OMS"]["PASSWORD"]);
        DataSet     set    = oms_dh.ExecuteDataSet(@"SELECT Product, Uom, lot_no, expiry, expected_qty  FROM IncomingShipmentRequestDetails WHERE shipment = '" + shipment_id + "'");

        return(set.Tables[0]);
    }
コード例 #2
0
ファイル: FAQ.cs プロジェクト: vgleddie19/VGLWMS-v1
    public static DataTable GetOMSIncoming()
    {
        Utils.SetConnectionDetails();
        dbConnectionSettings = Utils.DBConnection;
        DataSupport oms_dh = new DataSupport("Initial Catalog=" + Utils.DBConnection["OMS"]["DBNAME"] + ";Data Source=" + Utils.DBConnection["OMS"]["SERVER"] + ";User Id = " + Utils.DBConnection["OMS"]["USERNAME"] + "; Password = "******"OMS"]["PASSWORD"]);
        DataSet     set    = oms_dh.ExecuteDataSet(@"SELECT * FROM IncomingShipmentRequests WHERE status = 'FOR RECEIVING' AND warehouse = '" + DataSupport.GetWarehouseCode() + "' ;");

        return(set.Tables[0]);
    }
コード例 #3
0
    public static decimal GetPrice(String client, String product, String uom)
    {
        decimal result = 0;
        // Check Promo Price Lists (to be done later)

        // Check Default Price List
        DataSupport oms = Connection.GetOMSConnection;

        result = decimal.Parse(oms.ExecuteDataSet($"SELECT price FROM itemPrice WHERE client = '{client}'  product = '{product}' AND uom ='{uom}'").Tables[0].Rows[0][0].ToString());

        return(result);
    }
コード例 #4
0
    public static decimal GetDocValue(String out_shipment_id)
    {
        decimal     result = 0;
        DataSupport oms_dh = Connection.GetOMSConnection;
        DataTable   dt     = oms_dh.ExecuteDataSet("SELECT client, product, uom, expected_qty, price FROM OutgoingShipmentRequestDetails " +
                                                   $"INNER JOIN OutgoingShipmentRequests ON out_shipment = out_shipment_id WHERE out_shipment = '{ out_shipment_id }';").Tables[0];

        foreach (DataRow row in dt.Rows)
        {
            var price  = GetPrice(row["client"].ToString(), row["product"].ToString(), row["uom"].ToString());
            var amount = price * decimal.Parse(row["expected_qty"].ToString());
            result += amount;
        }

        return(result);
    }