protected void Page_Load(object sender, EventArgs e)

    {
        this.CurSessionConfig = new SessionConfig(0, ConfigurationManager.AppSettings["swordfish_v1_ConnectionString"]);
        if (!base.IsPostBack)
        {
            string text = Convert.ToString((int)(DateTime.Now.Year - 1));
            string str2 = Convert.ToString(DateTime.Now.Year);
            string str3 = Convert.ToString((int)(DateTime.Now.Year + 1));
            this.ddl_year.Items.Add(new ListItem(text, text));
            this.ddl_year.Items.Add(new ListItem(str2, str2));
            this.ddl_year.Items.Add(new ListItem(str3, str3));
            this.ddl_plant.Items.Add(new ListItem("", ""));
            this.ddl_plant.Items.Add(new ListItem("320", "320"));
            this.ddl_plant.Items.Add(new ListItem("820", "820"));
            this.ddl_dchannel.Items.Add(new ListItem("", ""));
            this.ddl_dchannel.Items.Add(new ListItem("3I", "3I"));
            this.ddl_dchannel.Items.Add(new ListItem("3O", "3O"));
            this.ddl_dchannel.Items.Add(new ListItem("3S", "3S"));
            using (UserManager manager = new UserManager(this.CurSessionConfig))
            {
                this.ddl_engineer.Items.Add(new ListItem("[All Engineer]", "%"));
                ApplicationUserCollection masterUsers = manager.GetMasterUsers();
                if (masterUsers != null)
                {
                    masterUsers.SortByName();
                    foreach (ApplicationUser user in masterUsers)
                    {
                        this.ddl_engineer.Items.Add(new ListItem(user.FirstName + " (" + user.UserID + ")", user.UserID));
                    }
                }
            }
            using (EquipmentManager manager2 = new EquipmentManager(this.CurSessionConfig))
            {
                this.ddl_EquipmProfile.Items.Add(new ListItem("[All Equipm. Profile]", "%"));
                EquipmentCollection allEquipmentProfiles = manager2.GetAllEquipmentProfiles();
                if (allEquipmentProfiles != null)
                {
                    allEquipmentProfiles.SortByName();
                    foreach (EquipmentObj obj2 in allEquipmentProfiles)
                    {
                        if (obj2.EquipmentProfileID.Length > 0)
                        {
                            this.ddl_EquipmProfile.Items.Add(new ListItem(obj2.EquipmentProfileID, obj2.EquipmentProfileID));
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.dbConnection = ConfigurationManager.AppSettings["swordfish_v1_ConnectionString"];

        this.CurSessionConfig = new SessionConfig(this.dbType, this.dbConnection);
        if (!base.IsPostBack)
        {
            int num = 0x7dc;
            for (int i = num; i <= (DateTime.Today.Year + 1); i++)
            {
                string text = i.ToString();
                this.ddl_year.Items.Add(new ListItem(text, i.ToString()));
                if (i == DateTime.Today.Year)
                {
                    this.ddl_year.SelectedIndex = this.ddl_year.Items.Count - 1;
                }
            }
            using (MasterManager manager = new MasterManager(this.CurSessionConfig))
            {
                //string[] plants = manager.GetPlants();
                this.ddl_plant.Items.Add(new ListItem("[All Plants]", ""));
                //foreach (string str in plants)
                //{
                //    this.ddl_plant.Items.Add(new ListItem(str, str));
                //}
                //string[] distChannel = manager.GetDistChannel();
                this.ddl_dchannel.Items.Add(new ListItem("[All Dist. Channel]", ""));
                //foreach (string str2 in distChannel)
                //{
                //    this.ddl_dchannel.Items.Add(new ListItem(str2, str2));
                //}
            }
            using (UserManager manager2 = new UserManager(this.CurSessionConfig))
            {
                this.ddl_Employee.Items.Add(new ListItem("[All Engineer]", "%"));
                ApplicationUserCollection masterUsers = manager2.GetMasterUsers();
                if (masterUsers != null)
                {
                    masterUsers.SortByName();
                    foreach (ApplicationUser user in masterUsers)
                    {
                        this.ddl_Employee.Items.Add(new ListItem(user.FirstName + " (" + user.UserID + ")", user.UserID));
                    }
                }
            }
            using (EquipmentManager manager3 = new EquipmentManager(this.CurSessionConfig))
            {
                this.ddl_EquipmProfile.Items.Add(new ListItem("[All Equipm. Profile]", "%"));
                EquipmentCollection allEquipmentProfiles = manager3.GetAllEquipmentProfiles();
                if (allEquipmentProfiles != null)
                {
                    allEquipmentProfiles.SortByName();
                    foreach (EquipmentObj obj2 in allEquipmentProfiles)
                    {
                        if (obj2.EquipmentProfileID.Length > 0)
                        {
                            this.ddl_EquipmProfile.Items.Add(new ListItem(obj2.EquipmentProfileID, obj2.EquipmentProfileID));
                        }
                    }
                }
            }
        }
    }
Ejemplo n.º 3
0
    protected void PageComponentSetup()
    {
        int num = 0x7dc;

        for (int i = num; i <= (DateTime.Today.Year + 1); i++)
        {
            string text = i.ToString();
            this.ddl_year.Items.Add(new ListItem(text, i.ToString()));
            if (i == DateTime.Today.Year)
            {
                this.ddl_year.SelectedIndex = this.ddl_year.Items.Count - 1;
            }
        }
        for (int j = 1; j <= 12; j++)
        {
            string introduced26 = j.ToString();
            this.ddl_Month.Items.Add(new ListItem(introduced26, j.ToString()));
            if (j == DateTime.Today.Month)
            {
                this.ddl_Month.SelectedIndex = this.ddl_Month.Items.Count - 1;
            }
        }
        using (MasterManager manager = new MasterManager(this.CurSessionConfig))
        {
            //string[] plants = manager.GetPlants();
            this.ddl_plant.Items.Add(new ListItem("[All Plants]", ""));
            //foreach (string str in plants)
            //{
            //    this.ddl_plant.Items.Add(new ListItem(str, str));
            //}
            //string[] distChannel = manager.GetDistChannel();
            this.ddl_dchannel.Items.Add(new ListItem("[All Dist. Channel]", ""));
            //foreach (string str2 in distChannel)
            //{
            //    this.ddl_dchannel.Items.Add(new ListItem(str2, str2));
            //}
        }
        using (UserManager manager2 = new UserManager(this.CurSessionConfig))
        {
            ApplicationUserCollection masterUsers = manager2.GetMasterUsers();
            if ((masterUsers != null) && (masterUsers.Count > 0))
            {
                this.DropDownList_Engineer.Items.Add(new ListItem("[All Engineer]", "%"));
                foreach (ApplicationUser user in masterUsers)
                {
                    this.DropDownList_Engineer.Items.Add(new ListItem(user.FirstName + " (" + user.UserID + ")", user.UserID));
                }
            }
        }
        using (EquipmentManager manager3 = new EquipmentManager(this.CurSessionConfig))
        {
            this.ddl_EquipmProfile.Items.Add(new ListItem("[All Equipm. Profile]", "%"));
            EquipmentCollection allEquipmentProfiles = manager3.GetAllEquipmentProfiles();
            if (allEquipmentProfiles != null)
            {
                allEquipmentProfiles.SortByName();
                foreach (EquipmentObj obj2 in allEquipmentProfiles)
                {
                    if (obj2.EquipmentProfileID.Length > 0)
                    {
                        this.ddl_EquipmProfile.Items.Add(new ListItem(obj2.EquipmentProfileID, obj2.EquipmentProfileID));
                    }
                }
            }
        }
    }