Пример #1
0
        protected void btnProximoClick(object sender, EventArgs e)
        {
            MenuItem mnuItem = Menu1.FindItem("2");

            mnuItem.Enabled = true;
            Menu1.Items[MultiView1.ActiveViewIndex = 2].Selected = true;
        }
Пример #2
0
        protected void btnSelecionaClick(object sender, EventArgs e)
        {
            try
            {
                MenuItem mnuItem = Menu1.FindItem("3");
                mnuItem.Enabled = true;
                Menu1.Items[MultiView1.ActiveViewIndex = 3].Selected = true;

                Regras.Regras get = new Regras.Regras();
                if (Session["IdCompeticao"] != null)
                {
                    DtoCompeticao dados = get.GetCompeticaoPorId(int.Parse(Session["IdCompeticao"].ToString()));

                    if (dados.PermiteNaoFiliado == false)
                    {
                        if (!string.IsNullOrWhiteSpace(ListAtletasCadastrados.SelectedValue))
                        {
                            TextNumeroRegistro.Text = ListAtletasCadastrados.SelectedValue;
                            BuscaFiliadoPorRegistro(sender, e);
                        }
                    }
                    else
                    {
                        TextIdAtleta.Text = ListAtletasCadastrados.SelectedValue;
                        BuscaFiliadoPorId(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
            }
        }
Пример #3
0
 private void TrataCampos(DtoCompeticao dados)
 {
     if (dados.PermiteNaoFiliado == true)
     {
         TextNumeroRegistro.Enabled    = false;
         TextIdAtleta.Enabled          = false;
         TextNomeFiliado.Enabled       = true;
         TextDtNascimento.Enabled      = true;
         TextIdade.Enabled             = true;
         TextPeso.Enabled              = true;
         TextAltura.Enabled            = true;
         DropDownListGraduacao.Enabled = true;
         Permite.Text = dados.PermiteNaoFiliadoDescricao;
         MenuItem mnuItem = Menu1.FindItem("3");
         mnuItem.Enabled = true;
     }
     else
     {
         TextNumeroRegistro.Enabled    = false;
         TextIdAtleta.Enabled          = false;
         TextNomeFiliado.Enabled       = false;
         TextDtNascimento.Enabled      = false;
         TextIdade.Enabled             = false;
         TextPeso.Enabled              = false;
         TextAltura.Enabled            = false;
         DropDownListGraduacao.Enabled = false;
         Permite.Text = dados.PermiteNaoFiliadoDescricao;
     }
 }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MenuItem membertools = Menu1.FindItem("Member Options");
                Menu1.Items.Remove(membertools);

                if (Session["Name"] != null) //are you logged in?
                {
                    if (Session["Member"] != null)
                    {
                        if ((bool)Session["Member"])
                        {
                            Menu1.Items.Add(membertools);
                        }
                    }
                }
                else if (Session["Member"] == null)
                {
                    Response.Redirect("Home.aspx"); //Prevent people from hard coding to gain access
                }
            }
            if (RadioButtonList1.SelectedIndex == 0)
            {
                TextBox2.Text = "25$";
            }
            else if (RadioButtonList1.SelectedIndex == 1)
            {
                TextBox2.Text = "10$";
            }

            TextBox1.Text = Session["Name"].ToString();
        }
Пример #5
0
        public void GridCompeicoesCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                int n = 0;
                if (int.TryParse(e.CommandArgument.ToString(), out n))
                {
                    int    index        = Convert.ToInt32(e.CommandArgument);
                    string idCompeticao = GridCompeicoes.DataKeys[index]["IdCompeticao"].ToString();

                    if (e.CommandName == "Inscrever")
                    {
                        Session["IdCompeticao"] = idCompeticao;

                        MenuItem mnuItem = Menu1.FindItem("1");
                        mnuItem.Enabled = true;
                        CarregaTela(long.Parse(idCompeticao));
                    }
                }
            }
            catch (Exception ex)
            {
                AlertVisibleTrue();
                AlertError(ex.Message);
                //FailureText.Text = string.Format("Erro ao selecionar competição.{0}", ex.Message);
            }
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MenuItem item  = Menu1.FindItem("Login");
            MenuItem item2 = Menu1.FindItem("Home");
            MenuItem item3 = Menu1.FindItem("Policies");
            MenuItem item4 = Menu1.FindItem("Hospitals");
            MenuItem item5 = Menu1.FindItem("Claim");
            //if (((Label)Master.FindControl("lblErrMsg")).Text == "")
            //{
            //    item.Enabled = true;
            //    item2.Enabled = true;
            //    item3.Enabled = true;
            //    item4.Enabled = true;
            //    item5.Enabled = true;
            //}

            //else
            //{
            //    item.Enabled = false;
            //    item2.Enabled = false;
            //    item3.Enabled = false;
            //    item4.Enabled = false;
            //    item5.Enabled = false;
            //}
        }
Пример #7
0
        public void RemoveButton(string val)
        {
            MenuItem adminBut = Menu1.FindItem(val);

            if (adminBut != null)
            {
                Menu1.Items.Remove(adminBut);
            }
        }
Пример #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Menu1.FindItem(CurrentlySelectedItem).Selected = true;
     if (Page.ToString().ToLower().IndexOf("policy") != -1)
     {
         PanelPolicy.Visible = false;
     }
     else
     {
         PanelPolicy.Visible = true;
     }
 }
Пример #9
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBoxP.Text != "")
        {
            if (TextBoxP.Text == Admin.Password)
            {
                if (TextBoxPN1.Text == TextBoxPN2.Text)
                {
                    CU.ChangePassword(Admin.UserName, TextBoxP.Text, TextBoxPN1.Text, TextBoxPN2.Text);
                    Menu1.Items.Remove(Menu1.FindItem("Play Game"));
                    if (Admin.IsAdmin)
                    {
                        Menu1.Items.Remove(Menu1.FindItem("User Administration"));
                        Menu1.Items.Remove(Menu1.FindItem("Game Administration"));
                    }
                    LabelStatus.Text = "Password Changed";
                }
                else
                {
                    LabelStatus.Text = "Passwords do not match";
                }
            }
            else
            {
                LabelStatus.Text = "Current Password Incorrect";
            }
        }

        if (TextBoxEmail.Text != Admin.Email)
        {
            var ET = new EmailAddressAttribute();
            if (ET.IsValid(TextBoxEmail.Text))
            {
                CU.ChangeEMail(Admin.UserName, TextBoxEmail.Text);
                LabelStatus.Text = "Email Changed";
            }
            else
            {
                LabelStatus.Text = "Email format not Valid";
            }
        }
        if (Convert.ToInt32(DropDownList3.SelectedValue) > 0)
        {
            CU.AddMoney(Admin.UserName, Convert.ToInt32(DropDownList3.SelectedValue));
            LabelStatus.Text = "Money Added";
        }
    }
Пример #10
0
    private void getMenu()
    {
        Connect();
        con.Open();
        DataSet        ds  = new DataSet();
        DataTable      dt  = new DataTable();
        string         sql = "Select distinct MenuID,MenuNameAr,MenuNameEn,Action,ParentID from View_Menus where  UserRoleId='" + Session["UserRoleId1"].ToString() + "' and MenuStatusId ='1' order by MenuId";
        SqlDataAdapter da  = new SqlDataAdapter(sql, con);

        da.Fill(ds);
        dt = ds.Tables[0];
        DataRow[] drowpar = dt.Select("ParentID=" + 0);
        if (Session["dir"].ToString() == "ltr")
        {
            foreach (DataRow dr in drowpar)
            {
                Menu1.Items.Add(new MenuItem(dr["MenuNameEn"].ToString(), dr["MenuID"].ToString(),
                                             "", dr["Action"].ToString()));
            }

            foreach (DataRow dr in dt.Select("ParentID >" + 0))
            {
                MenuItem mnu = new MenuItem(dr["MenuNameEn"].ToString(), dr["MenuID"].ToString(),
                                            "", dr["Action"].ToString());
                Menu1.FindItem(dr["ParentID"].ToString()).ChildItems.Add(mnu);
                //MenuID,MenuNameAr,MenuNameEn,Action
            }
        }
        else
        {
            foreach (DataRow dr in drowpar)
            {
                Menu1.Items.Add(new MenuItem(dr["MenuNameAr"].ToString(), dr["MenuID"].ToString(),
                                             "", dr["Action"].ToString()));
            }

            foreach (DataRow dr in dt.Select("ParentID >" + 0))
            {
                MenuItem mnu = new MenuItem(dr["MenuNameAr"].ToString(), dr["MenuID"].ToString(),
                                            "", dr["Action"].ToString());
                Menu1.FindItem(dr["ParentID"].ToString()).ChildItems.Add(mnu);
            }
        }

        con.Close();
    }
