public void test_EventoNotInRange() { EVENTOBLL ev = new EVENTOBLL(); dsmaddant.EVENTODataTable t; DateTime d; DateTime.TryParse("4/2/2021 7:59", out d); t = ev.GetEVENTOAttivo(d); Assert.IsTrue((t is null) || (t.Rows.Count == 0)); DateTime.TryParse("4/2/2021 17:10", out d); t = ev.GetEVENTOAttivo(d); Assert.IsTrue((t is null) || (t.Rows.Count == 0)); }
public void test_EventoInRange() { EVENTOBLL ev = new EVENTOBLL(); dsmaddant.EVENTODataTable t; DateTime d; DateTime.TryParse("4/2/2021 10:00", out d); t = ev.GetEVENTOAttivo(d); Assert.IsTrue(t.Rows.Count == 1); DateTime.TryParse("4/2/2021 8:01", out d); t = ev.GetEVENTOAttivo(d); Assert.IsTrue(t.Rows.Count == 1); DateTime.TryParse("4/2/2021 16:59", out d); t = ev.GetEVENTOAttivo(d); Assert.IsTrue(t.Rows.Count == 1); }
public static bool IsEventActive() { // return false; //if (DateTime.Now.Second %2 ==0) // return true; //else //{ // return false; //} EVENTOBLL ev = new EVENTOBLL(); dsmaddant.EVENTODataTable t; DateTime dtNow = DateTime.Now; t = ev.GetEVENTOAttivo(dtNow); return(t.Rows.Count == 1); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EVENTOBLL ev = new EVENTOBLL(); dsmaddant.EVENTODataTable tev; DateTime dtNow = DateTime.Now; tev = ev.GetEVENTOAttivo(dtNow); if (tev.Rows.Count > 0) { AZIENDABLL az = new AZIENDABLL(); edEvID.Text = tev.Rows[0]["E_ID"].ToString(); lblAz.Text = az.GetAZIENDAByID(Convert.ToInt32(tev.Rows[0]["A_ID"])).Rows[0]["A_RAGSOC"].ToString(); Repeater1.DataBind(); } } }