public Boolean UpdateNhomThuoc(NhomThuoc NT) { SystemLog systemLog = new SystemLog(QuanLy.IDUser, DateTime.Now.ToString(), "Sửa nhóm thuốc "); busUser.SetSystemLog(systemLog); if (NhomQ.UpdateNhomThuoc(NT) > 0) { return true; } else return false; }
public int InsertNhomThuoc(NhomThuoc NT) { List<SqlParameter> paramList = new List<SqlParameter>(); SqlParameter param = new SqlParameter(); param = new SqlParameter("@TenNhom", SqlDbType.NVarChar); param.Value = NT.TenNhom.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@GhiChu", SqlDbType.NVarChar); param.Value = NT.GhiChu.Replace("'", "''"); paramList.Add(param); return dbHelper.ExecuteNonQuery("NhomThuoc_Insert", paramList); }
public ArrayList SelectAllNhomThuoc() { SqlDataReader rd = dbHelper.ExecuteQuery("getAllNhomThuoc"); ArrayList arrNT = new ArrayList(); while (rd.Read()) { NhomThuoc NT = new NhomThuoc(rd.GetInt32(0), rd.GetString(1), rd.GetString(2)); arrNT.Add(NT); } rd.Close(); return arrNT; }
public bool TaoNhomThuoc(NhomThuoc NT) { SystemLog systemLog = new SystemLog(QuanLy.IDUser, DateTime.Now.ToString(), "Thêm nhóm thuốc "); busUser.SetSystemLog(systemLog); int i = NhomQ.InsertNhomThuoc(NT); if (i > 0) { return true; } else { return false; } }
public int UpdateNhomThuoc(NhomThuoc NT) { List<SqlParameter> paramList = new List<SqlParameter>(); SqlParameter param = new SqlParameter(); param = new SqlParameter("@MaNhom", SqlDbType.Int); param.Value = NT.MaNhom; paramList.Add(param); param = new SqlParameter("@TenNhom", SqlDbType.NVarChar); param.Value = NT.TenNhom.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@GhiChu", SqlDbType.NVarChar); param.Value = NT.GhiChu.Replace("'", "''"); paramList.Add(param); int i = dbHelper.ExecuteNonQuery("UpdateNhomThuoc", paramList); return i; }
private void tsmi_ThemNhomThuoc_Click(object sender, EventArgs e) { NhomThuoc NT = new NhomThuoc("", ""); if (busNT.TaoNhomThuoc(NT)) DanhSachNhomThuoc(); else { MessageBox.Show(this, "Không Thêm Được", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }