protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlSourceItems.SelectCommand = "SELECT [ItemID], [ItemName] FROM [ItemMaster] Where BranchId='" + Globals.BranchID + "' ORDER BY ItemName"; SqlSourceItems.DataBind(); drpItemNames.Focus(); drpMonthList.SelectedIndex = DateTime.Today.Month - 1; drpYearList.Items.Clear(); for (int i = 2000; i <= 2050; i++) { drpYearList.Items.Add(i.ToString()); } drpYearList.SelectedIndex = DateTime.Today.Year - 2000; //btnShowReport_Click(null, null); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { _allItems = string.Empty; SqlSourceItems.SelectCommand = "SELECT [ItemID], [ItemName] FROM [ItemMaster] Where BranchId='" + Globals.BranchID + "' ORDER BY ItemName"; SqlSourceItems.DataBind(); drpItemNames.Focus(); date = DAL.DALFactory.Instance.DAL_DateAndTime.getDateAndTimeAccordingToZoneTime(Globals.BranchID); hdnDateFromAndTo.Value = date[0].ToString() + " - " + date[0].ToString(); setValues(date[0].ToString().Trim(), date[0].ToString().Trim()); BindDropDown(); btnShowReport_Click(sender, e); } }