C# Class CinderellaMGS.SQL_Queries

Show file Open project: ThomasMoreCollege/CinderellaMGS Class Usage Examples

Public Methods

Method Description
AddGodmotherShift ( string shift, string ID ) : void

Adds a godmother to a shift.

DeleteGodMother ( string godmotherID ) : void

Deletes a Godmother from the system. Actually this method just sets the delete flag since we don't actually want to delete the godmother from the database.

MatchMakerProcess ( ) : void

MatchMaker Process begins here! This Process is what currently will match cinderellas and fairygodmothers and also change ther statuses to the appropriate setting. It is only called in the server form

NewCinderella ( string id, string fname, string lname, string date, string time, string referral ) : string

Inserts into the Cinderella Table the new Cinderella to be added

NewGodMother ( string fname, string lname ) : string

Adds a new Godmother to the database. Since the godmother id's are automatically assigned this method will return their ID so that you can use that in the rest of the program logic like adding the godmother to shifts.

SQL_Queries ( ) : System
endShift ( ) : void

Resets all godmothers back to a status of pending.

getCinderellaStatus ( string statustocheck, string orderby ) : DataSet

Retrieves all cinderellas with the current specified status.

getCinderellas ( bool isShopping, bool isDoneShopping, bool isCheckedOut, string orderby ) : DataSet

getCurrentlyShopping ( ) : DataSet

Retrieves a dataset of those who are currently shopping.

getDate ( ) : string

Retrieves the current date and time from the database server.

getGlobalizedSettings ( string appProperty ) : string

Method will retrieve settings from the database in the ConfigSettings table.

getGodmotherStatus ( string statustocheck, string orderby, bool filterToday ) : DataSet

Retreives all godmothers of the status specified.

getGodmotherStatusByShift ( string statustocheck, string orderby, string shiftID ) : DataSet

Returns godmothers working a specific shift with a specific status.

getMaxCinderellaID ( ) : string

getNotes ( bool isShopping, bool isDoneShopping, bool isCheckedOut, string orderby ) : DataSet

getShiftStartEnd ( bool shiftStart ) : bool

Method is used to determine if a shift can be started or ended. If a shift is started it can be ended but not started again. EXAMPLE USAGE: if (sqlQuery.getShiftStartEnd(true)) \\shiftend { randomizeStartToolStripMenuItem1.Enabled = true; } else { randomizeStartToolStripMenuItem1.Enabled = false; } if (sqlQuery.getShiftStartEnd(false))//aka shiftEnd { endShiftToolStripMenuItem.Enabled = true; } else { endShiftToolStripMenuItem.Enabled = false; } if (sqlQuery.getShiftStartEnd(true) && sqlQuery.getShiftStartEnd(false)) { //This is an initial launch of the program and both fields are blank randomizeStartToolStripMenuItem1.Enabled = true; endShiftToolStripMenuItem.Enabled = false; }

getStats ( ) : string

Retrieves all of the current stats for the system.

insertPair ( string cinderellaID, string godmotherID ) : void

setCinderellaDetails ( string ID, string dressSize, string shoeSize, int altered, string notes, string time, string Fname, string Lname ) : void

setGodmotherDetails ( string ID, string Fname, string Lname ) : void

setPairing ( string godmotherID, string cinderellaID ) : void

Pairs a godmother and Cinderella.

setShiftStartEnd ( bool shiftStart, bool clear ) : void

Updates the time of either a shift start or shift end in the ConfigSettings table.

setStatus ( string ID, string status, bool cinderella, bool importRunning ) : void

Sets the status of a cinderella or godmother.

sqlSelect ( string keyword ) : DataSet

This method houses all of the basic "Select" statements.

sqlStatment ( string mysql ) : int

Will execute a non-query sql statment.

Method Details

AddGodmotherShift() public method

Adds a godmother to a shift.
public AddGodmotherShift ( string shift, string ID ) : void
shift string Shift ID
ID string Godmother ID
return void

DeleteGodMother() public method

Deletes a Godmother from the system. Actually this method just sets the delete flag since we don't actually want to delete the godmother from the database.
public DeleteGodMother ( string godmotherID ) : void
godmotherID string Godmother ID to delete
return void

MatchMakerProcess() public method

MatchMaker Process begins here! This Process is what currently will match cinderellas and fairygodmothers and also change ther statuses to the appropriate setting. It is only called in the server form
public MatchMakerProcess ( ) : void
return void

NewCinderella() public method

Inserts into the Cinderella Table the new Cinderella to be added
public NewCinderella ( string id, string fname, string lname, string date, string time, string referral ) : string
id string Cinderellas given iD
fname string Cinderellas First Name
lname string Cinderellas Last Name
date string Cinderellas Appt Date
time string Cinderellas Appt Time
referral string The person who referred the Cinderella to the Program
return string

NewGodMother() public method

Adds a new Godmother to the database. Since the godmother id's are automatically assigned this method will return their ID so that you can use that in the rest of the program logic like adding the godmother to shifts.
public NewGodMother ( string fname, string lname ) : string
fname string Godmothers First Name
lname string Godmothers Last Name
return string

