Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BusinessLogic.Customer CurrentCustomer = BusinessLogic.Customer.GetCurrentCustomer();
     if (CurrentCustomer != null && CurrentCustomer.CurrentType.Id == 1)
     {
         if (!IsPostBack)
         {
             DropDownListType.DataSource = BusinessLogic.CustomerType.GetList();
             DropDownListType.DataBind();
             DropDownListType.Items.Insert(0, new ListItem("", "0"));
             if (Request.QueryString["id"] != null)
             {
                 int  IdResult;
                 bool IdToIntResult = int.TryParse(Request.QueryString["id"], out IdResult);
                 if (IdToIntResult)
                 {
                     BusinessLogic.Customer EditedCustomer = BusinessLogic.Customer.GetByID(IdResult);
                     TextBoxLogin.Text              = EditedCustomer.Login;
                     TextBoxPassword.Text           = EditedCustomer.Password;
                     DropDownListType.SelectedValue = EditedCustomer.CurrentType.Id.ToString();
                 }
             }
         }
     }
     else
     {
         Server.Transfer("Default.aspx");
     }
 }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User us = (User)Session["user"];

            if (Session["user"] != null)
            {
                if (us.RoleID == 1)
                {
                    if (!IsPostBack)
                    {
                        DropDownListType.DataSource = InsertProductController.getAllProductType().Select(p => p.Name).ToList();
                        DropDownListType.DataBind();
                    }

                    GridViewInsertProduct.DataSource = ViewProductController.getAllProduct();
                    GridViewInsertProduct.DataBind();
                }
                else
                {
                    Response.Redirect("Home.aspx");
                }
            }
            else
            {
                Response.Redirect("Home.aspx");
            }
        }
        private void InitTestType()
        {
            DataSet ds = CodeInfoManage.GetInfoByClassID(CodeInfoManage._TEST_TYPE);

            DropDownListType.DataSource     = ds;
            DropDownListType.DataTextField  = "NAME";
            DropDownListType.DataValueField = "CODE";
            DropDownListType.DataBind();
        }
        private void InitType(string type)
        {
            DataSet ds = GeneralInstrumentManage.GetInstrument();

            DropDownListType.DataSource     = ds;
            DropDownListType.DataTextField  = "NAME";
            DropDownListType.DataValueField = "TYPE";
            DropDownListType.DataBind();

            if (!string.IsNullOrEmpty(type))
            {
                DropDownListType.SelectedValue = type;
            }
        }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         List <BusinessLogic.CustomerType> Types = BusinessLogic.CustomerType.GetList();
         //for (int i = 0; i < Types.Count; ++i)
         //{
         //    DropDownListType.Items.Add(new ListItem(Types[i].Name, Types[i].Id.ToString()));
         //}
         //DropDownListType.Items.Insert(0, new ListItem("", "0"));
         DropDownListType.DataTextField  = "Name";
         DropDownListType.DataValueField = "Id";
         DropDownListType.DataSource     = Types;
         DropDownListType.DataBind();
         DropDownListType.Items.Insert(0, new ListItem("", "0"));
     }
 }
Beispiel #6
0
        //function to load all types into dropdown list - dropdownlistTypes
        private void LoadTypes()
        {
            DataTable tab = new DataTable();
            BLL       obj = new BLL();

            tab = obj.GetTypes();

            if (tab.Rows.Count > 0)
            {
                DropDownListType.Items.Clear();
                DropDownListType.DataSource     = tab;
                DropDownListType.DataTextField  = "QuestionType";
                DropDownListType.DataValueField = "TypeId";

                DropDownListType.DataBind();

                DropDownListType.Items.Insert(0, "All");
            }
            else
            {
                DropDownListType.Items.Insert(0, "- Input Question Types-");
            }
        }