public string Logoin(string name, string passi) { SqlCommand cmd = new SqlCommand("mjekutbl", conn.koneksion()); cmd.Parameters.AddWithValue("@Name", name); cmd.Parameters.AddWithValue("@Passi", passi); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { System.Web.HttpContext.Current.Session["ID"] = dr["ID"].ToString(); System.Web.HttpContext.Current.Session["Departament"] = dr["Departament"].ToString(); System.Web.HttpContext.Current.Session["Name"] = dr["Name"].ToString(); System.Web.HttpContext.Current.Session["Email"] = dr["Email"].ToString(); System.Web.HttpContext.Current.Session["Passi"] = dr["Passi"].ToString(); if ((string)System.Web.HttpContext.Current.Session["Departament"] == "Admin") { HttpContext.Current.Response.Redirect("admin.aspx"); } else { HttpContext.Current.Response.Redirect("doctorLog.aspx"); } } else { HttpContext.Current.Response.Redirect("login.aspx"); } conn.koneksion().Close(); return(" "); }
public SqlDataReader SelectDepartament() { DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("depert", con.koneksion()); cmd.CommandType = CommandType.StoredProcedure; con.koneksion().Close(); return(cmd.ExecuteReader()); }
public void DeleteDep(int ID) { Koneksion cn = new Koneksion(); SqlCommand cmd = new SqlCommand("deletedepartamenti", cn.koneksion()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", ID); cmd.ExecuteNonQuery(); cn.koneksion().Close(); }
public void AddDep(string img, string dep, string sqarim) { Koneksion cn = new Koneksion(); SqlCommand cmd = new SqlCommand("adddepartamenti", cn.koneksion()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Img", img); cmd.Parameters.AddWithValue("@Dep", dep); cmd.Parameters.AddWithValue("@Sqarim", sqarim); cmd.ExecuteNonQuery(); cn.koneksion().Close(); }
public string DeleteDoc(int ID) { Koneksion cn = new Koneksion(); SqlCommand cmd = new SqlCommand("deletedoctor", cn.koneksion()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", ID); cmd.ExecuteNonQuery(); cn.koneksion().Close(); return("Delete"); }
public string AddDoc(string foto, string emri, string dep, string email, string passi, string book, string teli, string work, string sat) { Koneksion cn = new Koneksion(); SqlCommand cmd = new SqlCommand("adddoctor", cn.koneksion()); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Img", foto); cmd.Parameters.AddWithValue("@Name", emri); cmd.Parameters.AddWithValue("@Departament", dep); cmd.Parameters.AddWithValue("@Email", email); cmd.Parameters.AddWithValue("@Passi", passi); cmd.Parameters.AddWithValue("@book", book); cmd.Parameters.AddWithValue("@Number", teli); cmd.Parameters.AddWithValue("@MonFri", work); cmd.Parameters.AddWithValue("@Sat", sat); cmd.ExecuteNonQuery(); cn.koneksion().Close(); return(" Save"); }
protected void Button2_Click(object sender, EventArgs e) { HttpContext.Current.Session["ID"] = ID; Koneksion c1 = new Koneksion(); c1.koneksion(); Logo class2 = new Logo(); class2.Logoin(TextBox1.Text, TextBox2.Text); class2.log(TextBox1.Text); HttpContext.Current.Response.Redirect("doctorLog.aspx"); }
public DataTable SelectDep() { Koneksion cn = new Koneksion(); DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("selectdepartamenti", cn.koneksion()); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; da.Fill(ds, "departament"); return(ds.Tables["departament"]); }
public DataTable SelectDoc() { DataSet ds = new DataSet(); Koneksion cn = new Koneksion(); SqlCommand cmd = new SqlCommand("selectdoctor", cn.koneksion()); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; da.Fill(ds, "doctor"); return(ds.Tables["doctor"]); }
protected void Page_Load(object sender, EventArgs e) { if (System.Web.HttpContext.Current.Request.QueryString["ID"] != null) { using (con.koneksion()) { SqlCommand cmd = new SqlCommand("depertID", con.koneksion()); cmd.Parameters.AddWithValue("@ID", System.Web.HttpContext.Current.Request.QueryString["ID"]); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { Image1.ImageUrl = dr["Img2"].ToString(); Image2.ImageUrl = dr["Img1"].ToString(); h3_titulli.InnerText = dr["Heder"].ToString(); li.InnerText = dr["Doctors"].ToString(); note.InnerText = dr["Note"].ToString(); } } } //Dep depi = new Dep(); //depi.IDDepartament(li.InnerText, h3_titulli.InnerText, Image1.ImageUrl, note.InnerText); }
public DataTable searchDoc(string name) { Koneksion con = new Koneksion(); DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("SeachDoctor"); cmd.Parameters.AddWithValue("@Name", name); cmd.Connection = con.koneksion(); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "doctor"); return(ds.Tables[0]); }
public DataTable search(string a) { Koneksion con = new Koneksion(); DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("SearchGri"); cmd.Parameters.AddWithValue("@Name", a); cmd.Parameters.AddWithValue("@IDs", HttpContext.Current.Session["ID"].ToString()); cmd.Connection = con.koneksion(); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(ds, "pacient"); return(ds.Tables[0]); }
public DataTable Select() { using (con.koneksion()) { using (SqlCommand cmd = new SqlCommand("GridPa")) { cmd.Parameters.AddWithValue("@IDm", HttpContext.Current.Session["ID"].ToString()); cmd.Parameters.AddWithValue("@Action", "SELECT"); using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con.koneksion(); sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); return(dt); } } } } }