public User SelectUser(string _Username, string _Password) { List<SqlParameter> paramList = new List<SqlParameter>(); SqlParameter param = new SqlParameter(); param = new SqlParameter("@Username", SqlDbType.NVarChar); param.Value = _Username.Replace("'", "''"); paramList.Add(param); param = new SqlParameter("@Password", SqlDbType.NVarChar); param.Value = _Password.Replace("'", "''"); paramList.Add(param); SqlDataReader rd = null; rd = dbHelper.ExecuteQuery("GetUser", paramList); if (rd.Read()) { User user = new User(rd.GetInt32(0), rd.GetString(1), rd.GetString(2), rd.GetString(3), rd.GetString(4)); rd.Close(); return user; } else { rd.Close(); return null; } }
public Login() { InitializeComponent(); busCommon = new BusCommon(); busUser = new BusUser(); user = new User(); }
public SellMedicine(User currentUser) { InitializeComponent(); busUser = new BusUser(); busThuoc = new BusThuoc(); busBenhNhan = new BusBenhNhan(); busHDX = new BusHDX(); this.currentUser = currentUser; IDUser = currentUser.IDUser; this.ApplLoad(); }
public QuanLy(User currentUser) { InitializeComponent(); busUser = new BusUser(); busSys = new BusSystem(); busHDX = new BusHDX(); busNT = new BusNhomThuoc(); busThuoc = new BusThuoc(); busNSX = new BusNSX(); busDVT = new BusDVT(); busNNP = new BusNPP(); busHDN = new BusHDN(); arrCTHDN = new ArrayList(); this.currentUser = currentUser; IDUser = currentUser.IDUser; }
public ArrayList SelectAllUser() { SqlDataReader rd = dbHelper.ExecuteQuery("getAllUsers"); ArrayList arrUser = new ArrayList(); while (rd.Read()) { User user = new User(rd.GetInt32(0), rd.GetString(1), rd.GetString(2), rd.GetString(3), rd.GetString(4)); arrUser.Add(user); } rd.Close(); return arrUser; }