using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace CheckSheet
{
    public partial class rptReport_filter : System.Web.UI.Page
    {

        [System.Web.Services.WebMethod]
        public static string getweek(string year, string month)
        {
            string strvalue = string.Empty;
            DataSet ds = new DataSet();
            using (FcSql.Function fc = new FcSql.Function())
            {

                string q_data = string.Format("select Row_Number() over (order by weekno) as weektext,weekno as weekid from (select distinct weekno from listdate_of_year('{1}-01-01') Where month(listday)={0} and year(listday)={1}) as temp", month, year);
                ds = fc.SQL_DataSet(q_data);

                fc.closeconnection();


            }



            return ds.GetXml();


        }


        protected void Page_Load(object sender, EventArgs e)
        {


            if (!this.IsPostBack)
            {

                txt_checkyear.Items.Add(DateTime.Now.AddYears(-1).Year.ToString());
                txt_checkyear.Items.Add(DateTime.Now.Year.ToString());
               


                txt_checkmonth.Items.Add("1");
                txt_checkmonth.Items.Add("2");
                txt_checkmonth.Items.Add("3");
                txt_checkmonth.Items.Add("4");
                txt_checkmonth.Items.Add("5");
                txt_checkmonth.Items.Add("6");
                txt_checkmonth.Items.Add("7");
                txt_checkmonth.Items.Add("8");
                txt_checkmonth.Items.Add("9");
                txt_checkmonth.Items.Add("10");
                txt_checkmonth.Items.Add("11");
                txt_checkmonth.Items.Add("12");

                txt_checkmonth.SelectedItem.Text = DateTime.Now.Month.ToString();
                txt_checkyear.SelectedItem.Text = DateTime.Now.Year.ToString();

            }
        }

        
    }
}