public cls_Partner() { DB_Gateway = new Sql_Gateway(); }
public ParameterValues() { DB_Gateway = new Sql_Gateway(); }
// empty constructor public DashboardEinvoiceMail() { DB_Gateway = new Sql_Gateway(); }
// empty constructor public DashboardUserRights() { DB_Gateway = new Sql_Gateway(); }
// empty constructor public DashboardLog() { DB_Gateway = new Sql_Gateway(); }
// empty constructor public dbProcess() { DB_Gateway = new Sql_Gateway(); }
public bool GetAllActiveUserForUserId(string connectionString, string pUserId) { using (System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString)) { List<DashboardUser> DashboardUserList = new List<DashboardUser>(); using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand()) { cmd.CommandText = @" SELECT UserId, UserName, Password, Email, Name, Surname, Mission, Telephone, ImageName, Active FROM DashboardUser WHERE Active = 1 AND UserId = @pUserId"; cmd.Parameters.AddWithValue("@pUserId", pUserId); using (DataTable dt = new Sql_Gateway().ExecuteDataTable(cmd, connection)) { if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TransferToClass(dr); return true; } } } if (connection != null) connection.Close(); return false; } } }
public bool authenticateForLockScreen(string connectionString, string p_Password) { using (System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString)) { using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand()) { cmd.CommandText = @"SELECT * FROM DashboardUser WHERE Password = @pPassword AND Active = 1"; cmd.Parameters.AddWithValue("@pPassword", p_Password); using (DataTable dt = new Sql_Gateway().ExecuteDataTable(cmd, connection)) { if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { TransferToClass(dr); return true; } } } return false; } } }