SQL_Queries() public method

public SQL_Queries ( ) : System
return System

endShift() public method

Resets all godmothers back to a status of pending.
public endShift ( ) : void
return void

getCinderellaStatus() public method

Retrieves all cinderellas with the current specified status.
public getCinderellaStatus ( string statustocheck, string orderby ) : DataSet
statustocheck string Status that you are checking for (ie. shopping, pending, etc)
orderby string How the data should be ordered (ie. lname)
return System.Data.DataSet

getCinderellas() public method

public getCinderellas ( bool isShopping, bool isDoneShopping, bool isCheckedOut, string orderby ) : DataSet
isShopping bool
isDoneShopping bool
isCheckedOut bool
orderby string
return System.Data.DataSet

getCurrentlyShopping() public method

Retrieves a dataset of those who are currently shopping.
public getCurrentlyShopping ( ) : DataSet
return System.Data.DataSet

getDate() public method

Retrieves the current date and time from the database server.
public getDate ( ) : string
return string

getGlobalizedSettings() public method

Method will retrieve settings from the database in the ConfigSettings table.
public getGlobalizedSettings ( string appProperty ) : string
appProperty string the appProperty key of the setting you are retreiving from the database
return string

getGodmotherStatus() public method

Retreives all godmothers of the status specified.
public getGodmotherStatus ( string statustocheck, string orderby, bool filterToday ) : DataSet
statustocheck string Status that you are checking for (ie. shopping, pending, etc)
orderby string How the data should be ordered (ie. lname)
filterToday bool True-Only those for the current day :: False-for everyone with the specific status.
return System.Data.DataSet

getGodmotherStatusByShift() public method

Returns godmothers working a specific shift with a specific status.
public getGodmotherStatusByShift ( string statustocheck, string orderby, string shiftID ) : DataSet
statustocheck string Status that you are checking for (ie. shopping, pending, etc)
orderby string How the data should be ordered (ie. lname)
shiftID string Id of the shift you are checking
return System.Data.DataSet

getMaxCinderellaID() public method

public getMaxCinderellaID ( ) : string
return string

getNotes() public method

public getNotes ( bool isShopping, bool isDoneShopping, bool isCheckedOut, string orderby ) : DataSet
isShopping bool
isDoneShopping bool
isCheckedOut bool
orderby string
return System.Data.DataSet

getShiftStartEnd() public method

Method is used to determine if a shift can be started or ended. If a shift is started it can be ended but not started again. EXAMPLE USAGE: if (sqlQuery.getShiftStartEnd(true)) \\shiftend { randomizeStartToolStripMenuItem1.Enabled = true; } else { randomizeStartToolStripMenuItem1.Enabled = false; } if (sqlQuery.getShiftStartEnd(false))//aka shiftEnd { endShiftToolStripMenuItem.Enabled = true; } else { endShiftToolStripMenuItem.Enabled = false; } if (sqlQuery.getShiftStartEnd(true) && sqlQuery.getShiftStartEnd(false)) { //This is an initial launch of the program and both fields are blank randomizeStartToolStripMenuItem1.Enabled = true; endShiftToolStripMenuItem.Enabled = false; }
public getShiftStartEnd ( bool shiftStart ) : bool
shiftStart bool True-shift start : False-shift end
return bool

getStats() public method

Retrieves all of the current stats for the system.
public getStats ( ) : string
return string

insertPair() public method

public insertPair ( string cinderellaID, string godmotherID ) : void
cinderellaID string
godmotherID string
return void

setCinderellaDetails() public method

public setCinderellaDetails ( string ID, string dressSize, string shoeSize, int altered, string notes, string time, string Fname, string Lname ) : void
ID string
dressSize string
shoeSize string
altered int
notes string
time string
Fname string
Lname string
return void

setGodmotherDetails() public method

public setGodmotherDetails ( string ID, string Fname, string Lname ) : void
ID string
Fname string
Lname string
return void

setPairing() public method

Pairs a godmother and Cinderella.
public setPairing ( string godmotherID, string cinderellaID ) : void
godmotherID string ID of the Godmother
cinderellaID string ID of the Cinderella
return void

setShiftStartEnd() public method

Updates the time of either a shift start or shift end in the ConfigSettings table.
public setShiftStartEnd ( bool shiftStart, bool clear ) : void
shiftStart bool True-set the shift start time :: False-Set the shift end time.
clear bool True-Clear the value :: False-Set the value with the current datetime
return void

setStatus() public method

Sets the status of a cinderella or godmother.
public setStatus ( string ID, string status, bool cinderella, bool importRunning ) : void
ID string Id of the Cinderella or Godmother
status string Status that you would like to set.
cinderella bool true-set the status of a cinderella :: false-set the status of a godmother
importRunning bool true-if the import is currently running.
return void

sqlSelect() public method

This method houses all of the basic "Select" statements.
public sqlSelect ( string keyword ) : DataSet
keyword string Keyword identifying the select statment in the switch.
return System.Data.DataSet

sqlStatment() public method

Will execute a non-query sql statment.
public sqlStatment ( string mysql ) : int
mysql string SQL statement to be executed.
return int