Example #1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string FromMonths = ddlFrom.SelectedItem.Value;
            string ToMonths   = ddlTo.SelectedItem.Value;

            if (!string.IsNullOrEmpty(FromMonths))
            {
                string[] FromArr   = FromMonths.Split('_');
                string   FromMonth = FromArr[0].ToString();

                string[] ToArr   = ToMonths.Split('_');
                string   ToMonth = ToArr[0].ToString();

                int YearName = Convert.ToInt32(FromArr[1].ToString());

                clsPromotionFactory fac         = new clsPromotionFactory();
                DataTable           myDataTable = fac.GetAll(FromMonth, ToMonth, YearName, 0);

                grd.DataSource = myDataTable;
                grd.DataBind();
            }
            else
            {
                DateTime Currentdate = DateTime.Now;
                int      CurrentYear = Currentdate.Year;

                string CurrentMonth = Currentdate.ToString("MMMM");
                string FromMonth    = (CurrentMonth == "gennaio" ? "January" : CurrentMonth == "febbraio" ? "February" : CurrentMonth == "marzo" ? "March" : CurrentMonth == "aprile" ? "April" : CurrentMonth == "maggio" ? "May" : CurrentMonth == "giugno" ? "June" : CurrentMonth == "luglio" ? "July" : CurrentMonth == "agosto" ? "August" : CurrentMonth == "settembre" ? "September" : CurrentMonth == "ottobre" ? "October" : CurrentMonth == "novembre" ? "November" : CurrentMonth == "dicembre" ? "December" : CurrentMonth);

                string ToMonth = FromMonth;

                BindTaskList(FromMonth, ToMonth, CurrentYear, 0);
            }
        }
Example #2
0
        protected void btnComplete_Click(object sender, EventArgs e)
        {
            clsPromotionFactory fac         = new clsPromotionFactory();
            DataTable           myDataTable = fac.GetAll(string.Empty, string.Empty, DateTime.Now.Year, 1);

            grd.DataSource = myDataTable;
            grd.DataBind();
        }
Example #3
0
        ////Bind your Grid View here
        //private void BindTaskList()
        //{
        //    clsPromotionFactory fac = new clsPromotionFactory();
        //    //DataSet Emergenti = fac.GetAllWithPaging(Convert.ToInt32(ViewState["PageNumber"]), 100, ViewState["SortColumn"].ToString(), null);
        //    DataTable Emergenti = fac.GetAll();
        //    //DataTable myDataTable = Emergenti.Tables[0]; //Set your DataTable here
        //    //ViewState["Count"] = Emergenti.Tables[1];
        //    grd.DataSource = Emergenti;
        //    grd.DataBind();
        //}

        private void BindTaskList(string FromMonth, string ToMonth, int CurrentYear, int IsAll)
        {
            clsPromotionFactory fac       = new clsPromotionFactory();
            DataTable           Emergenti = fac.GetAll(FromMonth, ToMonth, CurrentYear, IsAll);

            grd.DataSource = Emergenti;
            grd.DataBind();
        }