コード例 #1
0
        public void ReportView()
        {
            try
            {
                if (Session["DS_USER"] != null)
                {
                    var dsDiseño    = new dsUsers();
                    var dsEjecucion = (DataSet)Session["DS_USER"];

                    for (var i = 0; i < dsEjecucion.Tables[0].Rows.Count; i++)
                    {
                        var row = dsDiseño.USERS.NewRow();
                        row[0] = dsEjecucion.Tables[0].Rows[i]["CORRELATIVE"];
                        row[1] = dsEjecucion.Tables[0].Rows[i]["LOGIN"];
                        row[2] = dsEjecucion.Tables[0].Rows[i]["NAME_USER"];
                        row[3] = dsEjecucion.Tables[0].Rows[i]["TYPE_USER"];
                        dsDiseño.USERS.Rows.Add(row);
                    }
                    Session["DS_USER_DISEÑO"] = dsDiseño;
                    var reporte = new ReportUser {
                        DataSource = Session["DS_USER_DISEÑO"]
                    };
                    ASPxDocumentViewer1.DataBind();
                    ASPxDocumentViewer1.Report = reporte;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
コード例 #2
0
    public dsUsers FindUser(string Username)
    {
        dsUsers dsFoundUser = myDataLayer.findUser(Username);

        if (dsFoundUser.tblUsers.Rows.Count > 0)
        {
            System.Data.DataRow userRecord = dsFoundUser.tblUsers.Rows[0];

            if (userRecord["Username"] == DBNull.Value)
            {
                userRecord["Username"] = string.Empty;
            }
            if (userRecord["City"] == DBNull.Value)
            {
                userRecord["City"] = string.Empty;
            }
            if (userRecord["State"] == DBNull.Value)
            {
                userRecord["State"] = string.Empty;
            }
            if (userRecord["FavoriteLanguage"] == DBNull.Value)
            {
                userRecord["FavoriteLanguage"] = string.Empty;
            }
            if (userRecord["LeastFavoriteLanguage"] == DBNull.Value)
            {
                userRecord["LeastFavoriteLanguage"] = string.Empty;
            }
            if (userRecord["LastProgramDate"] == DBNull.Value)
            {
                userRecord["LastProgramDate"] = string.Empty;
            }
        }
        return(dsFoundUser);
    }
コード例 #3
0
ファイル: dsUsers.Designer.cs プロジェクト: Kiselb/bps
        public override global::System.Data.DataSet Clone()
        {
            dsUsers cln = ((dsUsers)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
コード例 #4
0
    public dsUsers deleteUser(string Username)
    {
        string           sqlStmt        = "DELETE FROM tblUsers WHERE Username = '******'";
        OleDbDataAdapter sqlDataAdapter = new OleDbDataAdapter(sqlStmt, dbConnection);

        dsUsers loginDataSet = new dsUsers();

        sqlDataAdapter.Fill(loginDataSet.tblUsers);

        return(loginDataSet);
    }
コード例 #5
0
    public dsUsers findUser(string Username)
    {
        string           sqlStmt        = "SELECT * FROM tblUsers where Username like '" + Username + "'";
        OleDbDataAdapter sqlDataAdapter = new OleDbDataAdapter(sqlStmt, dbConnection);

        dsUsers loginDataSet = new dsUsers();

        sqlDataAdapter.Fill(loginDataSet.tblUsers);

        return(loginDataSet);
    }
コード例 #6
0
ファイル: dsUsers.Designer.cs プロジェクト: Kiselb/bps
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            dsUsers ds = new dsUsers();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
コード例 #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         // Declares the DataSet
         dsUsers myDataSet = new dsUsers();
         // Fill the dataset with what is returned from the function
         myDataSet = clsDataLayer.GetUsers(Server.MapPath("NDSU Testing Tutor Tables.accdb"));
         // Sets the DataGrid to the DataSource based on the table
         grdViewUsers.DataSource = myDataSet.Tables["Users"];
         // Binds the DataGrid
         grdViewUsers.DataBind();
     }
 }
コード例 #8
0
    public static dsUsers GetUsers(string Database)
    {
        // Add your comments here
        dsUsers          DS;
        OleDbConnection  sqlConn;
        OleDbDataAdapter sqlDA;

        // Add your comments here
        sqlConn = new OleDbConnection("PROVIDER=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Database);
        // Add your comments here
        sqlDA = new OleDbDataAdapter("select * from Users", sqlConn);
        // Add your comments here
        DS = new dsUsers();
        // Add your comments here
        sqlDA.Fill(DS.Users);
        //dd your comments here
        return(DS);
    }
コード例 #9
0
    public static dsUsers VerifyUser(string Database, string UserName, string UserPassword)
    {
        dsUsers          DS;
        OleDbConnection  sqlConn;
        OleDbDataAdapter sqlDA;


        sqlConn = new OleDbConnection(clsDataLayer.GetDataConnection());


        sqlDA = new OleDbDataAdapter("Select UserSecLevel from Users " +
                                     "where UserLogon like '" + UserName + "' " +
                                     "and UserPassword like '" + UserPassword + "'", sqlConn);


        DS = new dsUsers();
        sqlDA.Fill(DS.Users);
        return(DS);
    }
コード例 #10
0
ファイル: daUsers.cs プロジェクト: capecoder/RovingGM
        public dsUsers GetAllUsers()
        {
            dsUsers       tempDS     = new dsUsers();
            SqlConnection connection = new SqlConnection(
                Configuration.GetValue("DSN"));

            connection.Open();

            SqlCommand command = new SqlCommand();

            command.CommandText = "Users_GetAll";
            command.CommandType = CommandType.StoredProcedure;
            SqlParameterCollection parameters = command.Parameters;

            command.Connection = connection;

            SqlDataAdapter da = new SqlDataAdapter(command);

            da.Fill(tempDS);

            connection.Close();

            return(tempDS);
        }
コード例 #11
0
ファイル: dsUsers.Designer.cs プロジェクト: Kiselb/bps
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                dsUsers ds = new dsUsers();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "UsersDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }
コード例 #12
0
    public dsUsers RemoveUser(string Username)
    {
        dsUsers dsRemoveUser = myDataLayer.deleteUser(Username);

        return(dsRemoveUser);
    }