Пример #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Session["USUARIO"] == null)
         {
             Menu1.Visible = false;
         }
         if (Session["USUARIO"] != null)
         {
             Menu1.Items.Remove(Menu1.FindItem("Inicio de Sesion"));
             MenuItem CERRAR = new MenuItem("Cerrar Sesion", "", "", "~/Login.aspx");
             Menu1.Items.Add(CERRAR);
             //                    Tipos de usuarios
             //        0                      1                  2                      3
             //   Administrador      GestorDeInformacion        Jefe                 Auxiliar
             string Nivel = Session["NIVEL"].ToString();
             if (Nivel == "1")
             {
                 Menu1.Items.Remove(Menu1.FindItem("Configuraciones"));
             }
             else
             {
                 if (Nivel == "2")
                 {
                     Menu1.Items.Remove(Menu1.FindItem("Configuraciones"));
                     Menu1.Items.Remove(Menu1.FindItem("Carga de Archivos"));
                 }
                 else
                 {
                     if (Nivel == "3")
                     {
                         Menu1.Items.Remove(Menu1.FindItem("Graficador"));
                         Menu1.Items.Remove(Menu1.FindItem("Reporteador"));
                         Menu1.Items.Remove(Menu1.FindItem("Configuraciones"));
                         Menu1.Items.Remove(Menu1.FindItem("Carga de Archivos"));
                     }
                 }
             }
         }
     }
 }
