Ejemplo n.º 1
0
    public int CalculateItemOnHandQty(string companyCode, string TransID, string TransNo, string RetailID)
    {
        clsDataAccessor dataAccessor = new clsDataAccessor();

        dataAccessor.connectionstring = dataAccessor.getConnectionString_Vapt(dataAccessor, companyCode);

        MySqlParameter[] objParam =
        {
            dataAccessor.InputParam("pID",       MySqlDbType.Int32,   25, TransID.ToString()),
            dataAccessor.InputParam("pTransNo",  MySqlDbType.VarChar, 30, TransNo.ToString()),
            dataAccessor.InputParam("pRetailID", MySqlDbType.Int32,   25, RetailID.ToString())
        };

        int intresult = 0;

        try
        {
            intresult = dataAccessor.Exec_SPNonReturn("RecalculateOnHandQtyBySales", objParam);
            return(intresult);
        }
        catch (MySqlException ex)
        {
            string errMessage = ("ERROR SOURCE: "
                                 + (ex.Source + "<br/>"));
            errMessage = (errMessage + (" ERROR MESSAGE: "
                                        + (ex.Message + "<br/>")));
            errMessage = (errMessage + (" ERROR CODE: "
                                        + (ex.ErrorCode.ToString() + "<br/>")));
            errMessage = (errMessage + (" ERROR CODE: "
                                        + (ex.StackTrace.ToString() + "<br/>")));

            return(0);
        }
        finally
        {
            dataAccessor = null;
        }

        return(intresult);
    }