private void FORMLibrarySetup_Load(object sender, System.EventArgs e) { setImages(); if (ADD_STATE == true) { //Set Add OleDbCommand cmdAddProfile = new OleDbCommand("INSERT INTO tblLibrarySetup(InstitutionName,ContactName,StreetAddr,ZipCode,PhoneNumber,FaxNumber,EmailAddr,Website) VALUES(@getInstitutionName,@getContactName,@getStreetAddr,@getZipCode,@getPhoneNumber,@getFaxNumber,@getEmailAddr,@getWebsite)", clsConnections.CN); this.Text = "Add New"; } else { //Set Edit OleDbCommand cmdAddProfile = new OleDbCommand("UPDATE tblLibrarySetup SET InstitutionName =@getInstitutionName, ContactName =@getContactName, StreetAddr =@getStreetAddr, ZipCode =@getZipCode, PhoneNumber =@getPhoneNumber, FaxNumber =@getFaxNumber, EmailAddr =@getEmailAddr, Website =@getWebsite", clsConnections.CN); FillFields("", "", "", true); this.Text = "Edit Existing"; } cmdAddProfile.Parameters.Add("@getInstitutionName", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getContactName", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getStreetAddr", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getZipCode", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getPhoneNumber", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getFaxNumber", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getEmailAddr", OleDbType.VarChar); cmdAddProfile.Parameters.Add("@getWebsite", OleDbType.VarChar); publicProfile = this; }
public static FORMLibrarySetup Instance() { if (sForm == null) { sForm = new FORMLibrarySetup(); } return(sForm); }
protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); sForm = null; }