Exemplo n.º 1
0
    private void BindGrid(string type)
    {
        //at = SpringUtil.at();

        /* 帳號未審核 */
        String sql = "SELECT IsApproved, UserId,UserName,Email,CreateDate,'' as Type,'' as Name,'' as Corp,'' as Tel    ";

        sql += " from vw_aspnet_MembershipUsers   ";
        if (type.Equals("A"))
        {
            sql += " where IsApproved=false ";
        }
        else if (type.Equals("B"))
        {
            sql += " where UserName not in ('isrmng','root') ";
        }

        if (!qryText.Text.Trim().Equals(""))
        {
            sql += " and Comment like '%" + qryText.Text.Trim() + "%'";
        }

        //DataSet ds = new DataSet();
        //at.DataSetFill(ds, CommandType.Text, sql);

        OleDbCommand cmd = new OleDbCommand(sql);
        DataSet      ds  = SQLUtil.QueryDS(cmd);

        foreach (DataRow dRow in ds.Tables[0].Rows)
        {
            p            = Profile.GetProfile(dRow["UserName"].ToString());
            dRow["Type"] = p.UserProfile.Type;
            dRow["Name"] = p.UserProfile.Name;
            dRow["Corp"] = p.UserProfile.Corp;
            dRow["Tel"]  = p.UserProfile.Tel;
        }
        ApproveGrid.DataSource = ds;

        ApproveGrid.DataBind();

        cnt.Text = Convert.ToString(ds.Tables[0].Rows.Count);
    }
        private void ApprovingScreen_Load(object sender, EventArgs e)
        {
            List <int> dersIds = new List <int>();

            for (int i = 0; i < ogrenci.AlinanDersler.Length; i += 2)
            {
                string dummy = ogrenci.AlinanDersler.Substring(i, 2);
                dersIds.Add(Convert.ToInt32(dummy));
            }
            ApproveGrid.DataSource = DersDAO.ApprovingList(dersIds);
            if (ApproveGrid.DataSource == null)
            {
                this.Close();
            }

            for (int i = 4; i < ApproveGrid.ColumnCount; i++)
            {
                ApproveGrid.Columns[i].ReadOnly = true;
            }

            ApproveGrid.AutoResizeColumns();
        }