Пример #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["korisnik"].ToString() == "")
     {
         Response.Redirect("Login.aspx");
     }
     else
     {
         Response.Write(Session["ime"]);
         if (!Session["tip"].Equals("A"))
         {
             MenuItem stavka   = Menu1.FindItem("Stampa/Korisnik_P");
             MenuItem roditelj = Menu1.FindItem("Stampa");
             if (stavka != null)
             {
                 roditelj.ChildItems.Remove(stavka);
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Date.Text   = DateTime.Now.ToString("MM-dd-yyyy");
            Label2.Text = Session["Name"].ToString();
            if (!IsPostBack)
            {
                if (Session["Admin"] == null)
                {
                    if (Session["Employee"] == null)
                    {
                        Response.Redirect("Home.aspx"); //Prevent people from hard coding to gain access
                    }
                }

                MenuItem adminTools = Menu1.FindItem("Admin Tools");
                Menu1.Items.Remove(adminTools);
                MenuItem employeetools = Menu1.FindItem("Employee Tools");
                Menu1.Items.Remove(employeetools);


                if (Session["Name"] != null)                //are you logged in?
                {
                    if (Session["Admin"] != null)           //did I mess up coding somewhere? It's possible.
                    {
                        if ((bool)Session["Admin"])         //are you a manager?
                        {
                            Menu1.Items.Add(adminTools);    //show admin tools
                            Menu1.Items.Add(employeetools); // display the employee tools
                        }
                    }
                    else if (Session["Employee"] != null)
                    {
                        if ((bool)Session["Employee"])      //same as above
                        {
                            Menu1.Items.Add(employeetools); //display employee tools
                        }
                    }
                }
            }
        }
Пример #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        StackTrace stackTrace = new StackTrace();
        string     eventName  = stackTrace.GetFrame(1).GetMethod().Name;

        Admin.settingInfo();

        LabelCurrentUser.Text = Admin.UserName;

        if (!IsPostBack)
        {
            Hit.Enabled        = false;
            Hit.Visible        = false;
            Stand.Visible      = false;
            Stand.Enabled      = false;
            Play_Again.Visible = false;
            Play_Again.Enabled = false;
            Admin.userInfo(Admin.userID(Admin.IsLoggedIn()));
            Label12.Text = Admin.Cash.ToString();
            Label13.Text = Admin.Wins.ToString();
            Label14.Text = Admin.Losses.ToString();
            Label15.Text = Admin.Draws.ToString();
            Label17.Text = Admin.Blackjack.ToString();

            if (!Admin.IsAdmin)
            {
                Menu1.Items.Remove(Menu1.FindItem("User Administration"));
                Menu1.Items.Remove(Menu1.FindItem("Game Administration"));
            }
        }
        else if (eventName == "Play_Again_Click")
        {
            Admin.userInfo(Admin.userID(Admin.IsLoggedIn()));
            Label12.Text = Admin.Cash.ToString();
            Label13.Text = Admin.Wins.ToString();
            Label14.Text = Admin.Losses.ToString();
            Label15.Text = Admin.Draws.ToString();
            Label17.Text = Admin.Blackjack.ToString();
        }
    }
Пример #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Admin.userInfo(Admin.userID(Admin.IsLoggedIn()));
        LabelCurrentUser.Text = Admin.UserName;
        LabelStatus.Text      = "";
        Button1.Enabled       = true;
        Table2.Visible        = true;
        Label12.Text          = Admin.Cash.ToString();
        Label5.Text           = Admin.UserName;
        Label12.Text          = Admin.Cash.ToString();
        Label13.Text          = Admin.Wins.ToString();
        Label14.Text          = Admin.Losses.ToString();
        Label15.Text          = Admin.Draws.ToString();
        Label17.Text          = Admin.Blackjack.ToString();


        if (!IsPostBack)
        {
            TextBoxEmail.Text = Admin.Email;
            // Increase
            ListItem[] itemsIncrease = new ListItem[5];
            itemsIncrease[0] = new ListItem("$0.00", "0");
            itemsIncrease[1] = new ListItem("$5.00", "5");
            itemsIncrease[2] = new ListItem("$10.00", "10");
            itemsIncrease[3] = new ListItem("$15.00", "15");
            itemsIncrease[4] = new ListItem("$20.00", "20");
            DropDownList3.Items.AddRange(itemsIncrease);
            DropDownList3.DataBind();

            if (!Admin.IsAdmin)
            {
                Menu1.Items.Remove(Menu1.FindItem("User Administration"));
                Menu1.Items.Remove(Menu1.FindItem("Game Administration"));
            }
        }
    }
Пример #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LabelCurrentUser.Text = Admin.IsLoggedIn();
        if (!Admin.IsAdmin)
        {
            Menu1.Items.Remove(Menu1.FindItem("User Administration"));
        }

        if (!IsPostBack)
        {
            Admin.settingInfo();
            // Max
            ListItem[] itemsMax = new ListItem[3];
            itemsMax[0] = new ListItem("100", "100");
            itemsMax[1] = new ListItem("50", "50");
            itemsMax[2] = new ListItem("25", "25");
            DropDownList1.Items.AddRange(itemsMax);
            DropDownList1.DataBind();
            DropDownList1.SelectedValue = Admin.MaxBet.ToString();
            // Min
            ListItem[] itemsMin = new ListItem[3];
            itemsMin[0] = new ListItem("15", "15");
            itemsMin[1] = new ListItem("10", "10");
            itemsMin[2] = new ListItem("5", "5");
            DropDownList2.Items.AddRange(itemsMin);
            DropDownList2.DataBind();
            DropDownList2.SelectedValue = Admin.MinBet.ToString();
            // Increase
            ListItem[] itemsIncrease = new ListItem[2];
            itemsIncrease[0] = new ListItem("10", "10");
            itemsIncrease[1] = new ListItem("5", "5");
            DropDownList3.Items.AddRange(itemsIncrease);
            DropDownList3.DataBind();
            DropDownList3.SelectedValue = Admin.IncreaseBet.ToString();
        }
    }
