예제 #1
0
        private static void deleteMeasureRawOld()
        {
            using (var db = new clsDBUltity())
            {
                var dateLimit = DateTime.Now.AddDays(-clsConfig.TimeDeleteMeasureDetailRaw);
                var tbl       = db.GetTBLMeasure(string.Empty, dateLimit.ToString(clsDBUltity.cstrDateTimeFormatNoMiliSecond));

                if (!clsCommon.TableIsNullOrEmpty(tbl))
                {
                    foreach (System.Data.DataRow row in tbl.Rows)
                    {
                        db.DeleteMeasureRaw(clsCommon.CnvNullToInt(row["measure_id"]));
                    }
                }
            }
        }
예제 #2
0
        private void LoadData()
        {
            var dtStart = new DateTime(dtpStart.Value.Year, dtpStart.Value.Month, dtpStart.Value.Day, 0, 0, 0);
            var dtEnd   = new DateTime(dtpEnd.Value.Year, dtpEnd.Value.Month, dtpEnd.Value.Day, 23, 59, 59);

            var strSDate = dtStart.ToString(clsDBUltity.cstrDateTimeFormatNoMiliSecond);
            var strEDate = dtEnd.ToString(clsDBUltity.cstrDateTimeFormatNoMiliSecond);
            int intUser  = cmbUser.SelectedValue != null?clsCommon.CnvNullToInt(cmbUser.SelectedValue) : SELECT_ALL;

            int intType = cmbType.SelectedValue != null?clsCommon.CnvNullToInt(cmbType.SelectedValue) : SELECT_ALL;

            int intResult = cmbResult.SelectedValue != null?clsCommon.CnvNullToInt(cmbResult.SelectedValue) : SELECT_ALL;

            int intStatus = cmbStatus.SelectedValue != null?clsCommon.CnvNullToInt(cmbStatus.SelectedValue) : SELECT_ALL;

            pnlFilter.Enabled           = false;
            dgvMeasureDetail.DataSource = null;
            dgvMeasure.DataSource       = _objDB.GetTBLMeasure(strSDate, strEDate, intUser, intType, intResult, intStatus);
            dgvMeasure.Columns[colEnable.Index].Visible = intStatus == (int)emMeasureStatus.Error && clsConfig.ModeApp == clsConfig.emModeApp.Admin;
        }