Ejemplo n.º 1
0
 public DS_Agent.AgentReceivablesDataTable GetAgentOrder(int orderID)
 {
     string sql = @"
     SELECT a.orderID, o.firstName+'.'+o.lastName as username,
      a.agentID, a.agentReceivable, a.agentPaid, a.orderClosedDate,
       c.companyName, c.companyName_cn, a.status
     FROM AgentOrders AS a LEFT OUTER JOIN
       Company AS c ON a.agentID = c.companyId
     left join orders as o on a.orderID=o.orderID
     WHERE a.orderID=@orderID";
     DS_Agent ds = new DS_Agent();
     SqlParameter[] para = {
         new SqlParameter("@orderID", orderID)
     };
     m_dao.FillDataSet(ds, "NewAgentOrders", sql, para);
     return ds.AgentReceivables;
 }
Ejemplo n.º 2
0
        public DS_Agent.AgentReceivablesDataTable AgentNewReceivableByAgentID_noused(int agentID)
        {
            string sql = @"
            SELECT a.invoiceID, a.orderID, o.firstName+'.'+o.lastName as username,
            a.agentID, a.agentReceivable, a.additionalDiscount, a.agentPaid, a.agentReceivable-a.additionalDiscount-agentPaid as balance, a.orderClosedDate, a.reportDate,
            c.companyName, c.companyName_cn, a.status
            FROM AgentOrders AS a
            left join Company AS c ON a.agentID = c.companyId
            left join orders as o on a.orderID=o.orderID
            WHERE a.agentID=@agentID and a.invoiceID=0
            ORDER BY a.orderID desc";

            DS_Agent ds = new DS_Agent();
            SqlParameter[] para = {
                new SqlParameter("@agentID", agentID)
            };
            m_dao.FillDataSet(ds, "AgentReceivables", sql, para);
            return ds.AgentReceivables;
        }
Ejemplo n.º 3
0
        public DS_Agent.AgentReceivablesDataTable AgentReceivablesQuery_noused()
        {
            string sql = @"
            SELECT a.invoiceID, a.orderID, o.firstName+'.'+o.lastName as username,
            a.agentID, a.agentReceivable, a.additionalDiscount, a.agentPaid, a.orderClosedDate, a.reportDate,
            c.companyName, c.companyName_cn, a.status
            FROM AgentOrders AS a
            left join Company AS c ON a.agentID = c.companyId
            left join orders as o on a.orderID=o.orderID
            WHERE a.status<2
            ORDER BY c.companyName";

            DS_Agent ds = new DS_Agent();
            m_dao.FillDataSet(ds, "AgentReceivables", sql, null);
            return ds.AgentReceivables;
        }