Пример #17
0
        private void DisplaySearchResults()
        {
            try
            {
                DisplayWarningMessages();
                string selectedGroup = HiddenFieldSelectedGroup.Value;
                if (!string.IsNullOrEmpty(selectedGroup))
                {
                    string searchText = TextBoxSearch.Text;

                    if (!string.IsNullOrEmpty(searchText))
                    {
                        MenuItem item = Menu1.FindItem(searchText.Substring(0, 1).ToUpper());
                        if (item != null)
                        {
                            item.Selected = true;
                        }
                    }
                    if (searchText == "*")
                    {
                        searchText         = "_";
                        TextBoxSearch.Text = "*";
                    }

                    if (!string.IsNullOrEmpty(searchText))
                    {
                        //searchText = searchText.Replace("*", "");
                        searchText += "%";
                    }

                    TableSearchResults.Rows.Clear();

                    TableHeaderRow trHRow = new TableHeaderRow();
                    trHRow.CssClass = "Table_HeaderBG";

                    TableHeaderCell THMFP = new TableHeaderCell();
                    THMFP.CssClass        = "H_title";
                    THMFP.Width           = 20;
                    THMFP.HorizontalAlign = HorizontalAlign.Left;
                    THMFP.Text            = "<input type='checkbox' onclick='ChkandUnchkMFPList()' id='chkALLMFPList' />";

                    TableHeaderCell THSNo = new TableHeaderCell();
                    THSNo.HorizontalAlign = HorizontalAlign.Left;
                    THSNo.Wrap            = false;
                    THSNo.Text            = string.Empty;
                    THSNo.Width           = 40;
                    THSNo.CssClass        = "H_title";

                    TableHeaderCell THHostName = new TableHeaderCell();
                    THHostName.HorizontalAlign = HorizontalAlign.Left;
                    THHostName.Wrap            = false;
                    THHostName.Text            = localizedResources["L_HOST_NAME"].ToString();
                    //TableHeaderCellHostName.Text = TableHeaderCell2.Text = localizedResources["L_HOST_NAME"].ToString();
                    THHostName.CssClass = "H_title";

                    TableHeaderCell THIpAddress = new TableHeaderCell();
                    THIpAddress.HorizontalAlign = HorizontalAlign.Left;
                    THIpAddress.Wrap            = false;
                    THIpAddress.Text            = localizedResources["L_IP_ADDRESS"].ToString();
                    //TableHeaderCellIPAddress.Text = localizedResources["L_IP_ADDRESS"].ToString();
                    THIpAddress.CssClass = "H_title";

                    trHRow.Cells.Add(THMFP);
                    trHRow.Cells.Add(THSNo);
                    trHRow.Cells.Add(THHostName);
                    trHRow.Cells.Add(THIpAddress);
                    TableSearchResults.Rows.Add(trHRow);

                    DataSet dsGroupDevices = DataManager.Provider.Device.ProvideGroupDevices(selectedGroup, 0, searchText);

                    for (int mfpIndexGroup = 0; mfpIndexGroup < dsGroupDevices.Tables[0].Rows.Count; mfpIndexGroup++)
                    {
                        TableRow trMfp = new TableRow();
                        AppController.StyleTheme.SetGridRowStyle(trMfp);
                        //trMfp.ID = dsGroupDevices.Tables[0].Rows[mfpIndex]["MFP_ID"].ToString();

                        TableCell tdCheckBox = new TableCell();
                        tdCheckBox.HorizontalAlign = HorizontalAlign.Left;
                        tdCheckBox.Width           = 30;
                        tdCheckBox.Text            = "<input type='checkbox' name='__SearchMfpIP' id='__SearchMfpIP" + (mfpIndexGroup + 1).ToString() + "' value='" + dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["MFP_IP"].ToString() + "' onclick='javascript:ValidateSelectedCountList()' />";

                        TableCell tdSlNo = new TableCell();
                        tdSlNo.HorizontalAlign = HorizontalAlign.Left;
                        tdSlNo.Text            = Convert.ToString(mfpIndexGroup + 1, CultureInfo.CurrentCulture);
                        tdSlNo.Width           = 30;

                        TableCell tdMfpIP = new TableCell();
                        tdMfpIP.CssClass = "GridLeftAlign";
                        tdMfpIP.Text     = "<a href=http://" + dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["MFP_IP"].ToString() + " target='_blank' title='" + dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["MFP_IP"].ToString() + "'>" + dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["MFP_IP"].ToString() + "</a>";
                        tdMfpIP.Attributes.Add("onclick", "togallIP(" + mfpIndexGroup + ")");
                        TableCell tdMfpModel = new TableCell();
                        tdMfpModel.CssClass = "GridLeftAlign";
                        tdMfpModel.Text     = dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["MFP_MODEL"].ToString();
                        tdMfpModel.Attributes.Add("onclick", "togallIP(" + mfpIndexGroup + ")");
                        TableCell tdMfpHostName = new TableCell();
                        tdMfpHostName.CssClass = "GridLeftAlign";
                        tdMfpHostName.Text     = dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["MFP_HOST_NAME"].ToString();
                        tdMfpHostName.Attributes.Add("onclick", "togallIP(" + mfpIndexGroup + ")");
                        TableCell tdMfpLocation = new TableCell();
                        tdMfpLocation.CssClass = "GridLeftAlign";
                        tdMfpLocation.Text     = dsGroupDevices.Tables[0].Rows[mfpIndexGroup]["Mfp_LOCATION"].ToString();
                        tdMfpLocation.Attributes.Add("onclick", "togallIP(" + mfpIndexGroup + ")");

                        trMfp.Cells.Add(tdCheckBox);
                        trMfp.Cells.Add(tdSlNo);
                        trMfp.Cells.Add(tdMfpHostName);
                        trMfp.Cells.Add(tdMfpIP);

                        //trMfp.Cells.Add(tdMfpModel);
                        //trMfp.Cells.Add(tdMfpLocation);

                        TableSearchResults.Rows.Add(trMfp);
                        HiddenFieldMFPListCount.Value = (mfpIndexGroup + 1).ToString();
                    }
                }
            }
            catch
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MenuItem membertools = Menu1.FindItem("Member Options");
                Menu1.Items.Remove(membertools);


                if (Session["Name"] != null) //are you logged in?
                {
                    if (Session["Member"] != null)
                    {
                        if ((bool)Session["Member"])
                        {
                            Menu1.Items.Add(membertools);
                        }
                    }
                }
                else if (Session["Member"] == null)
                {
                    Response.Redirect("Home.aspx"); //Prevent people from hard coding to gain access
                }
                Label1.Text   = Session["Name"].ToString();
                TextBox1.Text = Session["Name"].ToString();

                using (SqlConnection connection = new SqlConnection(@"Data Source=sql5047.site4now.net;Persist Security Info=True;User ID=DB_A5A727_connect4admin_admin;Password=bl1tzcr4nk;"))
                {
                    SqlCommand theCommand = new SqlCommand("Select FIRST_NAME , LAST_NAME, GRADUATION_DATE, MEMBER_DOB, MAILING_ADDRESS, CITY, STATE, ZIP_CODE, EMAIL, PHONE, EMERGENCY_CONTACT_NAME, EMERGENCY_CONTACT_PHONE, PLACE_OF_EMPLOYMENT, EMPLOYMENT_PHONE, GENDER, MEMBER_PASSWORD, MEMBERSHIP_TYPE, MEMBERSHIP_LENGTH FROM  MEMBER WHERE SRC_ID = @SRCID", connection);
                    connection.Open();
                    theCommand.Parameters.AddWithValue("@SRCID", Label1.Text);
                    theCommand.CommandType = CommandType.Text;


                    SqlDataReader theReader = theCommand.ExecuteReader();

                    if (theReader.Read())
                    {
                        this.FNameText.Text    = theReader.GetString(0);
                        this.LNameText.Text    = theReader.GetString(1);
                        this.GradText.Text     = theReader.GetString(2);
                        this.DOBText.Text      = theReader.GetString(3);
                        this.AddressText.Text  = theReader.GetString(4);
                        this.CityText.Text     = theReader.GetString(5);
                        this.StateText.Text    = theReader.GetString(6);
                        this.ZipText.Text      = theReader.GetString(7);
                        this.EmailText.Text    = theReader.GetString(8);
                        this.PhoneText.Text    = theReader.GetString(9);
                        this.EContact.Text     = theReader.GetString(10);
                        this.EPhone.Text       = theReader.GetString(11);
                        this.EmpText.Text      = theReader.GetString(12);
                        this.EmpPhoneText.Text = theReader.GetString(13);
                        this.GenderText.Text   = theReader.GetString(14);
                        this.PassText.Text     = theReader.GetString(15);
                        this.MemberType.Text   = theReader.GetString(16);
                        this.MemLength.Text    = theReader.GetByte(17).ToString();
                    }
                    theReader.Close();


                    SqlCommand theCommand2 = new SqlCommand("Select LOCKER_NUM, LOCKER_TYPE, RENTAL_SEMESTER, EXPIRATION_DATE FROM LOCKER WHERE SRC_ID = @SRCID", connection);
                    theCommand2.Parameters.AddWithValue("@SRCID", Label1.Text);
                    theCommand2.CommandType = CommandType.Text;
                    SqlDataReader theReader2 = theCommand2.ExecuteReader();

                    if (theReader2.Read())
                    {
                        this.LockNum.Text        = theReader2.GetString(0);
                        this.LockerType.Text     = theReader2.GetString(1);
                        this.RentalSemester.Text = theReader2.GetString(2);
                        this.ExpirationLock.Text = theReader2.GetString(3);
                    }
                    connection.Close();
                }
            }
        }
