private void BindDropDownList()
        {
            try
            {
                PmsSysBiz      pmsSysBiz  = new PmsSysBiz();
                IList <PmsSys> pmsSysList = new List <PmsSys>();

                pmsSysList = pmsSysBiz.SelectData2ByTypeData1("PM", "Report", "YEAR");

                DropDownListYear.DataSource     = pmsSysList;
                DropDownListYear.DataTextField  = "data2";
                DropDownListYear.DataValueField = "data2";
                DropDownListYear.DataBind();

                DropDownListYear.Items.Insert(0, new ListItem());
                DropDownListYear.Items[0].Text  = "";
                DropDownListYear.Items[0].Value = "";


                pmsSysList = pmsSysBiz.SelectData2ByTypeData1("PM", "Report", "MONTH");

                DropDownListMonth.DataSource     = pmsSysList;
                DropDownListMonth.DataTextField  = "data2";
                DropDownListMonth.DataValueField = "data2";
                DropDownListMonth.DataBind();

                DropDownListMonth.Items.Insert(0, new ListItem());
                DropDownListMonth.Items[0].Text  = "";
                DropDownListMonth.Items[0].Value = "";


                pmsSysList = pmsSysBiz.SelectData1ByType("PM", "UserDept");

                DropDownListUserDept.DataSource     = pmsSysList;
                DropDownListUserDept.DataTextField  = "data1";
                DropDownListUserDept.DataValueField = "data1";
                DropDownListUserDept.DataBind();

                DropDownListUserDept.Items.Insert(0, new ListItem());
                DropDownListUserDept.Items[0].Text  = "";
                DropDownListUserDept.Items[0].Value = "";


                pmsSysList = pmsSysBiz.SelectData1ByType("PM", "RDDept");

                DropDownListRDDept.DataSource     = pmsSysList;
                DropDownListRDDept.DataTextField  = "data1";
                DropDownListRDDept.DataValueField = "data1";
                DropDownListRDDept.DataBind();

                DropDownListRDDept.Items.Insert(0, new ListItem());
                DropDownListRDDept.Items[0].Text  = "";
                DropDownListRDDept.Items[0].Value = "";
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Bind DropDownList failure');", true);
            }
        }
Exemple #2
0
        private void BindDropDown()
        {
            PmsSysBiz      pmsSysBiz  = new PmsSysBiz();
            IList <PmsSys> listPmsSys = pmsSysBiz.SelectData2ByTypeData1("PM", "MeetingMinute", "MeetingType");

            DropDownListMeetingMinuteType.DataSource     = listPmsSys;
            DropDownListMeetingMinuteType.DataTextField  = "data2";
            DropDownListMeetingMinuteType.DataValueField = "data2";
            DropDownListMeetingMinuteType.DataBind();

            DropDownListMeetingMinuteType.Items.Insert(0, new ListItem());
            DropDownListMeetingMinuteType.Items[0].Text  = "";
            DropDownListMeetingMinuteType.Items[0].Value = "";

            IList <PmsSys> listPmsSysVenue = pmsSysBiz.SelectData2ByTypeData1("PM", "MeetingMinute", "Venue");

            DropDownListVenue.DataSource     = listPmsSysVenue;
            DropDownListVenue.DataTextField  = "data2";
            DropDownListVenue.DataValueField = "data2";
            DropDownListVenue.DataBind();

            DropDownListVenue.Items.Insert(0, new ListItem());
            DropDownListVenue.Items[0].Text  = "";
            DropDownListVenue.Items[0].Value = "";

            IList <PmsSys> listPmsSysHour = pmsSysBiz.SelectData2ByTypeData1("PM", "MeetingTime", "Hour");

            DropDownListStartHour.DataSource     = listPmsSysHour;
            DropDownListStartHour.DataTextField  = "data2";
            DropDownListStartHour.DataValueField = "data2";
            DropDownListStartHour.DataBind();

            DropDownListEndHour.DataSource     = listPmsSysHour;
            DropDownListEndHour.DataTextField  = "data2";
            DropDownListEndHour.DataValueField = "data2";
            DropDownListEndHour.DataBind();

            // 选中 10;

            IList <PmsSys> listPmsSysMinute = pmsSysBiz.SelectData2ByTypeData1("PM", "MeetingTime", "Minute");

            DropDownListStartMinute.DataSource     = listPmsSysMinute;
            DropDownListStartMinute.DataTextField  = "data2";
            DropDownListStartMinute.DataValueField = "data2";
            DropDownListStartMinute.DataBind();

            DropDownListEndMinute.DataSource     = listPmsSysMinute;
            DropDownListEndMinute.DataTextField  = "data2";
            DropDownListEndMinute.DataValueField = "data2";
            DropDownListEndMinute.DataBind();

            //选中 00;
        }
Exemple #3
0
        protected void DropDownListYearMonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DropDownListWeekPeriod.Items.Clear();

                PmsSysBiz      pmsSysBiz  = new PmsSysBiz();
                string         yearMonth  = DropDownListYearMonth.SelectedValue.Trim();
                IList <PmsSys> pmsSysList = pmsSysBiz.SelectData2ByTypeData1("PM", "RequirementPeriod", yearMonth);

                DropDownListWeekPeriod.DataSource     = pmsSysList;
                DropDownListWeekPeriod.DataTextField  = "data2";
                DropDownListWeekPeriod.DataValueField = "data2";
                DropDownListWeekPeriod.DataBind();

                DropDownListWeekPeriod.Items.Insert(0, new ListItem());
                DropDownListWeekPeriod.Items[0].Text  = "";
                DropDownListWeekPeriod.Items[0].Value = "";

                ClearGrid();
            }
            catch
            {
            }
        }
        private IList <string> GetWeeks(string month)
        {
            IList <string> weeks      = new List <string>();
            PmsSysBiz      pmsSysBiz  = new PmsSysBiz();
            IList <PmsSys> pmsSysList = pmsSysBiz.SelectData2ByTypeData1("PM", "RequirementPeriod", month);

            if (pmsSysList.Count > 0)
            {
                foreach (var pmsSys in pmsSysList)
                {
                    weeks.Add(pmsSys.Data2);
                }
            }
            return(weeks);
        }