コード例 #1
0
        protected void find_Click(object sender, EventArgs e)
        {
            users.Visible = true;
            if (accountID.Value != null && accountID.Value != String.Empty)
            {
                int ID = int.Parse(accountID.Value);
                DBC.SQLStore SQL = new DBC.SQLStore();
                DataTable DT = SQL.CompanyExchangeUsers(ID);
                int col = DT.Columns.Count;
                List<Api.Objects.Parallels.ExchnageUserProp> list = new List<Api.Objects.Parallels.ExchnageUserProp>();
                foreach (DataRow row in DT.Rows)
                {
                    Api.Objects.Parallels.ExchnageUserProp user = new Api.Objects.Parallels.ExchnageUserProp();
                    user.CompanyName = row[1].ToString();
                    user.MailboxID = Convert.ToInt32(row[7]);
                    user.DisplayName = row[4].ToString();
                    user.UPN = row[3].ToString();
                    list.Add(user);
                }

                userGR.DataSource = list;
                userGR.DataBind();
            }
            else
            {
                warning.Visible = true;
            }
        }
コード例 #2
0
 protected void userGR_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("detail"))
     {
         int index = Convert.ToInt32(e.CommandArgument);
         string id = userGR.DataKeys[index].Value.ToString();
         int mailboxid = int.Parse(id);
         int accountid = int.Parse(accountID.Value);
         DBC.SQLStore SQL = new DBC.SQLStore();
         DataTable detailTable = SQL.ExchangeUserinCompany(accountid, mailboxid);
         DetailsView1.DataSource = detailTable;
         DetailsView1.DataBind();
         System.Text.StringBuilder sb = new System.Text.StringBuilder();
         sb.Append(@"<script type='text/javascript'>");
         sb.Append("$('#currentdetail').modal('show');");
         sb.Append(@"</script>");
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
             "ModalScript", sb.ToString(), false);
     }
 }