Beispiel #1
0
        //public static int UpdatePassword(string newValue, string email)
        //{
        //  return PartiesEmails.UpdatePartyPassword(newValue, email);
        //}

        //public static int UpdatePhone(string newValue, string email)
        //{
        //  return PartiesEmails.UpdatePartyContactPhone(newValue, email);
        //}

        public static int UpdateColumn(Column column, object newValue, string email)
        {
            var cmdText = "UPDATE PartiesEmails SET {0}=@newValue WHERE PartyEmail=@PartyEmail";

            PartiesEmails.Column partiesEmailsColumn;
            switch (column)
            {
            case Column.Email:
                partiesEmailsColumn = PartiesEmails.Column.PartyEmail;
                break;

            case Column.FirstName:
                partiesEmailsColumn = PartiesEmails.Column.PartyContactFirstName;
                break;

            case Column.LastName:
                partiesEmailsColumn = PartiesEmails.Column.PartyContactLastName;
                break;

            case Column.PartyKey:
                partiesEmailsColumn = PartiesEmails.Column.PartyKey;
                break;

            case Column.Password:
                partiesEmailsColumn = PartiesEmails.Column.PartyPassword;
                break;

            case Column.Phone:
                partiesEmailsColumn = PartiesEmails.Column.PartyContactPhone;
                break;

            default:
                throw new Exception("VolunteersView invalid column");
            }

            cmdText = string.Format(cmdText, PartiesEmails.GetColumnName(partiesEmailsColumn));
            var cmd = VoteDb.GetCommand(cmdText, -1);

            VoteDb.AddCommandParameter(cmd, "PartyEmail", email);
            VoteDb.AddCommandParameter(cmd, "newValue", newValue);
            return(VoteDb.ExecuteNonQuery(cmd));
        }
Beispiel #2
0
        //public static int UpdateEmail(string newValue, string email)
        //{
        //  return PartiesEmails.UpdatePartyEmail(newValue, email);
        //}

        //public static int UpdateFirstName(string newValue, string email)
        //{
        //  return PartiesEmails.UpdatePartyContactFirstName(newValue, email);
        //}

        //public static int UpdateLastName(string newValue, string email)
        //{
        //  return PartiesEmails.UpdatePartyContactLastName(newValue, email);
        //}

        public static int UpdatePartyKey(string newValue, string email)
        {
            return(PartiesEmails.UpdatePartyKey(newValue, email));
        }
Beispiel #3
0
 public static void DeleteByEmail(string email, int commandTimeout = -1)
 {
     PartiesEmails.DeleteByPartyEmailIsVolunteer(email, true, commandTimeout);
 }