public int DeleteLuong(Luong luong) { List <SqlParameter> paras = new List <SqlParameter>(); paras.Add(new SqlParameter("@macn", luong.MaPhuCap)); return(p.ExecNonQuery("", CommandType.StoredProcedure, paras)); }
public List <Luong> ViewLuong(string sql) { try { List <Luong> list = new List <Luong>(); SqlDataReader dr = p.View(sql); if (dr != null) { string MaLuong, MaHSL, MaPhuCap; int TienLuong, Thang, Nam; TimeSpan GioLamViec; while (dr.Read()) { MaLuong = dr.GetString(2); MaHSL = dr.GetString(3); GioLamViec = dr.GetTimeSpan(5); MaPhuCap = dr.GetString(4); TienLuong = dr.GetInt32(6); Thang = dr.GetInt32(0); Nam = dr.GetInt32(1); Luong l = new Luong(MaLuong, MaHSL, GioLamViec, MaPhuCap, TienLuong, Thang, Nam); list.Add(l); } } return(list); } catch (SqlException p) { throw p; } }
public int Update(Luong obj) { MySqlParameter[] para = { new MySqlParameter("idHSL", obj.HeSoLuong), new MySqlParameter("lcb", obj.LuongCB) }; return(db.ExecuteSQL("Luong_Update", para)); }