public bool DeleteDem(Dem fdem) { string query = "Delete_FileDem"; string[] para; para = new string[1]; para[0] = "@MaFile"; object[] values; values = new object[1]; values[0] = fdem.MaFile; try { int a = Excute_Sql(query, CommandType.StoredProcedure, para, values); if (a != 0) { return(true); } return(false); } catch (SqlException ex) { DialogResult d; d = MessageBox.Show("Thông tin xóa không hợp lệ!"); return(false); } finally { } }
public bool UpdateDem(Dem fdem) { string query = "Update_FileDem"; string[] para; para = new string[3]; para[0] = "@MaFile"; para[1] = "@DuongDan"; para[2] = "@TenFile"; object[] values; values = new object[3]; values[2] = fdem.TenFile; values[1] = fdem.DuongDan; values[0] = fdem.MaFile; try { connection connect = new connection(); int a = Excute_Sql(query, CommandType.StoredProcedure, para, values); if (a != 0) { return(true); } return(false); } catch (SqlException ex) { DialogResult d; d = MessageBox.Show("Thông tin sửa không hợp lệ!"); return(false); } finally { } }