示例#1
0
        public bool Invoke()
        {
            bool complete = false;

            try
            {
                EndUserLoginSelectData enduserlogin = new EndUserLoginSelectData();
                enduserlogin.EndUser = this.EndUser;
                ResultSet            = enduserlogin.Get();

                if (ResultSet.Tables[0].Rows.Count != 0)
                {
                    EndUser.EndUserID             = int.Parse(ResultSet.Tables[0].Rows[0]["EndUserID"].ToString());
                    EndUser.EndUserTypeID         = int.Parse(ResultSet.Tables[0].Rows[0]["EndUserTypeID"].ToString());
                    EndUser.FirstName             = ResultSet.Tables[0].Rows[0]["Firstname"].ToString();
                    EndUser.LastName              = ResultSet.Tables[0].Rows[0]["LastName"].ToString();
                    EndUser.AddressID             = int.Parse(ResultSet.Tables[0].Rows[0]["AddressID"].ToString());
                    EndUser.ContactInformtationID = int.Parse(ResultSet.Tables[0].Rows[0]["ContactInformationID"].ToString());
                    EndUser.Password              = ResultSet.Tables[0].Rows[0]["Password"].ToString();

                    // Obtain the Address information.
                    ProcessGetAddress getaddress = new ProcessGetAddress();
                    getaddress.Address.AddressID = EndUser.AddressID;

                    if (getaddress.Invoke())
                    {
                        EndUser.Address = getaddress.Address;
                    }

                    // Obtain the ContactInformation information.
                    ProcessGetContactInformation getcontactinfo = new ProcessGetContactInformation();
                    getcontactinfo.ContactInformation.ContactInformationID = EndUser.ContactInformtationID;

                    if (getcontactinfo.Invoke())
                    {
                        EndUser.ContactInformation = getcontactinfo.ContactInformation;
                    }

                    complete = true;
                }
                else
                {
                    complete = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(complete);
        }
        public void Invoke()
        {
            EndUserLoginSelectData enduserlogin = new EndUserLoginSelectData();

            enduserlogin.EndUser = this.EndUser;
            ResultSet            = enduserlogin.Get();

            if (ResultSet.Tables[0].Rows.Count != 0)
            {
                IsAuthenticated = true;

                EndUser.EndUserID            = int.Parse(ResultSet.Tables[0].Rows[0]["EndUserID"].ToString());
                EndUser.EndUserTypeID        = int.Parse(ResultSet.Tables[0].Rows[0]["EndUserTypeID"].ToString());
                EndUser.FirstName            = ResultSet.Tables[0].Rows[0]["Firstname"].ToString();
                EndUser.LastName             = ResultSet.Tables[0].Rows[0]["LastName"].ToString();
                EndUser.AddressID            = int.Parse(ResultSet.Tables[0].Rows[0]["AddressID"].ToString());
                EndUser.ContactInformationID = int.Parse(ResultSet.Tables[0].Rows[0]["ContactInformationID"].ToString());
                EndUser.Password             = ResultSet.Tables[0].Rows[0]["Password"].ToString();

                // Obtain the Address information.
                ProcessGetAddress getaddress = new ProcessGetAddress();
                getaddress.Address.AddressID = EndUser.AddressID;

                getaddress.Invoke();
                EndUser.Address = getaddress.Address;

                // Obtain the ContactInformation information.
                ProcessGetContactInformation getcontactinfo = new ProcessGetContactInformation();
                getcontactinfo.ContactInformation.ContactInformationID = EndUser.ContactInformationID;

                getcontactinfo.Invoke();

                EndUser.ContactInformation = getcontactinfo.ContactInformation;
            }
            else
            {
                IsAuthenticated = false;
                EndUser         = null;
            }
        }