示例#1
0
 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;
 }
示例#2
0
 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);            
 }
示例#3
0
 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;
 }
示例#4
0
 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;
     }
 }
示例#5
0
        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;
        }
示例#6
0
 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);
     }
 }