private void BindMonth()
 {
     DropDownListMonth.DataSource     = ClaimSchedule.GetClaimScheduleMonthByCompanyId(Account.GetAccountByUserName(Page.User.Identity.Name.ToString()).CompanyId);
     DropDownListMonth.DataTextField  = "FormattedClaimDate";
     DropDownListMonth.DataValueField = "ClaimDate";
     DropDownListMonth.DataBind();
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DateTime  tnow   = DateTime.Now;//现在时间
            ArrayList AlYear = new ArrayList();
            int       i;

            for (i = 2019; i >= 1960; i--)
            {
                AlYear.Add(i);
            }
            ArrayList AlMonth = new ArrayList();

            for (i = 1; i <= 12; i++)
            {
                AlMonth.Add(i);
            }
            if (!this.IsPostBack)
            {
                DropDownListYear.DataSource = AlYear;
                DropDownListYear.DataBind(); //绑定年
                                             //选择当前年
                DropDownListYear.SelectedValue = tnow.Year.ToString();
                DropDownListMonth.DataSource   = AlMonth;
                DropDownListMonth.DataBind(); //绑定月
                                              //选择当前月
                DropDownListMonth.SelectedValue = tnow.Month.ToString();
                int year, month;
                year  = Int32.Parse(DropDownListYear.SelectedValue);
                month = Int32.Parse(DropDownListMonth.SelectedValue);
                BindDays(year, month); //绑定天
                                       //选择当前日期
                DropDownListDay.SelectedValue = tnow.Day.ToString();
            }
        }
 public void bindMonth()
 {
     try
     {
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
         con.Open();
         DataTable      dt  = new DataTable();
         SqlCommand     cmd = new SqlCommand("Select Distinct MONTH from DAARREARS$", con);
         SqlDataAdapter da  = new SqlDataAdapter(cmd);
         da.Fill(dt);
         con.Close();
         DropDownListMonth.DataSource     = dt;
         DropDownListMonth.DataValueField = "MONTH";
         DropDownListMonth.DataBind();
         DropDownListMonth.Items.Insert(0, new ListItem("Select", ""));
     }
     catch (Exception ee)
     {
         Response.Write("<script>alert('Error While Binding Month');</script>");
     }
     finally
     {
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
 }
        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);
            }
        }
示例#5
0
        public void bindMonth()
        {
            DataTable      dt  = new DataTable();
            SqlCommand     cmd = new SqlCommand("Select Distinct MONTH from MANUAL_BILLS$", con);
            SqlDataAdapter da  = new SqlDataAdapter(cmd);

            cmd.CommandTimeout = 120;
            da.Fill(dt);
            con.Close();
            DropDownListMonth.DataSource     = dt;
            DropDownListMonth.DataValueField = "MONTH";
            DropDownListMonth.DataBind();
            DropDownListMonth.Items.Insert(0, new ListItem("Select", ""));
        }
 public void bindMonth()
 {
     try
     {
         DataTable      dt  = new DataTable();
         SqlCommand     cmd = new SqlCommand("Select Distinct MONTH from PAY_SLIP$", con);
         SqlDataAdapter da  = new SqlDataAdapter(cmd);
         cmd.CommandTimeout = 120;
         da.Fill(dt);
         con.Close();
         DropDownListMonth.DataSource     = dt;
         DropDownListMonth.DataValueField = "MONTH";
         DropDownListMonth.DataBind();
         DropDownListMonth.Items.Insert(0, new ListItem("Select", ""));
     }
     catch (Exception ee)
     {
         Response.Write("<script>alert('Error While Binding Month');</script>");
     }
 }
示例#7
0
 public void bindMonth()
 {
     try
     {
         SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["UniversityDatabaseConnectionString"].ConnectionString);
         con.Open();
         DataTable      dt  = new DataTable();
         SqlCommand     cmd = new SqlCommand("Select Distinct MONTH from TESTING$", con);
         SqlDataAdapter da  = new SqlDataAdapter(cmd);
         da.Fill(dt);
         con.Close();
         DropDownListMonth.DataSource     = dt;
         DropDownListMonth.DataValueField = "MONTH";
         DropDownListMonth.DataBind();
         DropDownListMonth.Items.Insert(0, new ListItem("Select", ""));
     }
     catch (Exception ee)
     {
         Response.Write("<script>alert('Error While Binding Month!!');</script>");
     }
 }
示例#8
0
 protected void DropDownListWork_SelectedIndexChanged(object sender, EventArgs e)
 {
     LabelWork.Text = wc.GetTaskNameByID(Guid.Parse(DropDownListWork.SelectedValue));
     DropDownListMonth.DataBind();
 }