C# Класс CinderellaMGS.SQL_Queries

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

AddGodmotherShift() публичный Метод

Adds a godmother to a shift.
public AddGodmotherShift ( string shift, string ID ) : void
shift string Shift ID
ID string Godmother ID
Результат void

DeleteGodMother() публичный Метод

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
Результат void

MatchMakerProcess() публичный Метод

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
Результат void

NewCinderella() публичный Метод

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
Результат string

NewGodMother() публичный Метод

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
Результат string

SQL_Queries() публичный Метод

public SQL_Queries ( ) : System
Результат System

endShift() публичный Метод

Resets all godmothers back to a status of pending.
public endShift ( ) : void
Результат void

getCinderellaStatus() публичный Метод

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)
Результат System.Data.DataSet

getCinderellas() публичный Метод

public getCinderellas ( bool isShopping, bool isDoneShopping, bool isCheckedOut, string orderby ) : DataSet
isShopping bool
isDoneShopping bool
isCheckedOut bool
orderby string
Результат System.Data.DataSet

getCurrentlyShopping() публичный Метод

Retrieves a dataset of those who are currently shopping.
public getCurrentlyShopping ( ) : DataSet
Результат System.Data.DataSet

getDate() публичный Метод

Retrieves the current date and time from the database server.
public getDate ( ) : string
Результат string

getGlobalizedSettings() публичный Метод

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
Результат string

getGodmotherStatus() публичный Метод

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.
Результат System.Data.DataSet

getGodmotherStatusByShift() публичный Метод

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
Результат System.Data.DataSet

getMaxCinderellaID() публичный Метод

public getMaxCinderellaID ( ) : string
Результат string

getNotes() публичный Метод

public getNotes ( bool isShopping, bool isDoneShopping, bool isCheckedOut, string orderby ) : DataSet
isShopping bool
isDoneShopping bool
isCheckedOut bool
orderby string
Результат System.Data.DataSet

getShiftStartEnd() публичный Метод

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
Результат bool

getStats() публичный Метод

Retrieves all of the current stats for the system.
public getStats ( ) : string
Результат string

insertPair() публичный Метод

public insertPair ( string cinderellaID, string godmotherID ) : void
cinderellaID string
godmotherID string
Результат void

setCinderellaDetails() публичный Метод

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
Результат void

setGodmotherDetails() публичный Метод

public setGodmotherDetails ( string ID, string Fname, string Lname ) : void
ID string
Fname string
Lname string
Результат void

setPairing() публичный Метод

Pairs a godmother and Cinderella.
public setPairing ( string godmotherID, string cinderellaID ) : void
godmotherID string ID of the Godmother
cinderellaID string ID of the Cinderella
Результат void

setShiftStartEnd() публичный Метод

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
Результат void

setStatus() публичный Метод

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.
Результат void

sqlSelect() публичный Метод

This method houses all of the basic "Select" statements.
public sqlSelect ( string keyword ) : DataSet
keyword string Keyword identifying the select statment in the switch.
Результат System.Data.DataSet

sqlStatment() публичный Метод

Will execute a non-query sql statment.
public sqlStatment ( string mysql ) : int
mysql string SQL statement to be executed.
Результат int