Ejemplo n.º 1
0
        public DataSet GetInvoiceByID(int trackingID)

        {
            StringBuilder  sql;
            SqlDataAdapter da;
            DataSet        invoicedata;

            SqlConnection conn = dbConn.GetConnection();

            invoicedata = new DataSet();
            sql         = new StringBuilder();
            sql.AppendLine("SELECT * ");
            sql.AppendLine("FROM Invoice WHERE trackingID=@trackingID");

            try
            {
                da = new SqlDataAdapter(sql.ToString(), conn);
                da.SelectCommand.Parameters.AddWithValue("trackingID", trackingID);
                da.Fill(invoicedata);
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
            }
            finally
            {
                conn.Close();
            }

            return(invoicedata);
        }
Ejemplo n.º 2
0
        public DataSet GetPOListFiltered(string status)
        {
            StringBuilder  sql;
            SqlDataAdapter da;
            DataSet        ProgramData;

            DalDbConn dbConn = new DalDbConn();

            SqlConnection conn = dbConn.GetConnection();

            ProgramData = new DataSet();
            sql         = new StringBuilder();
            sql.AppendLine("SELECT *");
            sql.AppendLine("FROM Delivery");
            sql.AppendLine("WHERE deliveryStatus = @PS");
            sql.AppendLine("ORDER BY trackingID DESC");

            try
            {
                da = new SqlDataAdapter(sql.ToString(), conn);
                da.SelectCommand.Parameters.AddWithValue("PS", status);
                da.Fill(ProgramData);
            }
            catch (Exception ex)
            {
                string errMsg = ex.Message;
            }
            finally
            {
                conn.Close();
            }
            return(ProgramData);
        }