示例#1
0
        protected void cdrCurrentDate_SelectionChanged(object sender, EventArgs e)
        {

            DataSet dsTimeStamps;
            ArrayList alTimeStamps = new ArrayList();
            ScoringDAL dbAccess = new ScoringDAL();
            dsTimeStamps = dbAccess.GetReportGenerationTimes(cdrCurrentDate.SelectedDate.ToString("yyyyMMdd"));
            ddlCurrentTime.Items.Clear();
            if (dsTimeStamps != null)
            {
                ddlCurrentTime.Items.Add("Current Time");
                foreach (DataRow drTimeStamp in dsTimeStamps.Tables[0].Rows)
                {
                    String strCurrentTime = drTimeStamp["roxieTime"].ToString();
                    TimeSpan ts = new TimeSpan(Convert.ToInt32(strCurrentTime.Substring(0, 2)),
                                               Convert.ToInt32(strCurrentTime.Substring(2, 2)),
                                               Convert.ToInt32(strCurrentTime.Substring(4, 2)));
                    DateTime prevTime = cdrCurrentDate.SelectedDate + ts;
                    //DateTime prevTime = Convert.ToDateTime(strPrevTime.Substring(0, 2) + ":" + strPrevTime.Substring(2, 2) + ":" + strPrevTime.Substring(4, 2));
                    //alTimeStamps.Add("Current Time");
                    //alTimeStamps.Add(prevTime.ToString("MM/dd/yyyy hh:mm:ss tt"));

                    ddlCurrentTime.Items.Add(prevTime.ToString("MM/dd/yyyy hh:mm:ss tt"));
                    if (dsTimeStamps.Tables[0].Rows.Count == 1)
                    {
                        ddlCurrentTime.SelectedIndex = 1;
                    }
                    else
                    {
                        ddlCurrentTime.SelectedIndex = 0;
                    }
                    ddlCurrentTime.Enabled = true;
                }
                //ddlCurrentTime.DataSource = alTimeStamps;
                //ddlCurrentTime.DataBind();
            }
            btnSubmit.Enabled = true;

        }
示例#2
0
        protected void cdrPrevDate_SelectionChanged(object sender, EventArgs e)
        {
            DataSet dsTimeStamps;
            ScoringDAL dbAccess = new ScoringDAL();
            dsTimeStamps = dbAccess.GetReportGenerationTimes(cdrPrevDate.SelectedDate.ToString("yyyyMMdd"));

            cdrCurrentDate.Enabled = true;
            cdrCurrentDate.VisibleDate = cdrPrevDate.SelectedDate;
            dsCurrentDateSelectedData = dbAccess.GetCurrentDatesWithData(cdrPrevDate.SelectedDate.Month.ToString(),
                                                                        cdrPrevDate.SelectedDate.Year.ToString(),
                                                                        cdrPrevDate.SelectedDate.ToString("yyyyMMdd"),
                                                                        (hifModel.Value == "") ? "Risk View" : hifModel.Value);
            ViewState["selectedCurrentDateDataForMonth"] = dsCurrentDateSelectedData;
            ddlPrevTime.Items.Clear();
            if (dsTimeStamps != null)
            {
                ddlPrevTime.Items.Add("Previous Time");
                foreach (DataRow drTimeStamp in dsTimeStamps.Tables[0].Rows)
                {
                    String strPrevTime = drTimeStamp["roxieTime"].ToString();
                    TimeSpan ts = new TimeSpan(Convert.ToInt32(strPrevTime.Substring(0, 2)),
                                               Convert.ToInt32(strPrevTime.Substring(2, 2)),
                                               Convert.ToInt32(strPrevTime.Substring(4, 2)));
                    DateTime prevTime = cdrPrevDate.SelectedDate + ts;
                    //DateTime prevTime = Convert.ToDateTime(strPrevTime.Substring(0, 2) + ":" + strPrevTime.Substring(2, 2) + ":" + strPrevTime.Substring(4, 2));

                    ddlPrevTime.Items.Add(prevTime.ToString("MM/dd/yyyy hh:mm:ss tt"));

                    if (dsTimeStamps.Tables[0].Rows.Count == 1)
                    {
                        ddlPrevTime.SelectedIndex = 1;
                    }
                    else
                    {
                        ddlPrevTime.SelectedIndex = 0;
                    }

                    ddlPrevTime.Enabled = true;
                }
            }
            // RenderControl(cdrPrevDate);
            //FillDatesUsingData(cdrPrevDate.SelectedDate);

        }