public bool updateNx(tblnx nx) { using (SqlConnection cnn = dtcn.getconnect()) { cnn.Open(); try { using (SqlCommand cmd = new SqlCommand("update_nx", cnn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@manx", nx.Manx); cmd.Parameters.AddWithValue("@diachi", nx.Diachi); cmd.Parameters.AddWithValue("@trangthai", nx.Trangthai); cmd.Parameters.AddWithValue("@email", nx.Email); cmd.Parameters.AddWithValue("@tennx", nx.Tennx); cmd.Parameters.AddWithValue("@sdt", nx.Sdt); cmd.ExecuteNonQuery(); cnn.Close(); } } catch (Exception e) { return(false); } return(true); } }
public DataTable ds_tuyenxe_nhaxe(tblnx nx) { DataTable data = new DataTable(); //string manx = ""; using (SqlConnection cnn = dtcn.getconnect()) { cnn.Open(); using (SqlCommand cmd = new SqlCommand("ds_tuyenxe_nhaxe", cnn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@manx", nx.Manx); SqlDataReader abc = cmd.ExecuteReader(); if (abc.HasRows) { data.Load(abc); } return(data); } } }
public DataTable timkiem_nx(tblnv nv, tblnx nx) { DataTable data = new DataTable(); using (SqlConnection cnn = dtcn.getconnect()) { cnn.Open(); using (SqlCommand cmd = new SqlCommand("timkiem_nx", cnn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sdt_nx", nx.Sdt); cmd.Parameters.AddWithValue("@sdt_nvdh", nv.Sdt); SqlDataReader abc = cmd.ExecuteReader(); if (abc.HasRows) { data.Load(abc); } cnn.Close(); return(data); } } }