using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.Odbc;
namespace InfoSoftGlobal.BluePrintApp.FC_ASP
{
///
/// Summary description for Data_EmpYearlyOrder.
///
public class Data_EmpYearlyOrder : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
//'This method writes the number of orders the employee processes yearly data as XML.
//'To this page, we're provided employeed Id.
string eId;
eId = Request.QueryString["id"];
Functions functionForWriter = new Functions();
functionForWriter.Write("");
//'Get the data for employee for 3 years - 1994,95,96
functionForWriter.Write("");
functionForWriter.Write("");
functionForWriter.Write("");
functionForWriter.Write("");
}
private string getNumOrders(string eId, string year)
{
//'Initialize database objects
string query;
string numOrders;
//'Retrieve the data
query = "SELECT Count(orderid) As Total FROM FC_Orders WHERE YEAR(OrderDate)=" + year + " and EmployeeID=" + eId ;
using (OdbcConnection connection = DbHelper.Connection(DbHelper.ConnectionStringFisionChart))
{
using (OdbcCommand command = new OdbcCommand(query, connection))
{
using (OdbcDataReader reader= command.ExecuteReader())
{
if (reader.HasRows)
numOrders = reader["Total"].ToString();
else
numOrders = "0";
}
}
connection.Close();
}
return numOrders;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}