public int XoaTauThuyen(string maTau) { SqlParameter[] sp = new SqlParameter[1]; sp[0] = new SqlParameter("@ma", SqlDbType.VarChar, 50); sp[0].Value = maTau; SqlParameter[] sp1 = new SqlParameter[1]; sp1[0] = new SqlParameter("@ma", SqlDbType.VarChar, 50); sp1[0].Value = maTau; return(Tuan_dv_DataAccess.ExecNonQuery("delete tauthuyen where ma=@ma", sp) + Tuan_dv_DataAccess.ExecNonQuery("delete hanhtrinh where matauthuyen=@ma", sp1)); }
public int ThemTauThuyen(Tuan_dv_TauThuyenModel tau) { SqlParameter[] sp = new SqlParameter[7]; sp[0] = new SqlParameter("@ma", SqlDbType.VarChar, 50); sp[1] = new SqlParameter("@maloaitau", SqlDbType.VarChar); sp[2] = new SqlParameter("@maquocgia", SqlDbType.VarChar, 50); sp[3] = new SqlParameter("@MMSI", SqlDbType.VarChar, 50); sp[4] = new SqlParameter("@taitrong", SqlDbType.BigInt, 50); sp[5] = new SqlParameter("@tentau", SqlDbType.VarChar, 50); sp[6] = new SqlParameter("@image", SqlDbType.VarChar, 150); sp[0].Value = tau.ma; sp[1].Value = tau.maloaitau; sp[2].Value = tau.maquocgia; sp[3].Value = tau.MMSI; sp[4].Value = tau.taitrong; sp[5].Value = tau.tentau; sp[6].Value = tau.image; return(Tuan_dv_DataAccess.ExecNonQuery("insert into tauthuyen values(@ma,@tentau,@MMSI,@maloaitau,@taitrong,@maquocgia,@image)", sp)); }
public int SuaTauThuyen(Tuan_dv_TauThuyenModel tau) { SqlParameter[] sp = new SqlParameter[7]; sp[0] = new SqlParameter("@ma", SqlDbType.VarChar, 50); sp[1] = new SqlParameter("@maloaitau", SqlDbType.VarChar); sp[2] = new SqlParameter("@maquocgia", SqlDbType.VarChar, 50); sp[3] = new SqlParameter("@MMSI", SqlDbType.VarChar, 50); sp[4] = new SqlParameter("@taitrong", SqlDbType.BigInt, 50); sp[5] = new SqlParameter("@tentau", SqlDbType.VarChar, 50); sp[6] = new SqlParameter("@image", SqlDbType.VarChar, 150); sp[0].Value = tau.ma; sp[1].Value = tau.maloaitau; sp[2].Value = tau.maquocgia; sp[3].Value = tau.MMSI; sp[4].Value = tau.taitrong; sp[5].Value = tau.tentau; sp[6].Value = tau.image; return(Tuan_dv_DataAccess.ExecNonQuery("update tauthuyen set maloaitau=@maloaitau,maquocgia=@maquocgia,MMSI=@MMSI,taitrong=@taitrong,tentau=@tentau,image=@image where ma=@ma", sp)); }