From: <m_h...@us...> - 2006-07-07 23:33:32
|
Revision: 89 Author: m_hildebrand Date: 2006-07-07 16:33:22 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/tcdb/?rev=89&view=rev Log Message: ----------- Got hooked up to AD and the DB Modified Paths: -------------- Website/App_Code/AD_Authentication.cs Website/App_Code/TCDB_Constants.cs Website/App_Code/TCDB_Users.cs Website/App_Themes/Python/python.css Website/Includes/Header.ascx Website/Includes/Header_User.ascx Website/TCDB.master Added Paths: ----------- Website/App_Code/TCDB_Products.cs Website/App_Code/dadDataSet.xsd Website/App_Code/dadDataSet.xss Website/Includes/Authenticate.ascx Modified: Website/App_Code/AD_Authentication.cs =================================================================== --- Website/App_Code/AD_Authentication.cs 2006-07-07 22:50:32 UTC (rev 88) +++ Website/App_Code/AD_Authentication.cs 2006-07-07 23:33:22 UTC (rev 89) @@ -17,10 +17,15 @@ /// </summary> public static class AD_Authentication { - public static bool AD_Authenticate(string strDomain, string strUserName, string strPassword) + public static bool AD_Authenticate(string strUserName, string strPassword) { bool result = false; - DirectoryEntry de = new DirectoryEntry("LDAP://" + strDomain, strUserName, strPassword); + string[] UserName = strUserName.Split("\\".ToCharArray()); + + // If we don't have a domain and a username, we need to fail + if (UserName.Length < 2) + return false; + DirectoryEntry de = new DirectoryEntry("LDAP://" + UserName[0], UserName[1], strPassword); DirectorySearcher ds = new DirectorySearcher(de); ds.SearchScope = SearchScope.OneLevel; try @@ -36,19 +41,32 @@ return result; } - public static TCDB_User AD_GetUserInfo(string strDomain, string strUserName, string strPassword) + public static string AD_CleanUserName(string strUserName) { - DirectoryEntry de = new DirectoryEntry("LDAP://" + strDomain, strUserName, strPassword); + string[] UserName = strUserName.Split("\\".ToCharArray()); + if (UserName.Length < 2) + return strUserName; + return UserName[1]; + } + + public static TCDB_User AD_GetUserInfo(string strUserName, string strPassword) + { + string[] UserName = strUserName.Split("\\".ToCharArray()); + TCDB_User user = new TCDB_User(); + + // If we don't have a domain and a username, we need to fail + if (UserName.Length < 2) + return user; + + DirectoryEntry de = new DirectoryEntry("LDAP://" + UserName[0], UserName[1], strPassword); DirectorySearcher ds = new DirectorySearcher(de); ds.SearchScope = SearchScope.Subtree; - ds.Filter = "(&(objectClass=user)(sAMAccountName=" + strUserName + "))"; - TCDB_User user = new TCDB_User(); + ds.Filter = "(&(objectClass=user)(sAMAccountName=" + UserName[1] + "))"; user.USERID = TCDB_Constants.TCDB_Constant.USER_NEWUSER; user.AUTOMATION = false; user.ISAUTHENTICATED = true; - user.USERNAME = strUserName; - string myText = ""; + user.USERNAME = UserName[1]; try { SearchResult sr = ds.FindOne(); @@ -61,6 +79,7 @@ user.EMAIL = rpc["mail"][0].ToString(); user.HOMEPHONE = rpc["homePhone"][0].ToString(); user.OFFICEPHONE = rpc["telephoneNumber"][0].ToString(); + user.CELLPHONE = rpc["mobile"][0].ToString(); } } catch Modified: Website/App_Code/TCDB_Constants.cs =================================================================== --- Website/App_Code/TCDB_Constants.cs 2006-07-07 22:50:32 UTC (rev 88) +++ Website/App_Code/TCDB_Constants.cs 2006-07-07 23:33:22 UTC (rev 89) @@ -15,8 +15,15 @@ /// </summary> public static class TCDB_Constant { + // TODO: Load the strings from the DB where appropriate public static int USER_FAILEDLOGIN = -2; public static int USER_NOTREGISTERED = -1; public static int USER_NEWUSER = -1; + public static int USER_ANONYMOUSUSERID = 0; + public static string USER_ANONYMOUSUSERNAME = "Guest"; + public static string USER_ANONYMOUSFIRSTNAME = "Guest"; + public static string USER_ANONYMOUSLASTNAME = "User"; + + public static string ACTION_NEWUSER = "nu"; } } \ No newline at end of file Added: Website/App_Code/TCDB_Products.cs =================================================================== --- Website/App_Code/TCDB_Products.cs (rev 0) +++ Website/App_Code/TCDB_Products.cs 2006-07-07 23:33:22 UTC (rev 89) @@ -0,0 +1,173 @@ +using System; +using System.Data; +using System.Configuration; +using System.Collections.Generic; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using TCDB_Users; + +namespace TCDB_Products +{ + /// <summary> + /// Summary description for TCDB_Products + /// </summary> + public class TCDB_ProductDB : Page + { + public static TCDB_Product TCDB_GetProduct(bool isActive, int productID) + { + dadDataSet ds = new dadDataSet(); + dadDataSetTableAdapters.db_productsTableAdapter ta = new dadDataSetTableAdapters.db_productsTableAdapter(); + ta.GetData(isActive, productID); + ta.Fill(ds.db_products, isActive, productID); + + TCDB_Product product = new TCDB_Product(); + + DataTableReader dr = ds.CreateDataReader(); + if (dr.HasRows && dr.Read()) + { + product.PRODUCTID = int.Parse(dr["productID"].ToString()); + product.NAME = dr["name"].ToString(); + product.DESCRIPTION = dr["description"].ToString(); + product.CODENAME = dr["codeName"].ToString(); + product.DEVMANAGER = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["devManager"].ToString())); + product.QAMANAGER = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["qaManager"].ToString())); + product.DEVLEAD = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["devLead"].ToString())); + product.QALEAD = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["qaLead"].ToString())); + product.PM = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["pm"].ToString())); + product.ACTIVE = (bool)(dr["active"]); + } + + return product; + } + + public static List<TCDB_Product> TCDB_GetProductList(bool isActive) + { + dadDataSet ds = new dadDataSet(); + dadDataSetTableAdapters.db_productsTableAdapter ta = new dadDataSetTableAdapters.db_productsTableAdapter(); + ta.GetData(isActive, null); + ta.Fill(ds.db_products, isActive, null); + + List<TCDB_Product> productList = new List<TCDB_Product>(); + + DataTableReader dr = ds.CreateDataReader(); + if (dr.HasRows) + { + while (dr.Read()) { + TCDB_Product product = new TCDB_Product(); + product.PRODUCTID = int.Parse(dr["productID"].ToString()); + product.NAME = dr["name"].ToString(); + product.DESCRIPTION = dr["description"].ToString(); + product.CODENAME = dr["codeName"].ToString(); + product.DEVMANAGER = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["devManager"].ToString())); + product.QAMANAGER = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["qaManager"].ToString())); + product.DEVLEAD = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["devLead"].ToString())); + product.QALEAD = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["qaLead"].ToString())); + product.PM = TCDB_UserDB.TCDB_GetUserInfo(int.Parse(dr["pm"].ToString())); + product.ACTIVE = (bool)(dr["active"]); + + productList.Add(product); + } + } + + return productList; + } + } + + public class TCDB_Product + { + private int productid; + private string name; + private string description; + private string codeName; + private TCDB_User devManager; + private TCDB_User qaManager; + private TCDB_User devLead; + private TCDB_User qaLead; + private TCDB_User pm; + private bool active; + // TODO: Implement these as the time is right + //private List<TCDB_Tag> tags; + + public TCDB_Product() + { + productid = 0; + name = null; + description = null; + codeName = null; + devManager = null; + qaManager = null; + devLead = null; + qaLead = null; + pm = null; + active = false; + } + + public TCDB_Product(int id) + { + } + + public int PRODUCTID + { + get { return productid; } + set { productid = value; } + } + + public string NAME + { + get { return name; } + set { name = value; } + } + + public string DESCRIPTION + { + get { return description; } + set { description = value; } + } + + public string CODENAME + { + get { return codeName; } + set { codeName = value; } + } + + public TCDB_User DEVMANAGER + { + get { return devManager; } + set { devManager = value; } + } + + public TCDB_User QAMANAGER + { + get { return qaManager; } + set { qaManager = value; } + } + + public TCDB_User DEVLEAD + { + get { return devLead; } + set { devLead = value; } + } + + public TCDB_User QALEAD + { + get { return qaLead; } + set { qaLead = value; } + } + + public TCDB_User PM + { + get { return pm; } + set { pm = value; } + } + + public bool ACTIVE + { + get { return active; } + set { active = value; } + } + } +} \ No newline at end of file Modified: Website/App_Code/TCDB_Users.cs =================================================================== --- Website/App_Code/TCDB_Users.cs 2006-07-07 22:50:32 UTC (rev 88) +++ Website/App_Code/TCDB_Users.cs 2006-07-07 23:33:22 UTC (rev 89) @@ -2,8 +2,10 @@ using System.Data; using System.Data.SqlClient; using System.Configuration; +using System.Diagnostics; using System.Web; using System.Web.Security; +using System.Web.Configuration; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; @@ -12,6 +14,7 @@ using TCDB_Constants; using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; using AD_Auth; @@ -37,21 +40,24 @@ /// <value> /// An <c>int</c> representing the user's ID or DefaultValue if the process fails /// </value> - public static TCDB_User TCDB_AuthenticateUser(string strDomain, string strUserName, string strPassword) + public static TCDB_User TCDB_AuthenticateUser(string strUserName, string strPassword) { // TODO: Add logic here to determine and use the appropriate // authentication method based on configuration data // Using AD authentication - if (!AD_Authentication.AD_Authenticate(strDomain, strUserName, strPassword)) + if (!AD_Authentication.AD_Authenticate(strUserName, strPassword)) { // We can't authenticate, so return the guest user return new TCDB_User(); } + // Using AD authentication + string cleanUserName = AD_Authentication.AD_CleanUserName(strUserName); + // Determine if the user exists in the DB or not. If not, we need to get // the basic info - TCDB_User user = TCDB_GetUserInfo(strUserName); + TCDB_User user = TCDB_GetUserInfo(cleanUserName); if (user.USERID > 1) { user.ISAUTHENTICATED = true; @@ -59,18 +65,62 @@ } // Using AD authentication - user = AD_Authentication.AD_GetUserInfo(strDomain, strUserName, strPassword); + user = AD_Authentication.AD_GetUserInfo(strUserName, strPassword); + return user; + } + public static TCDB_User TCDB_GetUserInfo(string strUserName) + { + // TODO: Check against the DB for user information + dadDataSet ds = new dadDataSet(); + dadDataSetTableAdapters.db_usersTableAdapter ta = new dadDataSetTableAdapters.db_usersTableAdapter(); + ta.GetData(strUserName, null); + ta.Fill(ds.db_users, strUserName, null); + TCDB_User user = new TCDB_User(); + DataTableReader dr = ds.CreateDataReader(); + if (dr.HasRows && dr.Read()) + { + user.USERID = int.Parse(dr["userID"].ToString()); + user.USERNAME = dr["username"].ToString(); + user.FIRSTNAME = dr["firstName"].ToString(); + user.LASTNAME = dr["lastName"].ToString(); + user.EMAIL = dr["email"].ToString(); + user.OFFICEPHONE = dr["officePhone"].ToString(); + user.HOMEPHONE = dr["homePhone"].ToString(); + user.CELLPHONE = dr["cellPhone"].ToString(); + user.AUTOMATION = (bool)(dr["automation"]); + } return user; } - public static TCDB_User TCDB_GetUserInfo(string strUserName) + public static TCDB_User TCDB_GetUserInfo(int id) { // TODO: Check against the DB for user information - return new TCDB_User(); + dadDataSet ds = new dadDataSet(); + dadDataSetTableAdapters.db_usersTableAdapter ta = new dadDataSetTableAdapters.db_usersTableAdapter(); + ta.GetData(null, id); + ta.Fill(ds.db_users, null, id); + + TCDB_User user = new TCDB_User(); + + DataTableReader dr = ds.CreateDataReader(); + if (dr.HasRows && dr.Read()) + { + user.USERID = int.Parse(dr["userID"].ToString()); + user.USERNAME = dr["username"].ToString(); + user.FIRSTNAME = dr["firstName"].ToString(); + user.LASTNAME = dr["lastName"].ToString(); + user.EMAIL = dr["email"].ToString(); + user.OFFICEPHONE = dr["officePhone"].ToString(); + user.HOMEPHONE = dr["homePhone"].ToString(); + user.CELLPHONE = dr["cellPhone"].ToString(); + user.AUTOMATION = (bool)(dr["automation"]); + } + + return user; } @@ -86,17 +136,19 @@ private string email; private string officePhone; private string homePhone; + private string cellPhone; private string firstName; private string lastName; private bool automation; private bool isAuthenticated; + private List<TCDB_Right> rights; + private List<TCDB_Config> config; /* TODO: Implement these as the time is right private List<TCDB_Feature> features; private List<TCDB_Assignment> assignmentsCreated; private List<TCDB_Assignment> assignments; private List<TCDB_Objective> objectives; private List<TCDB_WorkOrderTemplate> savedWorkOrders; - private TCDB_RightsCollection rights; private List<TCDB_TestCase> testCasesCreated; private List<TCDB_TestCase> testCasesEdited; */ @@ -107,15 +159,18 @@ /// </summary> public TCDB_User() { - userid = 0; - username = "Guest"; + userid = TCDB_Constant.USER_ANONYMOUSUSERID; + username = TCDB_Constant.USER_ANONYMOUSUSERNAME; email = ""; officePhone = ""; homePhone = ""; - firstName = "Guest"; - lastName = "User"; + cellPhone = ""; + firstName = TCDB_Constant.USER_ANONYMOUSFIRSTNAME; + lastName = TCDB_Constant.USER_ANONYMOUSLASTNAME; automation = false; isAuthenticated = false; + rights = null; + config = null; } /// <summary> @@ -166,6 +221,12 @@ set { homePhone = value; } } + public string CELLPHONE + { + get { return cellPhone; } + set { cellPhone = value; } + } + public string FIRSTNAME { get { return firstName; } @@ -194,88 +255,82 @@ get { return isAuthenticated; } set { isAuthenticated = value; } } - } - public class TCDB_RightsCollection : CollectionBase - { - private List<TCDB_Right> rights; - - public int Count + public override string ToString() { - get { return rights.Count; } + return FULLNAME; } - public void Clear() + public List<TCDB_Right> GetRights() { - rights = new List<TCDB_Right>(); + // TODO: If rights == null + // load the rights from the db + return rights; } - public bool Equals(Object o) + public List<TCDB_Config> GetConfig() { - // TODO: Finish this - return false; + // TODO: If config == null + // load the config from the db + return config; } + } - public IEnumerator GetEnumerator() - { - // TODO: Finish this - return null; - } + public class TCDB_Right + { + private int m_id; + private string m_name; + private string m_description; - public int GetHashCode() + public TCDB_Right(int id, string name, string description) { - // TODO: Finish this - return 0; + m_id = id; + m_name = name; + m_description = description; } - public Type GetType() + public int ID { - // TODO: Finish this - return null; + get { return m_id; } } - public void RemoveAt(int index) + public string NAME { - // TODO: Implement the function - if (index < 0 || index >= rights.Count) - throw new ArgumentOutOfRangeException(index.ToString(), "Index out of range."); + get { return m_name; } } - public string ToString() + public string DESCRIPTION { - return "System.Object"; + get { return m_description; } } -/* - protected ArrayList InnerList - { - // TODO: Finish this - get { return new ArrayList(); } - } + } - protected IList List + public class TCDB_Config + { + private int m_uid; + private string m_key; + private string m_value; + + public TCDB_Config(int uid, string key, string value) { - get { return rights; } + m_uid = uid; + m_key = key; + m_value = value; } - ~TCDB_RightsCollection() + public int UID { - rights = null; + get { return m_uid; } } - protected TCDB_RightsCollection MemberwiseClone() + public string KEY { - // TODO: Finish this - return this; + get { return m_key; } } -*/ - - } - - public class TCDB_Right - { - public TCDB_Right() + public string VALUE { + get { return m_value; } } } } \ No newline at end of file Added: Website/App_Code/dadDataSet.xsd =================================================================== --- Website/App_Code/dadDataSet.xsd (rev 0) +++ Website/App_Code/dadDataSet.xsd 2006-07-07 23:33:22 UTC (rev 89) @@ -0,0 +1,305 @@ +<?xml version="1.0" encoding="utf-8"?> +<xs:schema id="dadDataSet" targetNamespace="http://tempuri.org/dadDataSet.xsd" xmlns:mstns="http://tempuri.org/dadDataSet.xsd" xmlns="http://tempuri.org/dadDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified"> + <xs:annotation> + <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"> + <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" GeneratorFunctionsComponentClassName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" UserFunctionsComponentName="QueriesTableAdapter" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> + <Connections> + <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="dadConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="dadConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.dadConnectionString.ConnectionString" Provider="System.Data.SqlClient"> + </Connection> + </Connections> + <Tables> + <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="db_usersTableAdapter" GeneratorDataComponentClassName="db_usersTableAdapter" Name="db_users" UserDataComponentName="db_usersTableAdapter"> + <MainSource> + <DbSource ConnectionRef="dadConnectionString (Web.config)" DbObjectName="tcdb.dbo.sel_users" DbObjectType="StoredProcedure" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill"> + <InsertCommand> + <DbCommand CommandType="StoredProcedure" ModifiedByUser="False"> + <CommandText>dbo.ins_user</CommandText> + <Parameters> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@username" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="username" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@firstName" Precision="0" ProviderType="VarChar" Scale="0" Size="24" SourceColumn="firstName" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@lastName" Precision="0" ProviderType="VarChar" Scale="0" Size="24" SourceColumn="lastName" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@email" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="email" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@officePhone" Precision="0" ProviderType="VarChar" Scale="0" Size="14" SourceColumn="officePhone" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@homePhone" Precision="0" ProviderType="VarChar" Scale="0" Size="14" SourceColumn="homePhone" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@cellPhone" Precision="0" ProviderType="VarChar" Scale="0" Size="14" SourceColumn="cellPhone" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@automation" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumn="automation" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + </Parameters> + </DbCommand> + </InsertCommand> + <SelectCommand> + <DbCommand CommandType="StoredProcedure" ModifiedByUser="False"> + <CommandText>dbo.sel_users</CommandText> + <Parameters> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@username" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@userID" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + </Parameters> + </DbCommand> + </SelectCommand> + <UpdateCommand> + <DbCommand CommandType="StoredProcedure" ModifiedByUser="False"> + <CommandText>dbo.upd_users</CommandText> + <Parameters> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@userID" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="userID" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@username" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="username" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@email" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="email" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@officePhone" Precision="0" ProviderType="VarChar" Scale="0" Size="14" SourceColumn="officePhone" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@homePhone" Precision="0" ProviderType="VarChar" Scale="0" Size="14" SourceColumn="homePhone" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@cellPhone" Precision="0" ProviderType="VarChar" Scale="0" Size="14" SourceColumn="cellPhone" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@firstName" Precision="0" ProviderType="VarChar" Scale="0" Size="24" SourceColumn="firstName" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@lastName" Precision="0" ProviderType="VarChar" Scale="0" Size="24" SourceColumn="lastName" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@automation" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumn="automation" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + </Parameters> + </DbCommand> + </UpdateCommand> + </DbSource> + </MainSource> + <Mappings> + <Mapping SourceColumn="userID" DataSetColumn="userID" /> + <Mapping SourceColumn="username" DataSetColumn="username" /> + <Mapping SourceColumn="email" DataSetColumn="email" /> + <Mapping SourceColumn="officePhone" DataSetColumn="officePhone" /> + <Mapping SourceColumn="homePhone" DataSetColumn="homePhone" /> + <Mapping SourceColumn="cellPhone" DataSetColumn="cellPhone" /> + <Mapping SourceColumn="firstName" DataSetColumn="firstName" /> + <Mapping SourceColumn="lastName" DataSetColumn="lastName" /> + <Mapping SourceColumn="fullName" DataSetColumn="fullName" /> + <Mapping SourceColumn="automation" DataSetColumn="automation" /> + </Mappings> + <Sources> + </Sources> + </TableAdapter> + <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="db_productsTableAdapter" GeneratorDataComponentClassName="db_productsTableAdapter" Name="db_products" UserDataComponentName="db_productsTableAdapter"> + <MainSource> + <DbSource ConnectionRef="dadConnectionString (Web.config)" DbObjectName="tcdb.dbo.sel_products" DbObjectType="StoredProcedure" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill"> + <InsertCommand> + <DbCommand CommandType="StoredProcedure" ModifiedByUser="False"> + <CommandText>dbo.ins_product</CommandText> + <Parameters> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="255" SourceColumn="name" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@description" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="description" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@devManager" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="devManager" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@qaManager" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="qaManager" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@devLead" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="devLead" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@qaLead" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="qaLead" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pm" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="pm" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@codeName" Precision="0" ProviderType="VarChar" Scale="0" Size="10" SourceColumn="codeName" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@active" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumn="active" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + </Parameters> + </DbCommand> + </InsertCommand> + <SelectCommand> + <DbCommand CommandType="StoredProcedure" ModifiedByUser="False"> + <CommandText>dbo.sel_products</CommandText> + <Parameters> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@active" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@productID" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + </Parameters> + </DbCommand> + </SelectCommand> + <UpdateCommand> + <DbCommand CommandType="StoredProcedure" ModifiedByUser="False"> + <CommandText>dbo.upd_product</CommandText> + <Parameters> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@productID" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="productID" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@name" Precision="0" ProviderType="VarChar" Scale="0" Size="255" SourceColumn="name" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@description" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="description" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@devManager" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="devManager" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@qaManager" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="qaManager" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@devLead" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="devLead" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@qaLead" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="qaLead" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@pm" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumn="pm" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@codeName" Precision="0" ProviderType="VarChar" Scale="0" Size="10" SourceColumn="codeName" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + <Parameter AllowDbNull="True" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@active" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumn="active" SourceColumnNullMapping="False" SourceVersion="Current"> + </Parameter> + </Parameters> + </DbCommand> + </UpdateCommand> + </DbSource> + </MainSource> + <Mappings> + <Mapping SourceColumn="productID" DataSetColumn="productID" /> + <Mapping SourceColumn="name" DataSetColumn="name" /> + <Mapping SourceColumn="description" DataSetColumn="description" /> + <Mapping SourceColumn="devManager" DataSetColumn="devManager" /> + <Mapping SourceColumn="qaManager" DataSetColumn="qaManager" /> + <Mapping SourceColumn="devLead" DataSetColumn="devLead" /> + <Mapping SourceColumn="qaLead" DataSetColumn="qaLead" /> + <Mapping SourceColumn="pm" DataSetColumn="pm" /> + <Mapping SourceColumn="codeName" DataSetColumn="codeName" /> + <Mapping SourceColumn="active" DataSetColumn="active" /> + </Mappings> + <Sources> + </Sources> + </TableAdapter> + </Tables> + <Sources> + </Sources> + </DataSource> + </xs:appinfo> + </xs:annotation> + <xs:element name="dadDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dadDataSet" msprop:Generator_DataSetName="dadDataSet"> + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="db_users" msprop:Generator_UserTableName="db_users" msprop:Generator_RowDeletedName="db_usersRowDeleted" msprop:Generator_TableClassName="db_usersDataTable" msprop:Generator_RowChangedName="db_usersRowChanged" msprop:Generator_RowClassName="db_usersRow" msprop:Generator_RowChangingName="db_usersRowChanging" msprop:Generator_RowEvArgName="db_usersRowChangeEvent" msprop:Generator_RowEvHandlerName="db_usersRowChangeEventHandler" msprop:Generator_TablePropName="db_users" msprop:Generator_TableVarName="tabledb_users" msprop:Generator_RowDeletingName="db_usersRowDeleting"> + <xs:complexType> + <xs:sequence> + <xs:element name="userID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="userID" msprop:Generator_ColumnPropNameInRow="userID" msprop:Generator_ColumnVarNameInTable="columnuserID" msprop:Generator_ColumnPropNameInTable="userIDColumn" type="xs:int" /> + <xs:element name="username" msprop:Generator_UserColumnName="username" msprop:Generator_ColumnPropNameInRow="username" msprop:Generator_ColumnVarNameInTable="columnusername" msprop:Generator_ColumnPropNameInTable="usernameColumn"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="50" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="email" msprop:Generator_UserColumnName="email" msprop:Generator_ColumnPropNameInRow="email" msprop:Generator_ColumnVarNameInTable="columnemail" msprop:Generator_ColumnPropNameInTable="emailColumn"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="50" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="officePhone" msprop:Generator_UserColumnName="officePhone" msprop:Generator_ColumnPropNameInRow="officePhone" msprop:Generator_ColumnVarNameInTable="columnofficePhone" msprop:Generator_ColumnPropNameInTable="officePhoneColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="14" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="homePhone" msprop:Generator_UserColumnName="homePhone" msprop:Generator_ColumnPropNameInRow="homePhone" msprop:Generator_ColumnVarNameInTable="columnhomePhone" msprop:Generator_ColumnPropNameInTable="homePhoneColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="14" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="cellPhone" msprop:Generator_UserColumnName="cellPhone" msprop:Generator_ColumnPropNameInRow="cellPhone" msprop:Generator_ColumnVarNameInTable="columncellPhone" msprop:Generator_ColumnPropNameInTable="cellPhoneColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="14" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="firstName" msprop:Generator_UserColumnName="firstName" msprop:Generator_ColumnPropNameInRow="firstName" msprop:Generator_ColumnVarNameInTable="columnfirstName" msprop:Generator_ColumnPropNameInTable="firstNameColumn"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="24" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="lastName" msprop:Generator_UserColumnName="lastName" msprop:Generator_ColumnPropNameInRow="lastName" msprop:Generator_ColumnVarNameInTable="columnlastName" msprop:Generator_ColumnPropNameInTable="lastNameColumn"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="24" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="fullName" msdata:ReadOnly="true" msprop:Generator_UserColumnName="fullName" msprop:Generator_ColumnPropNameInRow="fullName" msprop:Generator_ColumnVarNameInTable="columnfullName" msprop:Generator_ColumnPropNameInTable="fullNameColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="49" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="automation" msprop:Generator_UserColumnName="automation" msprop:Generator_ColumnPropNameInRow="automation" msprop:Generator_ColumnVarNameInTable="columnautomation" msprop:Generator_ColumnPropNameInTable="automationColumn" type="xs:boolean" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="db_products" msprop:Generator_UserTableName="db_products" msprop:Generator_RowDeletedName="db_productsRowDeleted" msprop:Generator_TableClassName="db_productsDataTable" msprop:Generator_RowChangedName="db_productsRowChanged" msprop:Generator_RowClassName="db_productsRow" msprop:Generator_RowChangingName="db_productsRowChanging" msprop:Generator_RowEvArgName="db_productsRowChangeEvent" msprop:Generator_RowEvHandlerName="db_productsRowChangeEventHandler" msprop:Generator_TablePropName="db_products" msprop:Generator_TableVarName="tabledb_products" msprop:Generator_RowDeletingName="db_productsRowDeleting"> + <xs:complexType> + <xs:sequence> + <xs:element name="productID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="productID" msprop:Generator_ColumnPropNameInRow="productID" msprop:Generator_ColumnVarNameInTable="columnproductID" msprop:Generator_ColumnPropNameInTable="productIDColumn" type="xs:int" /> + <xs:element name="name" msprop:Generator_UserColumnName="name" msprop:Generator_ColumnPropNameInRow="name" msprop:Generator_ColumnVarNameInTable="columnname" msprop:Generator_ColumnPropNameInTable="nameColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="255" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="description" msprop:Generator_UserColumnName="description" msprop:Generator_ColumnPropNameInRow="description" msprop:Generator_ColumnVarNameInTable="columndescription" msprop:Generator_ColumnPropNameInTable="descriptionColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="2147483647" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="devManager" msprop:Generator_UserColumnName="devManager" msprop:Generator_ColumnPropNameInRow="devManager" msprop:Generator_ColumnVarNameInTable="columndevManager" msprop:Generator_ColumnPropNameInTable="devManagerColumn" type="xs:int" minOccurs="0" /> + <xs:element name="qaManager" msprop:Generator_UserColumnName="qaManager" msprop:Generator_ColumnPropNameInRow="qaManager" msprop:Generator_ColumnVarNameInTable="columnqaManager" msprop:Generator_ColumnPropNameInTable="qaManagerColumn" type="xs:int" minOccurs="0" /> + <xs:element name="devLead" msprop:Generator_UserColumnName="devLead" msprop:Generator_ColumnPropNameInRow="devLead" msprop:Generator_ColumnVarNameInTable="columndevLead" msprop:Generator_ColumnPropNameInTable="devLeadColumn" type="xs:int" minOccurs="0" /> + <xs:element name="qaLead" msprop:Generator_UserColumnName="qaLead" msprop:Generator_ColumnPropNameInRow="qaLead" msprop:Generator_ColumnVarNameInTable="columnqaLead" msprop:Generator_ColumnPropNameInTable="qaLeadColumn" type="xs:int" minOccurs="0" /> + <xs:element name="pm" msprop:Generator_UserColumnName="pm" msprop:Generator_ColumnPropNameInRow="pm" msprop:Generator_ColumnVarNameInTable="columnpm" msprop:Generator_ColumnPropNameInTable="pmColumn" type="xs:int" minOccurs="0" /> + <xs:element name="codeName" msprop:Generator_UserColumnName="codeName" msprop:Generator_ColumnPropNameInRow="codeName" msprop:Generator_ColumnVarNameInTable="columncodeName" msprop:Generator_ColumnPropNameInTable="codeNameColumn" minOccurs="0"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:maxLength value="10" /> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="active" msprop:Generator_UserColumnName="active" msprop:Generator_ColumnPropNameInRow="active" msprop:Generator_ColumnVarNameInTable="columnactive" msprop:Generator_ColumnPropNameInTable="activeColumn" type="xs:boolean" /> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:choice> + </xs:complexType> + <xs:unique name="Constraint1" msdata:PrimaryKey="true"> + <xs:selector xpath=".//mstns:db_users" /> + <xs:field xpath="mstns:email" /> + <xs:field xpath="mstns:firstName" /> + <xs:field xpath="mstns:lastName" /> + </xs:unique> + <xs:unique name="db_products_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true"> + <xs:selector xpath=".//mstns:db_products" /> + <xs:field xpath="mstns:productID" /> + </xs:unique> + </xs:element> +</xs:schema> \ No newline at end of file Added: Website/App_Code/dadDataSet.xss =================================================================== --- Website/App_Code/dadDataSet.xss (rev 0) +++ Website/App_Code/dadDataSet.xss 2006-07-07 23:33:22 UTC (rev 89) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--<autogenerated> + This code was generated by a tool to store the dataset designer's layout information. + Changes to this file may cause incorrect behavior and will be lost if + the code is regenerated. +</autogenerated>--> +<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="0" ViewPortY="0" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout"> + <Shapes> + <Shape ID="DesignTable:db_users" ZOrder="2" X="87" Y="57" Height="241" Width="201" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="194" /> + <Shape ID="DesignTable:db_products" ZOrder="1" X="381" Y="68" Height="241" Width="213" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="194" /> + </Shapes> + <Connectors /> +</DiagramLayout> \ No newline at end of file Modified: Website/App_Themes/Python/python.css =================================================================== --- Website/App_Themes/Python/python.css 2006-07-07 22:50:32 UTC (rev 88) +++ Website/App_Themes/Python/python.css 2006-07-07 23:33:22 UTC (rev 89) @@ -67,42 +67,27 @@ { padding-right: 30px; } +/********** END Header Content **********/ +/********** BEGIN Login Content **********/ /* Define the login information */ -#User table +#Login table { - display: inline; - margin-top: 15px; - position: relative; - top: 8px; + margin: 20px; } -#User table td -{ - display: inline; -} - -/* Define the username and password box sizes */ -#User #UserNameControl, #User #PasswordControl -{ - display: inline; -} - #UserNameControl input, #PasswordControl input { - width: 80px; + width: 100px; } -#User #RememberMeControl +#RememberMeControl { - display: inline; position: relative; top: 2px; left: -4px; } -/********** END Header Content **********/ - /********** BEGIN Footer Content **********/ #FooterContent A { Added: Website/Includes/Authenticate.ascx =================================================================== --- Website/Includes/Authenticate.ascx (rev 0) +++ Website/Includes/Authenticate.ascx 2006-07-07 23:33:22 UTC (rev 89) @@ -0,0 +1,163 @@ +<%@ Control Language="C#" ClassName="Authenticate" %> +<%@ Import Namespace="TCDB_Users" %> +<%@ Import Namespace="TCDB_Constants" %> +<%@ Import Namespace="TCDB_Products" %> +<%@ Import Namespace="System.Collections.Generic" %> +<%@ Import Namespace="System.Data" %> + +<script runat="server"> + + void Page_Load(Object sender, EventArgs e) + { + LoginUser.Visible = true; + CreateUser.Visible = false; + Results.Visible = false; + } + + protected void Login_Authenticate(object sender, EventArgs e) + { + + TCDB_User myUser = new TCDB_User(); + myUser = TCDB_UserDB.TCDB_AuthenticateUser(LoginUser.UserName, LoginUser.Password); + + if (myUser.USERID > TCDB_Constant.USER_ANONYMOUSUSERID) + { + // We have a valid user who is already in the DB + FormsAuthentication.SetAuthCookie(LoginUser.UserName, LoginUser.RememberMeSet); + Response.Redirect(FormsAuthentication.GetRedirectUrl(LoginUser.UserName, LoginUser.RememberMeSet)); + } + else if (myUser.USERID < TCDB_Constant.USER_ANONYMOUSUSERID) + { + // We have a valid user who needs to be added to the DB + + // Populate the new user control + cuUserName.Text = myUser.USERNAME; + cuFirstName.Text = myUser.FIRSTNAME; + cuLastName.Text = myUser.LASTNAME; + cuEmail.Text = myUser.EMAIL; + cuOfficePhone.Text = myUser.OFFICEPHONE; + cuHomePhone.Text = myUser.HOMEPHONE; + cuCellPhone.Text = myUser.CELLPHONE; + + // Populate the product with a list of products + // Create a table to store data for the DropDownListControl + DataTable dt = new DataTable(); + + // Define the columns used + dt.Columns.Add(new DataColumn("id", typeof(int))); + dt.Columns.Add(new DataColumn("name", typeof(string))); + + List<TCDB_Product> productList = TCDB_ProductDB.TCDB_GetProductList(true); + foreach (TCDB_Product product in productList) + { + DataRow dr = dt.NewRow(); + dr["id"] = product.PRODUCTID; + dr["name"] = product.NAME; + dt.Rows.Add(dr); + } + + // Create a DataView from dt to act as the ds for the control + cuProduct.DataSource = new DataView(dt); + + cuProduct.DataValueField = "id"; + cuProduct.DataTextField = "name"; + + // Bind the data to the control + cuProduct.DataBind(); + + // Hide the login control and show the new user control + LoginUser.Visible = false; + CreateUser.Visible = true; + Results.Visible = false; + } + } + + protected void Create_User(object sender, EventArgs e) + { + // TODO: make the call to the TCDB_UserDB.CreateUser or whatever to save the userinfo to the DB + + // TODO: Lookup the admin/lead for the selected product and send an action item to give permissions + + // TODO: Populate the results control with text from the DB + Results.Text = "Your user has been created. Please check with your product admin for access."; + + // Hide and show the appropriate controls + LoginUser.Visible = false; + CreateUser.Visible = false; + Results.Visible = true; + } +</script> + + +<asp:Login ID="LoginUser" OnAuthenticate="Login_Authenticate" runat="server"> + <LayoutTemplate> + Please login<br /> + <asp:Label ID="lblMessage" runat="server" Text="" /> + <div id="UserNameControl">Username: <asp:TextBox ID="UserName" runat="server" /></div><asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" Text="*" /> + <div id="PasswordControl">Password: <asp:TextBox ID="Password" runat="server" TextMode="password" /></div><asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" Text="*" /> + <div id="RememberMeControl">Remember Me: <asp:CheckBox ID="RememberMe" runat="server" /></div> + <asp:LinkButton ID="LoginControl" CommandName="Login" Text="Login" runat="server" /> + </LayoutTemplate> +</asp:Login> + +<asp:Wizard ID="CreateUser" runat="server" DisplaySideBar="false" FinishCompleteButtonType="Link" FinishCompleteButtonText="Create User" OnFinishButtonClick="Create_User"> + <WizardSteps> + <asp:WizardStep ID="CreateUserStep1" runat="server" StepType="auto"> + <div id="Title">Please Verify Your Details</div> + <div id="UserName"><asp:Label ID="UserNameText" runat="server" AssociatedControlID="cuUserName">User Name:</asp:Label></div> + <div id="UserNameControl"> + <asp:TextBox ID="cuUserName" runat="server" ReadOnly="true"></asp:TextBox> + <as... [truncated message content] |