Пример #1
0
    private void getPersonalInfo(Int16 UserId)
    {
        cUser myUser = new cUser();
        cDAL  dal    = new cDAL();

        myUser       = dal.PersonalInformation(UserId);
        tbInfo2.Text = myUser.FirstName.ToString();
        tbInfo3.Text = myUser.LastName.ToString();
        tbInfo4.Text = myUser.PhoneNumber.ToString();
        tbInfo5.Text = myUser.County.ToString();
        tbInfo6.Text = myUser.Street.ToString();
        tbInfo7.Text = myUser.ZIP.ToString();

        btnLogIn.Visible      = false;
        btnRegistry.Visible   = false;
        btnLogOut.Visible     = true;
        lbLogInText.Visible   = false;
        btnLogIn2.Visible     = false;
        UserImg1.Visible      = true;
        tbInfo2.Visible       = true;
        tbInfo3.Visible       = true;
        tbInfo4.Visible       = true;
        tbInfo5.Visible       = true;
        tbInfo6.Visible       = true;
        tbInfo7.Visible       = true;
        btnChangeInfo.Visible = true;
    }
Пример #2
0
    private void getPersonalInfo(Int16 UserId)
    {
        cUser myUser = new cUser();
        cDAL  dal    = new cDAL();

        myUser = dal.PersonalInformation(UserId);

        btnLogIn.Visible    = false;
        btnRegistry.Visible = false;
        btnLogOut.Visible   = true;
    }
Пример #3
0
    protected void btnChangeInfo_Click(object sender, EventArgs e)
    {
        cUser myUser = new cUser();
        cDAL  dal    = new cDAL();

        tbInfo2.Enabled         = true;
        tbInfo3.Enabled         = true;
        tbInfo4.Enabled         = true;
        tbInfo5.Enabled         = true;
        tbInfo6.Enabled         = true;
        tbInfo7.Enabled         = true;
        btnChangeInfo.Visible   = false;
        btnBackToMyPage.Visible = true;

        lbBokningsText.Visible = false;
        repBokningar.Visible   = false;

        btnSaveChanges.Visible = true;
    }
Пример #4
0
        public static void Test()
        {
            System.Data.SqlClient.SqlConnectionStringBuilder csb = new System.Data.SqlClient.SqlConnectionStringBuilder();

            csb.DataSource = System.Environment.MachineName;

            csb.IntegratedSecurity = true;
            if (!csb.IntegratedSecurity)
            {
                csb.UserID = "DAL_Test";
                csb.Password = "******";
            } // End if (!csb.IntegratedSecurity) 

            csb.InitialCatalog = "COR_Basic_Demo_V4";


            cDAL DAL = cDAL.CreateInstance();
            DAL.ConnectionString = csb.ConnectionString;

            using (System.Data.Common.DbConnection dbConnection = DAL.GetConnection())
            {
                object objUser1 = DAL.ExecuteScalar("SELECT TOP 1 BE_User FROM T_Benutzer ORDER BY BE_User;", dbConnection);
                object objUser2 = DAL.ExecuteScalar("SELECT TOP 1 BE_User FROM T_Benutzer ORDER BY BE_ID;", dbConnection);

                DAL.ExecuteNonQuery("UPDATE T_Benutzer SET BE_Hash = BE_Hash;", dbConnection);
                DAL.ExecuteNonQuery("UPDATE T_Benutzer SET BE_Hash = BE_Hash;", dbConnection);


#if WITH_CONNECTION 
                //using (System.Data.Common.DbDataReader reader = DAL.ExecuteReader("SELECT * FROM T_Benutzer; SELECT * FROM T_Benutzergruppen;", dbConnection))
                using (System.Data.Common.DbDataReader reader = DAL.ExecuteReader_Buggy("SELECT * FROM T_Benutzer; SELECT * FROM T_Benutzergruppen;"))
#else
                DAL.ExecuteReader("SELECT * FROM T_Benutzer; SELECT * FROM T_Benutzergruppen;", delegate(System.Data.Common.DbDataReader reader)
#endif
                {

                    do
                    {
                        for (int i = 0; i < reader.FieldCount; ++i)
                        {
                            string fieldName = reader.GetName(i);
                            System.Type fieldType = reader.GetFieldType(i);

                            System.Console.WriteLine("{0}:\t{1}\t{2}", i, fieldName, fieldType.ToString());
                        } // Next i 


                        if (reader.HasRows)
                        {
                            int rowCount = 1;

                            while (reader.Read())
                            {

                                System.Console.WriteLine(@"Row {0}", rowCount);
                                for (int i = 0; i < reader.FieldCount; ++i)
                                {
                                    string fieldName = reader.GetName(i);
                                    object fieldValue = reader.GetValue(i);

                                    System.Console.WriteLine(@" - {0}: {1}", fieldName, System.Convert.ToString(fieldValue));
                                } // Next i 

                                ++rowCount;
                            } // Whend 

                            --rowCount;
                        } // End if (reader.HasRows)

                    } while (reader.NextResult());

                } // End Using reader 
#if !WITH_CONNECTION
                );
#endif
                object objUser3 = DAL.ExecuteScalar("SELECT TOP 1 BE_User FROM T_Benutzer ORDER BY BE_Hash;", dbConnection);
                object objUser4 = DAL.ExecuteScalar("SELECT TOP 1 BE_User FROM T_Benutzer ORDER BY BE_Passwort;", dbConnection);

            } // End Using dbConnection


        } // End Sub Test