protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    Response.Redirect("MemArea.aspx");
                }
                else
                {
                    con.ConnectionString = "Server=tcp:lpapalal.database.windows.net,1433;Initial Catalog=lna;Persist Security Info=False;User ID=lna;Password=Redbirdie05;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;";
                }
                con.Open();

                string str = "";
                str               = Convert.ToString(Session["user"]);
                cmd.CommandText   = "select * from Members where Email='" + str + "'";
                cmd.Connection    = con;
                sda.SelectCommand = cmd;
                sda.Fill(ds, "Members");
                NameLabel.Text = "Hi, " + ds.Tables[0].Rows[0]["FName"].ToString() + " " + ds.Tables[0].Rows[0]["LName"].ToString();
                TB1.Focus();

                SqlConnection  con5 = new SqlConnection("Server=tcp:lpapalal.database.windows.net,1433;Initial Catalog=lna;Persist Security Info=False;User ID=lna;Password=Redbirdie05;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;");
                SqlDataAdapter sda5 = new SqlDataAdapter("select * from Events", con5);
                DataTable      dt   = new DataTable();
                sda5.Fill(dt);
                Repeater1.DataSource = dt;
                Repeater1.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["user"] == null)
                {
                    Response.Redirect("MemArea.aspx");
                }
                else
                {
                    con.ConnectionString = "Data Source=localhost;Initial Catalog=RotaryClub;Integrated Security=True";
                }
                con.Open();

                string str = "";
                str               = Convert.ToString(Session["user"]);
                cmd.CommandText   = "select * from Members where Email='" + str + "'";
                cmd.Connection    = con;
                sda.SelectCommand = cmd;
                sda.Fill(ds, "Members");
                NameLabel.Text   = "Hi, " + ds.Tables[0].Rows[0]["FName"].ToString() + " " + ds.Tables[0].Rows[0]["LName"].ToString();
                DDL1.Visible     = false;
                DDLLabel.Visible = false;
                Button1.Visible  = false;
                Label1.Visible   = false;
                Roletxt.Visible  = false;
                Rolelbl.Visible  = false;
                TB1.Focus();
            }
        }
예제 #3
0
        public void Instruct(string cmd)
        {
            Debug.WriteLine("File Manager Input:  " + cmd);
            if (fmp != null)
            {
                firstItemNo = fmp.GetFirstItemNo();
                lastItemNo  = fmp.GetLastItemNo();
            }

            TB1.Text           = "";
            TB1.IsEnabled      = false;
            BORDER.BorderBrush = Brushes.Gray;
            Speak_Listen.Speak("");                                 // Tricky way to interrupt the file manager Voice Output

            /*
             *  READ THIS CAREFULLY BEFORE YOU ADD NEW case in switch
             *  =====================================================
             *
             *  NOTE 1:- Add this function at the start of your case(if it has nothing to do with variable "isFilterActive"):
             *  ------
             *              UpdateFilter(false);
             */

            switch (cmd)
            {
            case "Back":
                UpdateFilter(false);
                if (B.IsEnabled)
                {
                    Back();
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Next":
                UpdateFilter(false);
                if (N.IsEnabled)
                {
                    Next();
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Up":
                UpdateFilter(false);
                if (U.IsEnabled)
                {
                    Up();
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Down":
                UpdateFilter(false);
                if (D.IsEnabled)
                {
                    Down();
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Files":
            case "Folders":
                UpdateFilter(false);
                if (F.IsEnabled)
                {
                    if (cmd == F.Content.ToString())                        // If this is the same content as wrtten on the Button F.
                    {
                        FileOrFolder();
                    }
                    else
                    {
                        fmp.ReadOutListItems();
                    }
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Refresh":
                UpdateFilter(false);
                Refresh();
                break;

            case "Read Out":
                if (isFilterActive)
                {
                    ReadOutFilters();
                    firstItemNo = 1;                // For Dynamic Loading of Grammar in "Speak_Listen" class
                    lastItemNo  = 11;               // For Dynamic Loading of Grammar in "Speak_Listen" class
                }
                else
                {
                    fmp.ReadOutListItems();
                }
                break;

            case "Controls":
                UpdateFilter(false);
                ReadOutControls();
                break;

            case "Filter":
                if (pD == null)                              // If this is the home page of the file manager
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                else
                {
                    UpdateFilter(true);
                    ReadOutFilters();
                    firstItemNo = 1;                        // Use to dynamically load grammar in Speak_Listen class
                    lastItemNo  = 11;                       // Use to dynamically load grammar in Speak_Listen class
                }
                break;

            case "New Folder":
                UpdateFilter(false);
                if (NF1.IsEnabled)
                {
                    modifyListStatus   = 1;
                    BORDER.BorderBrush = Brushes.Yellow;
                    Speak_Listen.Speak("Type the name of the new folder.");
                    TB1.IsEnabled = true;
                    TB1.Focus();
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "New File":
                UpdateFilter(false);
                if (NF2.IsEnabled)
                {
                    modifyListStatus   = 2;
                    BORDER.BorderBrush = Brushes.Yellow;
                    Speak_Listen.Speak("Type the name of the new file.");
                    TB1.IsEnabled = true;
                    TB1.Focus();
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Delete":
                UpdateFilter(false);
                if (DF1.IsEnabled)
                {
                    int sel = fmp.GetSelectedItemNo();
                    if (sel == 0)
                    {
                        Speak_Listen.Speak("You haven't selected any item.");
                    }
                    else
                    {
                        modifyListStatus = 3;
                        if (isFolder == 1)
                        {
                            DeleteDirectory(fmp.GetSelectedFolder(sel).Name);
                        }
                        else                                    // isFolder == 2; isFolder == 0 not possible to reach here
                        {
                            DeleteFile(fmp.GetSelectedFile(sel).Name);
                        }
                    }
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }

                break;

            case "Rename":
                UpdateFilter(false);
                if (RNF1.IsEnabled)
                {
                    int sel = fmp.GetSelectedItemNo();
                    if (sel == 0)
                    {
                        Speak_Listen.Speak("You haven't selected any item.");
                    }
                    else
                    {
                        modifyListStatus   = 4;
                        BORDER.BorderBrush = Brushes.Yellow;
                        Speak_Listen.Speak("Type the new name of the item selected");
                        TB1.IsEnabled = true;
                        TB1.Focus();
                    }
                }
                else
                {
                    Speak_Listen.Speak("Sorry, No such control is present");
                }
                break;

            case "Open":
                UpdateFilter(false);
                Open(fmp.GetSelectedItemNo());
                break;

            default:                                         //  Number input
                int n = int.Parse(cmd);
                if (isFilterActive)                          //  Number input for filters
                {
                    if (n >= 1 && n <= 11)                   // In range
                    {
                        UpdateFilter(false);
                        Filter(n);
                    }
                    else                                     // Out of range
                    {
                        Speak_Listen.Speak("Wrong option. Say a number from 1 to 11.");
                    }
                }
                else                                         //  Number input for file/folder selection
                {
                    if (isFolder == 0)
                    {
                        Speak_Listen.Speak("Sorry, this folder is empty");
                    }
                    else
                    {
                        if ((n < firstItemNo) || (n > lastItemNo))          // Item no. selected is not actually present in the list
                        {
                            Speak_Listen.Speak("Wrong option. Say a number from " + firstItemNo.ToString() + " to " + lastItemNo.ToString());
                        }
                        else                                                // In Range
                        {
                            fmp.SelectItem(n);
                        }
                    }
                }
                break;
            }
        }