public CompanyUserStruct GetCustomerUser(string mail, string pin) { _connection.SqlConnection.Open(); var cmd = new SqlCommand("" + "SELECT [CustomerUser].[idCustomerUser], [CustomerUser].Name, [User].IsActive, [User].Mail, [CustomerUser].[idCompany], [CustomerUser].Pin, [CustomerUser].DateOfBirth " + "FROM [User] " + "INNER JOIN [CustomerUser] ON [CustomerUser].idCustomerUser = [User].idCustomerUser " + "WHERE [User].Mail = @mail AND [CustomerUser].pin = @pin", _connection.SqlConnection); cmd.Parameters.Add(new SqlParameter("mail", mail)); cmd.Parameters.Add(new SqlParameter("pin", pin)); var reader = cmd.ExecuteReader(); CompanyUserStruct customerUserStruct = new CompanyUserStruct(); while (reader.Read()) { customerUserStruct = new CompanyUserStruct( reader.GetInt32(0), //id reader.GetString(1), //name reader.GetBoolean(2), //active reader.GetString(3), //mail reader.GetInt32(4), //companyId Convert.ToInt32(reader.GetString(5)), //pin reader.GetDateTime(6) //birthdate ); } _connection.SqlConnection.Close(); return(customerUserStruct); }
public CompanyUser(CompanyUserStruct UserStruct) { this.Id = UserStruct.Id; this.Mail = UserStruct.Mail; this.Name = UserStruct.Name; this.IsActive = UserStruct.IsActive; this.DateOfBirth = UserStruct.DateOfBirth; this.Pin = UserStruct.Pin; this.CompanyId = UserStruct.CompanyId; }
public CompanyUserStruct NewCustomerUser(CompanyUserStruct NewCustomerUser) { return(CompanyContext.NewCustomerUser(NewCustomerUser)); }
public void DeleteCustomerUserForCompany(int CompanyId, CompanyUserStruct CustomerUser) { CompanyContext.DeleteCustomerUserForCompany(CompanyId, CustomerUser); }
public CompanyUserStruct NewCustomerUser(CompanyUserStruct NewCustomerUser) { throw new NotImplementedException(); }
public void DeleteCustomerUserForCompany(int CompanyId, CompanyUserStruct CustomerUser) { throw new NotImplementedException(); }