Thursday, January 26, 2012

Class File : Navigation.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

///
/// Summary description for Navigation
///

public class Navigation
{
public Navigation()
{
//
// TODO: Add constructor logic here
//
}

public void nav_fn(System.Web.UI.WebControls.Menu mn)
{
if (mn.SelectedValue == "Home")
{
System.Web.HttpContext.Current.Response.Redirect("~/Reporter.aspx");

}
else if (mn.SelectedValue == "Dashboards")
{
System.Web.HttpContext.Current.Response.Redirect("~/Dashboards.aspx");

}
else if (mn.SelectedValue == "Settings")
{
System.Web.HttpContext.Current.Response.Redirect("~/Settings.aspx");

}
else if (mn.SelectedValue == "Logout")
{
System.Web.HttpContext.Current.Response.Cookies["AVAYA_Realtime"].Expires = DateTime.Now.AddDays(-1);
System.Web.HttpContext.Current.Response.Redirect("~/login.aspx");


}

}
}

Class File : MSColumn3D.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using InfoSoftGlobal;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Collections.Generic;
using System.Configuration;
///
/// Summary description for MSColumn3D
///

public class MSColumn3D
{
MySqlCommand cmd;
MySqlDataReader dr;

public string strXML = "";


public MSColumn3D()
{

}
public string MSCol3D_Charts(string sqlstr, string charttype, string chartid, string xaxis, string pyaxis, string syaxis)
{
strXML = "";
strXML += "";

string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);
con.Open();

//cmd = new MySqlCommand("select * from avaya_rt_db where `" + xaxis + "` like 'Bel%' and " + yaxis + "!=0", con);
cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();

strXML += "";

while (dr.Read())
{
strXML += "";

}
dr.Close();
strXML += "
";

strXML += "";

cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
strXML += "";

}
dr.Close();
strXML += "
";

strXML += "";

cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
strXML += "";
}
dr.Close();
strXML += "
";

strXML += "
";

con.Close();


return FusionCharts.RenderChartHTML(charttype, "", strXML, chartid, "400", "300", false);

}
}

Class File : login_class.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Configuration;

///
/// Summary description for login_class
///

public class login_class
{
public string loginID;
public string password;
public string ename;
MySqlCommand cmd;

public login_class()
{

}
public void loginfn(string sqlstr)
{

string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);

con.Open();
cmd = new MySqlCommand(sqlstr, con);


MySqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
loginID = dr["Userid"].ToString();
password = dr["Password"].ToString();
ename = dr["Username"].ToString();

}

con.Close();

}
}

Class File : Dropdown.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Data;
using System.Configuration;
using System.Web.UI.WebControls;
using System.IO;

///
/// Summary description for Dropdown
///

public class Dropdown
{
MySqlCommand cmd;
MySqlDataReader dr;

public Dropdown()
{
//
// TODO: Add constructor logic here
//
}
public void dataread(string sqlstr, DropDownList list, string fieldname)
{
try
{
list.Items.Clear();
list.Items.Add("All");
list.SelectedValue = "All";

string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);
con.Open();

cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
list.Items.Add(dr[fieldname].ToString());
}
dr.Close();

con.Close();
}
catch (Exception ex)
{
ex.ToString();
}
}
}

Class File : Dataread.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Data;
using System.Configuration;
using System.Web.UI.WebControls;
using System.IO;

///
/// Summary description for Dataread
///

public class Dataread
{
MySqlCommand cmd;
MySqlDataReader dr;

public Dataread()
{
//
// TODO: Add constructor logic here
//
}
public void fileread(string sqlstr, GridView grdview)
{
try
{
string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);
con.Open();

cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();
grdview.DataSource = dr;
grdview.DataBind();
dr.Close();

con.Close();
}
catch (Exception ex)
{
ex.ToString();
}
}
}

Class File : Datachart.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Data;
using System.Configuration;
using System.Web.UI.WebControls;
using System.IO;
using System.Collections;
using System.Web.UI.DataVisualization.Charting;

///
/// Summary description for Datachart
///

