Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var Id   = Request.QueryString["S"];
            var res  = _switchInfo.GetInfo(Id);
            var Type = _tools.Capitalize(_tools.Decrypt(res[0].Type));

            txtType.Text    = Type;
            txtCurrent.Text = _tools.Decrypt(res[0].Current);
            txtCaliber.Text = _tools.Decrypt(res[0].Caliber);
            txtCaliber.Text = _tools.Decrypt(res[0].Caliber);

            var Switches = _tools.Decrypt(res[0].Switches);

            if (Type == "Monofasico")
            {
                txtS1.Visible = false;
                txtS2.Text    = _tools.Decrypt(res[0].Switches);
                txtS3.Visible = false;
            }
            else if (Type == "Bifasico")
            {
                txtS1.Text    = _tools.Decrypt(res[0].Switches).Substring(0, 2);
                txtS2.Text    = _tools.Decrypt(res[0].Switches).Substring(3, 2);
                txtS3.Visible = false;
            }
            else if (Type == "Trifasico")
            {
                txtS1.Text = _tools.Decrypt(res[0].Switches).Substring(0, 2);
                txtS2.Text = _tools.Decrypt(res[0].Switches).Substring(3, 2);
                txtS3.Text = _tools.Decrypt(res[0].Switches).Substring(6, 2);
            }

            txtComments.Value = _tools.Capitalize(_tools.Decrypt(res[0].Comments));
        }
        protected void ShowPanelsInfo()
        {
            var res = _panels.GetPanelsInfo();

            for (int i = 0; i < _panels.CountPanels(); i++)
            {
                var table = string.Format("<tr> <td>{0}</td> <td>{1}</td> <td>{2}</td> <td>{3} / 42</td> <td></td> </tr>", _tools.Decrypt(res[i].IdPanel).ToUpper(), _tools.Capitalize(_tools.Decrypt(res[i].Area)), _tools.Capitalize(_tools.Decrypt(res[i].Description)), _tools.Decrypt(res[i].SpacesAvailable));
                Response.Write(table);
            }
        }
        protected void UsersInfo()
        {
            var res = _users.GetUsersInfo();

            for (int i = 0; i < _users.GetTotalMembers(); i++)
            {
                Response.Write("<tr>" +
                               "<td>" + _tools.Decrypt(res[i].UserName) + "</td>" +
                               "<td>" + _tools.Capitalize(_tools.Decrypt(res[i].FirstName) + " " + _tools.Decrypt(res[i].LastName)) + "</td>" +
                               "<td>" + _tools.Capitalize(_users.GetUserRole(res[i].IdRole)) + "</td>" +
                               "<td>" + _tools.Decrypt(res[i].Telephone) + "</td>" +
                               "<td>" + _tools.Decrypt(res[i].Email).ToLower() + "</td>" +
                               "<td></td>" +
                               "</tr>");
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _UserName = Context.User.Identity.Name;

            var res          = _users.GetUserInfo(_UserName);
            var RandomPhrase = _phrases.GetRandomPhrase();

            photo             = _tools.Decrypt(res[0].Photo);
            lb_user.Text      = _tools.Capitalize(_tools.Decrypt(res[0].FirstName) + " " + _tools.Decrypt(res[0].LastName));
            lb_email.Text     = _tools.Decrypt(res[0].Email).ToLower();
            lb_phrase.Text    = RandomPhrase;
            lb_username.Text  = _tools.Decrypt(res[0].UserName);
            lb_telephone.Text = _tools.Decrypt(res[0].Telephone);
            lb_role.Text      = _tools.Capitalize(_users.GetUserRole(res[0].IdRole));

            E_Role.Text   = lb_role.Text;
            E_IdCard.Text = _tools.Decrypt(res[0].IdCard);
        }
Esempio n. 5
0
        // GetUserStatus()
        public string GetUserStatus(string UserName)
        {
            Users[]         res_Users         = { };
            AccountStatus[] res_AccountStatus = { };

            try
            {
                var SQLQuery = string.Format("SELECT IdStatus FROM Users WHERE UserName = \"{0}\"", UserName);
                res_Users = con.GetContext().ExecQuery <Users>(SQLQuery).ToArray();

                SQLQuery          = string.Format("SELECT Status FROM AccountStatus WHERE IdStatus = {0}", res_Users[0].IdStatus);
                res_AccountStatus = con.GetContext().ExecQuery <AccountStatus>(SQLQuery).ToArray();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("\nError \nUbicación: Capa DAL -> MUsers -> GetUserStatus(). \nDescripción: " + ex.Message);
            }
            return(_tools.Capitalize(_tools.Decrypt(res_AccountStatus[0].Status)));
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IdPanel = Request.QueryString["C"];

            var res = _panels.GetPanelInfo(IdPanel);

            lb_IdPanel.Text         = string.Format("Código del panel: {0}", _tools.Capitalize(_tools.Decrypt(res[0].IdPanel)));
            lb_Description.Text     = string.Format("Descripción: {0}", _tools.Capitalize(_tools.Decrypt(res[0].Description)));
            lb_SpacesAvailable.Text = string.Format("Espacios Disponibles: {0}", _tools.Decrypt(res[0].SpacesAvailable));
            txtComments_.InnerText  = _tools.Capitalize(_tools.Decrypt(res[0].Comments));

            I_txtIdPanel.Text     = _tools.Decrypt(res[0].IdPanel);
            I_txtModel.Text       = _tools.Capitalize(_tools.Decrypt(res[0].Model));
            I_txtBus.Text         = _tools.Decrypt(res[0].Bus);
            I_txtMain.Text        = _tools.Decrypt(res[0].Main);
            I_txtDescription.Text = _tools.Capitalize(_tools.Decrypt(res[0].Description));
            I_txtArea.Text        = _tools.Capitalize(_tools.Decrypt(res[0].Area));
            I_txtFrom.Text        = _tools.Capitalize(_tools.Decrypt(res[0].From));
            I_txtVoltage.Text     = _tools.Capitalize(_tools.Decrypt(res[0].Voltage));
            I_txtPhases.Text      = _tools.Capitalize(_tools.Decrypt(res[0].Phases));
            I_txtThreads.Text     = _tools.Capitalize(_tools.Decrypt(res[0].Threads));
            I_txtFrequency.Text   = _tools.Capitalize(_tools.Decrypt(res[0].Frequency));
            I_txtComments.Value   = _tools.Capitalize(_tools.Decrypt(res[0].Comments));
        }