private void DateInervalControl_Loaded(object sender, RoutedEventArgs e) { DateTime1 = DateTime.Now.Date; DateTime2 = DateTime1.AddDays(1.0).AddSeconds(-1.0); WindowHelper.RegisterHandler(this, PreviewMouseLeftButtonDownEvent, Window_MouseDown); WindowHelper.GetWindow(this).Deactivated += DateInervalControl_Deactivated; }
public void CreateScreeeningnohours() { CreateScreeening.Click(); MovieId.SendKeys("2"); DateTime1.SendKeys(RandomDate().ToString(" HH:00")); CreateButton.Click(); }
public void CreateScreeeningnodate() { CreateScreeening.Click(); MovieId.SendKeys("2"); DateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy,")); CreateButton.Click(); }
public override int GetHashCode() { var hashCode = -2098635407; hashCode = hashCode * -1521134295 + DateTime1.GetHashCode(); hashCode = hashCode * -1521134295 + DateTime2.GetHashCode(); return(hashCode); }
public void CreateScreeeningEditButton() { CreateScreeening.Click(); MovieId.SendKeys("2"); DateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy, 15:15")); CreateButton.Click(); EditCreateScreeningButton.Click(); dateTime1.Clear(); dateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy HH:00")); SaveButton.Click(); }
/// <inheritdoc/> public override int GetHashCode() { // Overflow is fine, just wrap. unchecked { int hash = 17; hash *= 23 + DateTime1.GetHashCode(); hash *= 23 + DateTime2.GetHashCode(); hash *= 23 + Date1.GetHashCode(); hash *= 23 + Date2.GetHashCode(); return(hash); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, DirectEventArgs e) { try { string startTime = "'" + DateTime1.GetValue() + "'"; string endTime = "'" + DateTime2.GetValue() + "'"; grp_nhatkytrucap.OutSideQuery = " Time > " + startTime + " and Time < " + endTime; grp_nhatkytrucap.ReloadStore(); wdChooseTime.Hide(); } catch (Exception ex) { Dialog.ShowError(ex.Message); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (DateTime1 != null) { hashCode = hashCode * 59 + DateTime1.GetHashCode(); } if (DateTime2 != null) { hashCode = hashCode * 59 + DateTime2.GetHashCode(); } return(hashCode); } }
private void clear1_Click(object sender, EventArgs e) { ItemName1.Clear(); ItemType1.Clear(); ItemCat1.ResetText(); DateTime1.ResetText(); ItemValue1.Clear(); ItemQty1.Clear(); SMD1.ResetText(); StaffName1.Clear(); ItemCat1.Text = "Select one"; ItemCat1.ForeColor = Color.Gray; SMD1.Text = "Select one"; SMD1.ForeColor = Color.Gray; }
/// <summary> /// Returns true if InputDateTimeDifference instances are equal /// </summary> /// <param name="other">Instance of InputDateTimeDifference to be compared</param> /// <returns>Boolean</returns> public bool Equals(InputDateTimeDifference other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( DateTime1 == other.DateTime1 || DateTime1 != null && DateTime1.Equals(other.DateTime1) ) && ( DateTime2 == other.DateTime2 || DateTime2 != null && DateTime2.Equals(other.DateTime2) )); }
public override string ToString() { return(year + " " + DateTime1.ToString("MMM") + " - " + DateTime2.ToString("MMM")); }
public void BuildBetweenTest112() { Assert.Throws <InvalidCastException>(() => FunctionBuilder.BuildBetween <TestDataObject>(x => x.Name, x => x.BirthDate, DateTime1.ToString())); }
public void BuildBetweenTest102() { Assert.Equal( LangDef.GetFunction(LangDef.funcBETWEEN, StringGenVarDef, String1, DateTime1.ToString()), FunctionBuilder.BuildBetween <TestDataObject>(x => x.Name, String1, DateTime1)); }
public IActionResult Index() { var user = authProvider.GetCurrentUser(); if (user.Role == "Admin") { ViewBag.Users = authProvider.GetAllUsers(); return(View("AdminIndex", user)); } else { ViewBag.Hours = hoursDAL.GetAllHours(user.UserId, true); // alert section IList <PayrollTable> payrollList = payrollDAL.GetTimeReport(user.UserId); if (payrollList.Count > 0) { int isOver = hoursDAL.IsOverWeeklyHoursAlert(user.UserId, payrollList[0].StartDate, payrollList[0].EndDate); ViewBag.IsOver = isOver; User userRole = authProvider.GetCurrentUser(); ViewBag.UserRole = userRole.Role; } // end of alert section // reminder section if (payrollList.Count > 0) { DateTime startPayPeriodDate = payrollList[0].StartDate; DateTime endPayPeriodDate = payrollList[0].EndDate; DateTime dateToday = DateTime.Now; int numOfWeekendDays = CalculateWeekends(startPayPeriodDate, endPayPeriodDate); // not correct int CalculateWeekends(DateTime DateTime1, DateTime DateTime2) { int iReturn = 0; TimeSpan xTimeSpan; if (DateTime2 > DateTime1) { xTimeSpan = DateTime2.Subtract(DateTime1); } else { xTimeSpan = DateTime1.Subtract(DateTime2); } int iDays = 5 + System.Convert.ToInt32(xTimeSpan.TotalDays); iReturn = (iDays / 7); return(iReturn); } TimeSpan expectedDaysTimeSpan = dateToday.Subtract(startPayPeriodDate); int expectedDaysInt = (int)expectedDaysTimeSpan.TotalDays - numOfWeekendDays; int numberOfDaysLoggedWithCurrentPayPeriod = logDAL.GetUserLogWithinPayPeriod(user.UserId, startPayPeriodDate, endPayPeriodDate); bool allLogsEntered = true; if (expectedDaysInt != numberOfDaysLoggedWithCurrentPayPeriod) { allLogsEntered = false; } ViewBag.AllLogsEntered = allLogsEntered; } // end of reminder section return(View(user)); } }
public override string ToString() { string returnValue = "Text1: " + Text1 + "\r Text2: " + Text2; returnValue += "\r comboBox1:" + comboBox1 + "\r Int1:" + Int1.ToString() + "\r DateTime1:" + DateTime1.ToString(); returnValue += "\r ProductCategory:" + ProductCategory + "\r MaskText1:" + MaskText1.ToString() + "\r Enabled1:" + Enabled1.ToString(); return(returnValue.ToString()); }
public async Task ModuleReturnsNotFound_WhenNoMatchesFound() { await StatisticStorage.UpdateServer(Server1.GetIndex(), Server1); var response = await Module.ProcessRequest(CreateRequest("", $"/servers/{Server1.Id}/matches/{DateTime1.ToUtcFormat()}")); response.Response.Should().Be(new HttpResponse(HttpStatusCode.NotFound)); }
public async Task ModuleReturnsNotFound_WhenNoServersFound() { var response = await Module.ProcessRequest(CreateRequest("", $"/servers/{Host1}/matches/{DateTime1.ToUtcFormat()}")); response.Response.Should().Be(new HttpResponse(HttpStatusCode.NotFound)); }