public class Datachart
{
MySqlConnection con;
MySqlCommand cmd;
MySqlDataReader dr;
public string skillname;
public int queuecount;
public string runtime;

public Datachart()
{
//
// TODO: Add constructor logic here
//
}
public void chart(string sqlstr, string xval, string yval, Chart chartname)
{
ArrayList yVal_Overall = new ArrayList();
ArrayList xVal_Overall = new ArrayList();

string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);
con.Open();

cmd = new MySqlCommand(sqlstr, con);

dr = cmd.ExecuteReader();
while (dr.Read())
{
skillname = dr[xval].ToString();
queuecount = Convert.ToInt32(dr[yval]);
xVal_Overall.Add(skillname);
yVal_Overall.Add(queuecount);
}
dr.Close();
chartname.Series[0].Points.DataBindXY(xVal_Overall, yVal_Overall);


cmd = new MySqlCommand("select distinct(ACD) from avaya_rt_db where length(ACD)>5", con);
runtime = Convert.ToString(cmd.ExecuteScalar());
runtime = "Last run time of the AVAYA Script is " + runtime;

con.Close();

}

}

Class File : Combination2D.cs

-------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using InfoSoftGlobal;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Configuration;
///
/// Summary description for Combination2D
///

public class Combination2D
{
MySqlCommand cmd;
MySqlDataReader dr;

public string strXML = "";
public int i = 0;
List colors = new List();
string temp;

public Combination2D()
{
colors.Add("AFD8F8");
colors.Add("F6BD0F");
colors.Add("8BBA00");
colors.Add("FF8E46");
colors.Add("008E8E");
colors.Add("D64646");
colors.Add("8E468E");
colors.Add("588526");
colors.Add("B3AA00");
colors.Add("008ED6");
colors.Add("9D080D");
colors.Add("A186BE");
}

public string CombinationCharts(string sqlstr,string charttype, string chartid, string xaxis, string pyaxis, string syaxis)
{
i = 0;
strXML = "";

if (syaxis == "M-Wait")
{
strXML += "";
}
else
{
temp = pyaxis.Remove(2);
strXML += "";
}

string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);
con.Open();

// cmd = new MySqlCommand("select * from avaya_rt_db where `" + xaxis + "` like '%' and `" + pyaxis + "`!=0 or `" + syaxis + "`!=0", con);
cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();

strXML += "";


while (dr.Read())
{
strXML += "";
}
dr.Close();
strXML += "
";

if (pyaxis == "Q")
strXML += "";
else
strXML += "";

//cmd = new MySqlCommand("select * from avaya_rt_db where `" + xaxis + "` like '%' and `" + pyaxis + "`!=0 or `" + syaxis + "`!=0", con);
cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
if (i < colors.Count)
{
strXML += "";
}
}
dr.Close();
strXML += "
";

strXML += "";

//cmd = new MySqlCommand("select * from avaya_rt_db where `" + xaxis + "` like '%' and `" + pyaxis + "`!=0 or `" + syaxis + "`!=0", con);
cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
strXML += "";
}
dr.Close();
strXML += "
";

strXML += "
";

con.Close();


return FusionCharts.RenderChartHTML(charttype, "", strXML, chartid, "470", "300", false);

}

}

Class File : Column3D.cs

--------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using InfoSoftGlobal;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Configuration;

///
/// Summary description for Column3D
///

public class Column3D
{
MySqlCommand cmd;
MySqlDataReader dr;

public string strXML = "";
public int i = 0;
List colors = new List();

public Column3D()
{
colors.Add("AFD8F8");
colors.Add("F6BD0F");
colors.Add("8BBA00");
colors.Add("FF8E46");
colors.Add("008E8E");
colors.Add("D64646");
colors.Add("8E468E");
colors.Add("588526");
colors.Add("B3AA00");
colors.Add("008ED6");
colors.Add("9D080D");
colors.Add("A186BE");

}
public string BasicCharts(string sqlstr,string charttype, string chartid, string xaxis, string yaxis)
{


i = 0;
strXML = "";
strXML += "";

string connectionInfo = ConfigurationManager.AppSettings["ConnectionInfo"];
MySqlConnection con = new MySqlConnection(connectionInfo);
con.Open();

//cmd = new MySqlCommand("select * from avaya_rt_db where `" + xaxis + "` like 'Bel%' and " + yaxis + "!=0", con);
cmd = new MySqlCommand(sqlstr, con);
dr = cmd.ExecuteReader();


while (dr.Read())
{

if (i < colors.Count)
strXML += "";
i++;

}
dr.Close();


strXML += "
";

con.Close();


return FusionCharts.RenderChartHTML(charttype, "", strXML, chartid, "470", "300", false);

}
}

Toggle using JQuery in ASP.NET


JQuery in ASP.NET