Example #1
0
        private void cbNetworkName_SelectedIndexChanged(object sender, EventArgs e)
        {
            UserID = 0;

            if (cbNetworkName.Text.Trim() != "")
            {
                try
                {
                    using (DataStuff sn = new DataStuff())
                    {
                        DataTable dt = sn.GetNetworkSystemUserByID(cbNetworkName.Text);

                        if (dt.Rows.Count > 0)
                        {
                            foreach (DataRow row in dt.Rows)
                            {
                                tName.Text  = row["UserName"].ToString();
                                tEmail.Text = row["EmailAddress"].ToString();
                                UserID      = Convert.ToInt32(row["UserID"].ToString());

                                cbRole.Text = row["RoleName"].ToString();

                                if (row["Active"].ToString() == "Y")
                                {
                                    cUserActive.Checked = true;
                                }
                                else
                                {
                                    cUserActive.Checked = false;
                                }
                            }

                            if (cbNetworkName.Text.Trim() != "")
                            {
                                tsbCancelUserEdit.Enabled = false;
                                tsbDeleteUser.Enabled     = true;
                                tsbNewUser.Enabled        = true;
                                tsbSaveUser.Enabled       = true;
                            }
                            else
                            {
                                tsbCancelUserEdit.Enabled = false;
                                tsbDeleteUser.Enabled     = false;
                                tsbNewUser.Enabled        = true;
                                tsbSaveUser.Enabled       = true;
                            }
                        }
                    }
                }

                catch
                {
                    throw;
                }
            }
        }