Пример #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["roleFullAccess"] != null || Session["roleTransactions"] != null || Session["roleReports"] != null || Session["roleSelectedAccess"] != null)
                {
                    Message.Text = "WELCOME:- " + Session["username"].ToString();

                    if (Session["roleReports"].ToString() == "YES")
                    {
                        if (Menu1.Items.Count > 0)
                        {
                            if (Session["roleTransactions"].ToString() == "NO")
                            {
                                Menu1.Items.Remove(Menu1.FindItem("TRANSACTION"));
                            }
                        }
                    }
                    if (Session["roleSelectedAccess"].ToString() == "YES")
                    {
                        //Menu1.Items.Remove(Menu1.FindItem("Masters"));

                        if (Menu1.Items.Count > 0)
                        {
                            if (Session["roleReports"].ToString().Trim() == "NO")
                            {
                                Menu1.Items.Remove(Menu1.FindItem("REPORTS"));
                            }

                            if (Session["roleAccess"].ToString().Trim() == "ASSEMBLY")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayAssemble.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "PRODUCT CATEGORY")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayFamily.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "UOM")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayUnitOfMeasurement.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "RAW MATERIAL")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayRawMaterial.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "MASTERBATCH")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayMasterBatch.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "POST OPERATION")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayPostOperation.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "PACKAGING")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayPackaging.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "REJECTION")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayRejection.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "SHIFT")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayShift.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "MACHINE")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayMachine.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "DOWN TIME CODE")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayDownTimeCode.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "CUSTOMER")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayCustomer.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "WORKER")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayWorker.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "VENDOR")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayVendor.aspx";
                            }
                            if (Session["roleAccess"].ToString().Trim() == "PARTS")
                            {
                                MenuItem temp = new MenuItem(Session["roleAccess"].ToString());
                                Menu1.FindItem("MASTERS").ChildItems.Clear();
                                Menu1.FindItem("MASTERS").ChildItems.Add(temp);
                                temp.NavigateUrl = "/displayParts.aspx";
                            }
                        }
                    }
                    if (Session["roleTransactions"].ToString() == "YES")
                    {
                        Menu1.Items.Remove(Menu1.FindItem("MASTERS"));

                        if (Menu1.Items.Count > 0)
                        {
                            if (Session["roleReports"].ToString().Trim() == "NO")
                            {
                                Menu1.Items.Remove(Menu1.FindItem("REPORTS"));
                            }
                            Menu1.Items.Add(new MenuItem()
                            {
                                Text        = "VIEW PARTS",
                                NavigateUrl = "~/displayPartsWorker.aspx"
                            });
                        }
                    }
                }
                else
                {
                    Response.Redirect("~/Login.aspx");
                }
            }
        }