:: Think Code Execute ::

Think Code Excute

:: JQuery Tools ::

As nice as we know the JQuery Plugin her is a nice tool

which include :

Tabs

http://flowplayer.org/tools/demos/tabs/index.html

Tooltip

http://flowplayer.org/tools/demos/tooltip/index.html

Overlay

http://flowplayer.org/tools/demos/overlay/index.html

Expose

http://flowplayer.org/tools/demos/expose/index.html

and many other

have a nice programming !

October 24, 2009 Posted by eshbeata | :: JQuery :: | | No Comments Yet

:: Sorry for this pause ::

Sorry for not posting anything lately

but sure u wait for the new upcoming !

including :

JQuery

Windows Mobile Development

Asp.net

C#.net

Cheat Engine Hack Facebook Application

and more … soon

October 23, 2009 Posted by eshbeata | :: Random :: | | No Comments Yet

:: Md5 Encryption C#.net ::

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
/// <summary>
/// Summary description for db
/// </summary>
public class db
{
public static string connectionstring = @”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True”;
public db()
{
//
// TODO: Add constructor logic here
//
}
//function login for string
public bool login(string user, string pass)
{
//connection to the database
SqlConnection con = new SqlConnection(connectionstring);
//sql query to retreive data
string sql = “select password from student where student_id =  @user”;
//sql paramterize to secure the sql injection attack
SqlParameter pl = new SqlParameter(“@user”, user);
//sql command
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add(pl);
//open the connection
con.Open();
//reader to excute the sql query of sql command
SqlDataReader rdr = cmd.ExecuteReader();
bool log = false;
//check if the reader can read
if (rdr.Read())
{
//conver the password to md5 hash encryption
string password = GetMD5Hash(pass);
//check if the password equal the pass in database
if (rdr[0].ToString() == password)
{
log = true;
}
}
//close the reader
rdr.Close();
//close the connection
con.Close();
return log;
}
//md5 function ecryption
public string GetMD5Hash(string input)
{
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] bs = System.Text.Encoding.UTF8.GetBytes(input);
bs = x.ComputeHash(bs);
System.Text.StringBuilder s = new System.Text.StringBuilder();
foreach (byte b in bs)
{
s.Append(b.ToString(“x2″).ToLower());
}
string password = s.ToString();
return password;
}
//admin login function
public bool login_admin(string user, string pass)
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select password from Admin where username = @user”;
SqlParameter pl = new SqlParameter(“@user”, user);
SqlCommand cmd = new SqlCommand(sql, con);
cmd.Parameters.Add(pl);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
bool log = false;
if (rdr.Read())
{
string password = GetMD5Hash(pass);
if (rdr[0].ToString() == password)
{
log = true;
}
}
rdr.Close();
con.Close();
return log;
}
//get the vote of each nomine to view it in result
public string get_voting(string id)
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select vote from nomeni where Student_ID= ‘”+ id + “‘ “;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
string vote = “”;
if (rdr.Read())
{
vote = rdr[0].ToString();
}
rdr.Close();
con.Close();
return vote;
}
//get the statiscits data
public string [] set_election_year()
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select count(*) , sum(vote) from student”;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
string vote = “”;
string unvote = “”;
if (rdr.Read())
{
unvote = rdr[0].ToString();
vote = rdr[1].ToString();
}
rdr.Close();
con.Close();
string[] x = new string[2];
x[0] = unvote;
x[1] = vote;
return x;
}
//check if student id already exist in adduser page
public bool check_user_exist(string user)
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select student_id from student where student_id = ‘” + user + “‘”;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
bool log = false;
if (rdr.Read())
{
if (rdr[0].ToString() == user)
{
log = true;
}
}
rdr.Close();
con.Close();
return log;
}
//get nomine data to view it on vote page
public SqlDataReader  get_nomine(string user)
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select * from nomeni where student_id = ‘” + user + “‘”;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
bool log = false;
rdr.Read();
return rdr;
}
//get date time data
public SqlDataReader get_year()
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select * from timedate”;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
rdr.Read();
return rdr;
}
//check if student already vote
public string checkvoting(string user)
{
SqlConnection con = new SqlConnection(connectionstring);
string sql = “select vote from student where student_id = ‘” + user + “‘”;
SqlCommand cmd = new SqlCommand(sql, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
string vote = “”;
if (rdr.Read())
{
vote = rdr[0].ToString();
}
rdr.Close();
con.Close();
return vote;
}
public void voting(string std_id)
{
}
}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Data.SqlClient;

/// <summary>

/// Summary description for db

/// </summary>

public class db

{

public static string connectionstring = @”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True”;

public db()

{

//

Read more »

June 9, 2009 Posted by eshbeata | :: C#.net :: | , , | No Comments Yet

:: Imagine Cup Interoperability Award Winner ::

Interoperability Award:

Country/Region Finalist Team Name
Jordan ECRAM
Poland fteams
Brazil Proativa Team

my Ecram Team had won in the Interoperability Award World Wide Competition on Microsofot Imagine Cup

Can’t Wait to go To Egypt :)

June 9, 2009 Posted by eshbeata | :: Windows :: | , , | 2 Comments

:: Building an N-Tier Application in .NET ::

Introduction : 

a lot of people think that building a N-tier application is so diffucult

but to think about it , its alot easy and make sense

its just make partion of the project

 

Background

N-Tier is a Client-Server Architecture in which User interface (Presentation Layer), Business Rules(Business Logic Layer), Data Access(Data Layer) are separated in Layers, maintained and Developed Indipendently. The Applicatin will be broken into Tiers. Presentation Layer will be your Form or ASP.NEt page, Busines Layer will be the Classes that will Check if the Business Rules have not been Violeted, and the Data Access layer will Accept the Validated Data from the Business Logic layer and run the SQl commands on the Actual Database.

 

n-tier

as you see in the figure below this is the Architecture of the N-Tier application

 

  1. Presentation Layer : contain all user interface and GUI , including ASp.net pages … etc
  2. Business Layer: contain all rules and class to manupliate the logaical of the application and communicate with the Data Access Layer
  3. Data Access Layer : here is where the Stored Procuder are , class that handle Data Base connection .

Have a Nice Day ^_^

March 4, 2009 Posted by eshbeata | :: Asp.net :: | , , , | No Comments Yet