public bool updateNv(tblnv nv) { using (SqlConnection cnn = dtcn.getconnect()) { cnn.Open(); try { using (SqlCommand cmd = new SqlCommand("updatenv", cnn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@manv", nv.Manv); cmd.Parameters.AddWithValue("@matk", nv.Fk_matk); cmd.Parameters.AddWithValue("@tennv", nv.Tennv); cmd.Parameters.AddWithValue("@manx", nv.Fk_manx); cmd.Parameters.AddWithValue("@ns ", nv.Ngaysinh); cmd.Parameters.AddWithValue("@gt", nv.Gioitinh); cmd.Parameters.AddWithValue("@sdt", nv.Sdt); cmd.Parameters.AddWithValue("@diachi", nv.Diachi); cmd.Parameters.AddWithValue("@email", nv.Email); cmd.Parameters.AddWithValue("@cmt", nv.Cmt); cmd.Parameters.AddWithValue("@bophan", nv.Bophan); cmd.ExecuteNonQuery(); cnn.Close(); } } catch (Exception e) { return(false); } return(true); } }
public DataTable ds_chuyenxe_nhaxe(tblnv nv) { DataTable data = new DataTable(); using (SqlConnection cnn = dtcn.getconnect()) { cnn.Open(); using (SqlCommand cmd = new SqlCommand("ds_chuyenxe_nhaxe", cnn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@manx", nv.Fk_manx); SqlDataReader abc = cmd.ExecuteReader(); if (abc.HasRows) { data.Load(abc); } cnn.Close(); 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); } } }