Пример #1
0
        private bool ezCheckname(string sUserName)
        {
            bool     bln_checkname = true;
            Ezadonet ezadonet      = new Ezadonet();

            try
            {
                ezadonet.Open();
                ezadonet.CommandText = "SELECT [CustID] FROM [dbo].[Customer] WHERE [CustName]=@CustName";
                ezadonet.ParametersClear();
                ezadonet.ParametersAdd("@CustName", txt_name.Text);
                bln_checkname = ezadonet.HasRow;
                if (bln_checkname)
                {
                    sUserName = ezadonet.GetStringValue("CustID");
                }
            }
            catch (Exception e)
            {
                lbl_message1.Text = e.Message;
                lbl_message2.Text = e.Message;
            }
            finally {
                ezadonet.Close();
            }

            return(bln_checkname);
        }
Пример #2
0
        private bool CheckUser(ref string sUerName, ref string sUerID)
        {
            bool     bln_checkok = false;
            Ezadonet ezdonet     = new Ezadonet();

            try
            {
                ezdonet.Open();
                ezdonet.CommandText = "SELECT CustName FROM Customer WHERE CustID = @mno AND CustPassword = @mpassword";
                ezdonet.ParametersClear();
                ezdonet.ParametersAdd("@mno", txt_account.Text);
                ezdonet.ParametersAdd("@mpassword", txt_password.Text);
                bln_checkok = ezdonet.HasRow;
                if (bln_checkok)
                {
                    sUerName = ezdonet.GetStringValue("CustName");
                    sUerID   = txt_account.Text;
                }
            }
            catch (Exception e)
            {
                lbl_message.Text = e.Message;
            }
            finally
            {
                ezdonet.Close();
            }

            return(bln_checkok);
        }