private void SetDate() { if (ddlDateRange.SelectedIndex != -1) { Int32 intyearid = Convert.ToInt32(ddlDateRange.SelectedValue); FinYearDAL objDAL = new FinYearDAL(); var lst = objDAL.FilldateFromTo(intyearid); int year = DateTime.Now.Year; int month = DateTime.Now.Month; int numDays = DateTime.DaysInMonth(year, month); hidmindate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "StartDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "StartDate")).ToString("dd-MM-yyyy")); hidmaxdate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "EndDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "EndDate")).ToString("dd-MM-yyyy")); if (Convert.ToDateTime(ApplicationFunction.mmddyyyy(hidmaxdate.Value)) >= DateTime.Now.Date && DateTime.Now.Date >= Convert.ToDateTime(ApplicationFunction.mmddyyyy(hidmindate.Value))) { Datefrom.Text = Convert.ToString(hidmindate.Value); Dateto.Text = DateTime.Now.Date.ToString("dd-MM-yyyy"); } else { Datefrom.Text = Convert.ToString(hidmindate.Value); Dateto.Text = Convert.ToString(hidmaxdate.Value); //Dateto.Text = hidmindate.Value; } } //BindDropdownDAL obj = new BindDropdownDAL(); //Array list = obj.BindDate(); //Datefrom.Text = Convert.ToString(list.GetValue(0)); //Dateto.Text = Convert.ToString(list.GetValue(1)); }
private void SetDate() { Int32 intyearid = Convert.ToInt32(ddlDateRange.SelectedValue); FinYearDAL objDAL = new FinYearDAL(); var lst = objDAL.FilldateFromTo(intyearid); hidmindate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "StartDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "StartDate")).ToString("dd-MM-yyyy")); hidmaxdate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "EndDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "EndDate")).ToString("dd-MM-yyyy")); if (ddlDateRange.SelectedIndex >= 0) { if (Convert.ToDateTime(ApplicationFunction.mmddyyyy(hidmaxdate.Value)) >= DateTime.Now.Date && DateTime.Now.Date >= Convert.ToDateTime(ApplicationFunction.mmddyyyy(hidmindate.Value))) { txtslipdate.Text = DateTime.Now.Date.ToString("dd-MM-yyyy"); txtDateFrom.Text = Convert.ToString(hidmindate.Value); txtDateTo.Text = DateTime.Now.Date.ToString("dd-MM-yyyy"); } else { txtslipdate.Text = hidmindate.Value; txtDateFrom.Text = Convert.ToString(hidmindate.Value); txtDateTo.Text = Convert.ToString(hidmaxdate.Value); txtDateTo.Text = hidmindate.Value; } } }
private void BindDateRange() { objFinYearDAL = new FinYearDAL(); ddlDateRange.DataSource = objFinYearDAL.FillYrwiseDateRange(ApplicationFunction.ConnectionString()); objFinYearDAL = null; ddlDateRange.DataTextField = "DateRange"; ddlDateRange.DataValueField = "Id"; ddlDateRange.DataBind(); }
private void SetDate() { Int32 intyearid = Convert.ToInt32(ddlDateRange.SelectedValue); FinYearDAL objDAL = new FinYearDAL(); var lst = objDAL.FilldateFromTo(intyearid); hidmindate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "StartDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "StartDate")).ToString("dd-MM-yyyy")); hidmaxdate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "EndDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "EndDate")).ToString("dd-MM-yyyy")); }
private void BindDateRange() { objFinYearDAL = new FinYearDAL(); ddlDateRange.DataSource = objFinYearDAL.FillYrwiseDateRange(); objFinYearDAL = null; ddlDateRange.DataTextField = "DateRange"; ddlDateRange.DataValueField = "Id"; ddlDateRange.DataBind(); }
public void BindDateRange() { FinYearDAL obj = new FinYearDAL(); var lst = obj.FillYrwiseDateRange(ApplicationFunction.ConnectionString()); ddldateRange.DataSource = lst; ddldateRange.DataTextField = "DateRange"; ddldateRange.DataValueField = "Id"; ddldateRange.DataBind(); }
private void SetDate() { FinYearDAL objDAL = new FinYearDAL(); var lst = objDAL.FilldateFromTo(3); hidmindate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "StartDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "StartDate")).ToString("dd-MM-yyyy")); hidmaxdate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "EndDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "EndDate")).ToString("dd-MM-yyyy")); if (Convert.ToDateTime(ApplicationFunction.mmddyyyy(hidmaxdate.Value)) >= DateTime.Now.Date && DateTime.Now.Date >= Convert.ToDateTime(ApplicationFunction.mmddyyyy(hidmindate.Value))) { txtDate.Text = DateTime.Now.Date.ToString("dd-MM-yyyy"); } else { txtDate.Text = hidmindate.Value; } }
private void SetDate() { Int32 intyearid = Convert.ToInt32(ddlDateRange.SelectedValue); FinYearDAL objFinYearDAL = new FinYearDAL(); var lst = objFinYearDAL.FilldateFromTo(intyearid); hidmindate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "StartDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "StartDate")).ToString("dd-MM-yyyy")); hidmaxdate.Value = string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(lst[0], "EndDate"))) ? "" : Convert.ToString(Convert.ToDateTime(DataBinder.Eval(lst[0], "EndDate")).ToString("dd-MM-yyyy")); //if (ddlDateRange.SelectedIndex != 0) //{ // txtDateFrom.Text = hidmindate.Value; // txtDateTo.Text = hidmaxdate.Value; //} //else //{ // txtDateFrom.Text = hidmindate.Value; // txtDateTo.Text = DateTime.Now.Date.ToString("dd-MM-yyyy"); //} }