private bool check_Information() { bool found = false; string user_id = text_UserID.Text; string user_password = text_Password.Text; /*SQL code part for check info */ string sql = "SELECT TO_CHAR(COUNT(*)) FROM ADMİN WHERE ID='" + user_id + "' AND PASSWORD='******'"; string exist = null; OracleDB db = new OracleDB("Ata"); db.openConnection(); OracleDataReader reader = db.getDataFromDB(sql); while (reader.Read()) { exist = reader.GetString(0); } if (exist.Equals("1")) { admin_id = user_id; found = true; } db.closeConnection(); return(found); }
protected void Btn_Add_Doctor_Click(object sender, EventArgs e) { Lbl_Doctor_Error.Text = ""; string doc_name = Txt_Doctor_Name.Text; string doc_surname = Txt_Doctor_Surname.Text; string doc_title = Txt_Doctor_Title.Text; string sql = "SELECT ADD_DOCTOR('" + doc_name + "','" + doc_surname + "','" + doc_title + "') FROM DUAL"; string inserted = null; OracleDB db = new OracleDB("Ata"); db.openConnection(); OracleDataReader reader = db.getDataFromDB(sql); while (reader.Read()) { inserted = reader.GetString(0); } if (inserted.Equals("TRUE")) { Lbl_Doctor_Error.Text = "DOCTOR INSERTED REFRESH TABLE"; } else { Lbl_Doctor_Error.Text = "DOCTOR NOT INSERTED CHECK INFO"; } db.closeConnection(); }
protected void Button1_Click(object sender, EventArgs e) { EROR_LABEL.Text = ""; string user_id = Text_UserID.Text; string user_birth = Text_UserBirth.Text; string user_phone = Text_UserPhone.Text; string user_name = Text_UserName.Text; string user_surname = Text_UserSurname.Text; string user_father_name = Text_UserFaterName.Text; string user_sec_num = Text_UserNumber.Text; string system_sec_num = ViewState["sec_num"] as string; string result = null; OracleDB db = new OracleDB("Ata"); db.openConnection(); string sql = "SELECT CHECK_PATIENT_INFO('" + user_id + "','" + user_birth + "','" + user_name + "','" + user_surname + "','" + user_father_name + "') FROM DUAL"; OracleDataReader reader = db.getDataFromDB(sql); while (reader.Read()) { result = reader.GetString(0); } if (result.Equals("TRUE") && user_sec_num.Equals(system_sec_num)) { db.closeConnection(); Response.Redirect("~/Reservation_Screen.aspx?id=" + user_id + "&birth=" + user_birth + "&phone=" + user_phone + "&name=" + user_name + "&surname=" + user_surname + "&father_name=" + user_father_name); } else { EROR_LABEL.Text = "CHECK YOUR INFORMATION !"; ViewState["sec_num"] = SECURITY_number.Text; db.closeConnection(); } }
protected void Page_Load(object sender, EventArgs e) { id = Request.QueryString["id"].ToString(); birth = Request.QueryString["birth"].ToString(); phone = Request.QueryString["phone"].ToString(); name = Request.QueryString["name"].ToString(); surname = Request.QueryString["surname"].ToString(); father_name = Request.QueryString["father_name"].ToString(); db = new OracleDB("Ata"); db.openConnection(); }
protected void Button2_Click(object sender, EventArgs e) { OracleDB db = new OracleDB("Ata"); db.openConnection(); string[] array = new string[pdp_table_names.Length]; string sql = "SELECT * FROM PDP_VIEW "; OracleDataReader reader = db.getDataFromDB(sql); while (reader.Read()) { array[0] = reader.GetString(0); array[1] = reader.GetString(1); array[2] = reader.GetString(2); array[3] = reader.GetString(3); fillTable(PDP_table, array); } db.closeConnection(); }
protected void Button3_Click(object sender, EventArgs e) { OracleDB db = new OracleDB("Ata"); db.openConnection(); string[] array = new string[reservation_table_names.Length]; string sql = "SELECT * FROM RESERVATION_VIEW "; OracleDataReader reader = db.getDataFromDB(sql); while (reader.Read()) { array[0] = reader.GetString(0); array[1] = reader.GetOracleTimeStamp(1).ToString(); array[2] = reader.GetString(2); array[3] = reader.GetString(3); array[4] = reader.GetString(4); fillTable(Reservation_Table, array); } db.closeConnection(); }
protected void Button4_Click(object sender, EventArgs e) { Lbl_System.Text = ""; OracleDB db = new OracleDB("Ata"); db.openConnection(); string reset = null; string sql = "SELECT RESET_SYSTEM() FROM DUAL"; OracleDataReader reader = db.getDataFromDB(sql); while (reader.Read()) { reset = reader.GetString(0); } if (reset.Equals("TRUE")) { Lbl_System.Text = "System Tables cleared"; sql = "SELECT SET_SYSTEM('" + admin_id + "') FROM DUAL"; OracleDataReader reader1 = db.getDataFromDB(sql); while (reader1.Read()) { reset = reader1.GetString(0); } if (reset.Equals("TRUE")) { Lbl_System.Text = "System resetted completly"; } else { Lbl_System.Text = "System parameters not resetted"; } } else { Lbl_System.Text = "System tables not cleared"; } db.closeConnection(); }