public void GetEmployeeList() { List <cGetEmployeeList> emps = new List <cGetEmployeeList>(); SqlCommand comm = new SqlCommand("spGetEmployeeList", conn.OpenConn()); comm.CommandType = CommandType.StoredProcedure; SqlDataReader rdr = comm.ExecuteReader(); while (rdr.Read()) { cGetEmployeeList emp = new cGetEmployeeList(); emp.emp_id = rdr["emp_id"].ToString(); emp.prefix = rdr["prefix"].ToString(); emp.firstname = rdr["firstname"].ToString(); emp.lastname = rdr["lastname"].ToString(); emp.username = rdr["username"].ToString(); emp.name_desc = rdr["name_desc"].ToString(); emp.urlview = rdr["urlview"].ToString(); emp.urltrash = rdr["urltrash"].ToString(); emps.Add(emp); } JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.ContentType = "application/json"; Context.Response.Write(js.Serialize(emps)); conn.CloseConn(); }
public void GetDataMemberSignIn(string macaddress) { List <cGetDataSignIn> members = new List <cGetDataSignIn>(); SqlCommand comm = new SqlCommand("spGetRememberlist", conn.OpenConn()); comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithValue("@macaddress", macaddress); SqlDataReader rdr = comm.ExecuteReader(); while (rdr.Read()) { cGetDataSignIn cGetDataSignIn = new cGetDataSignIn(); cGetDataSignIn.macaddress = rdr["macaddress"].ToString(); cGetDataSignIn.username = rdr["username"].ToString(); cGetDataSignIn.password = rdr["password"].ToString(); cGetDataSignIn.isremember = Convert.ToInt32(rdr["isremember"]); members.Add(cGetDataSignIn); } JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.ContentType = "application/json"; Context.Response.Write(js.Serialize(members)); conn.CloseConn(); }
public void GetInsertMenuPage(string mnu_type_id, string mnu_page, string mnu_title, string mnu_seqno, string isactive, string created_by, string create_date, string update_by, string update_date) { //List<GetInsertCompany> companies = new List<GetInsertCompany>(); //using (SqlConnection conn = new SqlConnection(cs)) //{ //conn.OpenConn(); SqlCommand comm = new SqlCommand("spInsertMenuPage", conn.OpenConn()); comm.CommandType = CommandType.StoredProcedure; comm.Parameters.AddWithValue("@mnu_type_id", mnu_type_id); comm.Parameters.AddWithValue("@mnu_page", mnu_page); comm.Parameters.AddWithValue("@mnu_title", mnu_title); comm.Parameters.AddWithValue("@mnu_seqno", mnu_seqno); comm.Parameters.AddWithValue("@isactive", isactive); comm.Parameters.AddWithValue("@created_by", created_by); comm.Parameters.AddWithValue("@create_date", create_date); comm.Parameters.AddWithValue("@update_by", update_by); comm.Parameters.AddWithValue("@update_date", update_date); comm.ExecuteNonQuery(); conn.CloseConn(); // } }