private void frmShowGraphs_Load(object sender, EventArgs e) { int Month = DateTime.Now.Month.ToInt(); ddlMonths.SelectedIndex = Month.ToInt(); ddlMonths.SelectedIndex = Month.ToInt(); //ddlYear.SelectedText = DateTime.Now.Year.ToStr(); ComboFunctions.FillUsersCombo(ddlUsers); dtpFromDate.Value = DateTime.Now.ToDateTime(); dtpTillDate.Value = DateTime.Now.ToDateTime(); rdoWeekly.IsChecked = true; chkCurrentWeek.Checked = true; rdoAccountVsCash.IsChecked = true; lblCurrentWeek.Text = "Current Week ( " + string.Format("{0:dd/MM/yyyy}", DateTime.Now.GetStartOfCurrentWeek().ToDate()) + " - " + string.Format("{0:dd/MM/yyyy}", DateTime.Now.GetEndOfCurrentWeek().ToDate()) + " )"; lblLastWeek.Text = "Last Week ( " + string.Format("{0:dd/MM/yyyy}", DateTime.Now.GetStartOfCurrentWeek().ToDate().AddDays(-7)) + " - " + string.Format("{0:dd/MM/yyyy}", DateTime.Now.GetStartOfCurrentWeek().ToDate().AddDays(-1)) + " )"; }
void frmDriverReport_Load(object sender, EventArgs e) { ComboFunctions.FillUsersCombo(ddlController); ComboFunctions.FillDriverNoCombo(ddl_Driver, c => c.HasPDA != null && c.HasPDA == true); dtpFromDate.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); dtpTillDate.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.LastDayOfMonthValue()); GridViewTextBoxColumn col = new GridViewTextBoxColumn(); col.IsVisible = false; col.Name = COLS.DRIVERID; grdLister.Columns.Add(col); col = new GridViewTextBoxColumn(); // col.IsVisible = false; col.ReadOnly = true; col.HeaderText = "Action"; col.Name = COLS.ACTION; grdLister.Columns.Add(col); col = new GridViewTextBoxColumn(); col.ReadOnly = true; col.HeaderText = "Drv"; col.Name = COLS.DRIVERNO; grdLister.Columns.Add(col); GridViewDateTimeColumn colDt = new GridViewDateTimeColumn(); colDt.Name = COLS.PICKUPDATETIME; colDt.ReadOnly = true; colDt.HeaderText = "Pickup Date Time"; grdLister.Columns.Add(colDt); col = new GridViewTextBoxColumn(); col.HeaderText = "Pickup Point"; col.Name = COLS.PICKUPPOINT; col.ReadOnly = true; grdLister.Columns.Add(col); col = new GridViewTextBoxColumn(); // col.IsVisible = false; col.ReadOnly = true; col.Name = "Destination"; col.HeaderText = COLS.DESTINATION; grdLister.Columns.Add(col); colDt = new GridViewDateTimeColumn(); colDt.Name = COLS.BLOCKEDON; colDt.ReadOnly = true; colDt.HeaderText = "Blocked On"; grdLister.Columns.Add(colDt); colDt = new GridViewDateTimeColumn(); colDt.Name = COLS.UNBLOCKEDON; colDt.ReadOnly = true; colDt.HeaderText = "UnBlocked On"; grdLister.Columns.Add(colDt); col = new GridViewTextBoxColumn(); col.Name = COLS.UNBLOCKBY; col.ReadOnly = true; col.HeaderText = "UnBlock By"; grdLister.Columns.Add(col); //(grdLister.Columns[COLS.PICKUPDATETIME] as GridViewDateTimeColumn).CustomFormat = "dd/MM/yyyy HH:mm"; // (grdLister.Columns[COLS.PICKUPDATETIME] as GridViewDateTimeColumn).FormatString = "{0:dd/MM/yyyy HH:mm}"; (grdLister.Columns[COLS.PICKUPDATETIME] as GridViewDateTimeColumn).CustomFormat = "dd/MM/yyyy HH:mm"; (grdLister.Columns[COLS.PICKUPDATETIME] as GridViewDateTimeColumn).FormatString = "{0:dd/MM/yyyy HH:mm}"; (grdLister.Columns[COLS.BLOCKEDON] as GridViewDateTimeColumn).CustomFormat = "dd/MM/yyyy HH:mm"; (grdLister.Columns[COLS.BLOCKEDON] as GridViewDateTimeColumn).FormatString = "{0:dd/MM/yyyy HH:mm}"; (grdLister.Columns[COLS.UNBLOCKEDON] as GridViewDateTimeColumn).CustomFormat = "dd/MM/yyyy HH:mm"; (grdLister.Columns[COLS.UNBLOCKEDON] as GridViewDateTimeColumn).FormatString = "{0:dd/MM/yyyy HH:mm}"; grdLister.Columns[COLS.DRIVERNO].Width = 60; grdLister.Columns[COLS.PICKUPPOINT].Width = 160; grdLister.Columns[COLS.DESTINATION].Width = 160; grdLister.Columns[COLS.PICKUPDATETIME].Width = 100; grdLister.Columns[COLS.BLOCKEDON].Width = 130; grdLister.Columns[COLS.UNBLOCKEDON].Width = 130; grdLister.Columns[COLS.UNBLOCKBY].Width = 100; grdLister.Columns[COLS.ACTION].Width = 100; grdLister.AllowEditRow = true; }