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();
            }
        }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 private void Awake()
 {
     instance    = this;
     playerInput = new PlayerInput();
     playerInput.TestButtons.T.performed += ctx => TB1?.Invoke();
     playerInput.TestButtons.Y.performed += ctx => TB2?.Invoke();
     playerInput.TestButtons.U.performed += ctx => TB3?.Invoke();
 }
Ejemplo n.º 4
0
 private void clearButton_Click(object sender, RoutedEventArgs e)
 {
     TB1.Clear();
     TB2.Clear();
     TB3.Clear();
     TB4.Clear();
     TB5.Clear();
     TB6.Clear();
 }
        private void AddItemClicked(object sender, RoutedEventArgs e)
        {
            if (TB1.Text != "")
            {
                string text = TB1.Text;

                if (int.TryParse(text.Substring(text.Length - 1), out int res))
                {
                    collection.Add(new RankedString(1, TB1.Text));
                    TB1.Clear();
                }
            }
        }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (button1.Text != "закрыть")
                {
                    //string ip_str = textBox1.Text + "." + textBox2.Text + "." + textBox3.Text + "." + textBox4.Text;
                    string ip_str = maskedTextBox1.Text.ToString().Replace(" ", "");
                    //ipAddress = IPAddress.Parse("193.1.1.8");
                    ipAddress = IPAddress.Parse(ip_str);
                    ep        = new IPEndPoint(ipAddress, 6600);

                    s.e = ep;
                    s.u = u;

                    out_frame = new string[100];

                    out_frame[0] = ("Message sent to " + ipAddress + ":6600 ");

                    u.Connect(ipAddress, 6600);

                    button1.Text           = "закрыть";
                    maskedTextBox1.Enabled = false;
                    groupBox1.Enabled      = true;
                    TB1.Enabled            = true;

                    timer1.Start();
                }
                else
                {
                    Close();
                }
            }
            catch (Exception ex)
            {
                TB1.Clear();
                TB1.AppendText(ex.Message);
            }
        }
Ejemplo n.º 7
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;
            }
        }
Ejemplo n.º 8
0
 private void LimpiarTextBoxes()
 {
     TB1.Clear();
     TB2.Clear();
 }
Ejemplo n.º 9
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            int    n_sb     = 0;//, temp = 0;
            string send_str = "";

            try
            {
                foreach (CheckBox checkBox in groupBox1.Controls.OfType <CheckBox>())
                {
                    if (checkBox.Checked)
                    {
                        n_sb |= (int)1 << (Int32.Parse(checkBox.Text) - 1);
                    }
                }
                sendBytes[2] = (byte)((n_sb >> 8) & 0xFF);
                sendBytes[3] = (byte)((n_sb) & 0xFF);

                foreach (byte sb in sendBytes)
                {
                    send_str += Convert.ToString(sb, 16) + ' ';
                }

                out_frame[1] = (send_str);

                /*
                 *      uint16_t	Type;           //ист=1 ТС=1
                 *      uint16_t	DG_Cmd;         //биты Команды ДГ
                 *      uint16_t	DG_res1;        //
                 *      uint16_t	GOM_Cmd;        //
                 *      uint16_t	SET_GOM_cmd;    //
                 *      uint16_t	Indikator;      //
                 *      uint16_t	UL;             //
                 *      uint16_t	U_dg;			//
                 *      uint16_t	U_gom;			//
                 *      uint16_t	U_c;			//
                 *      uint16_t	I_L;			//
                 *      uint16_t	TOG;			//
                 *      uint16_t	DM;				//
                 *      uint16_t	Ris_DG;			//
                 *      uint16_t	Ris_GOM;        //
                 *      uint16_t	U_ab;			//
                 *      uint16_t	I_ab;			//
                 */
                out_frame[2]  = "Тип:         " + read_str[0];
                out_frame[3]  = "DG_Cmd:      " + read_str[1];
                out_frame[4]  = "DG_res1:     " + read_str[2];
                out_frame[5]  = "GOM_Cmd:     " + read_str[3];
                out_frame[6]  = "SET_GOM_cmd: " + read_str[4];
                out_frame[7]  = "Indikator:   " + read_str[5];
                out_frame[8]  = "UL:          " + read_str[6];
                out_frame[9]  = "U_dg:        " + read_str[7];
                out_frame[10] = "U_gom:       " + read_str[8];
                out_frame[11] = "U_c:         " + read_str[9];
                out_frame[12] = "I_L:         " + read_str[10];
                out_frame[13] = "TOG:         " + read_str[11];
                out_frame[14] = "DM:          " + read_str[12];
                out_frame[15] = "Ris_DG:      " + read_str[13];
                out_frame[16] = "Ris_GOM:     " + read_str[14];
                out_frame[17] = "U_ab:        " + read_str[15];
                out_frame[18] = "I_ab:        " + read_str[16];
                out_frame[19] = "Fline:       " + read_str[17];
                out_frame[20] = "R1:          " + read_str[18];
                out_frame[21] = "R2:          " + read_str[19];
                out_frame[22] = "";
                out_frame[23] = "";
                //out_frame[21] = "Err_DG:       " + read_str[19];
                //out_frame[22] = "Err_GOM:      " + read_str[20];
                //out_frame[23] = "Err_SET:      " + read_str[21];
                //out_frame[24] = "Btn_Ctrl:     " + read_str[22];


                if (cnt > 99)
                {
                    cnt      = 0;
                    cnt_read = 0;
                }

                dt = (cnt - (cnt_read));

                if (messageReceived)
                {
                    messageReceived = false;
                    cnt1            = 0;

                    ++cnt_read;
                    ++cnt;
                    //u.Send(sendBytes, sendBytes.Length);
                    //u.BeginReceive(callBack, s);
                }
                else
                {
                    ++cnt1;
                    if (cnt1 > 4)
                    {
                        cnt1 = 0;
                        ++cnt;
                        //u.Send(sendBytes, sendBytes.Length);
                        //u.BeginReceive(callBack, s);
                    }
                }
                out_frame[23] = ("Отправлено " + cnt + ", потеряно " + dt + " раз.");
                TB1.Text      = "";
                foreach (string n in out_frame)
                {
                    TB1.Text += "\n\r" + n + "\n\r";
                }


                u.Send(sendBytes, sendBytes.Length);

                //u.BeginReceive(new AsyncCallback(ReceiveCallback), s);
                u.BeginReceive(callBack, s);
            }
            catch (Exception ex)
            {
                TB1.Clear();
                TB1.AppendText(ex.Message);
                timer1.Stop();
            }
            //Application.DoEvents();
        }