public override int GetHashCode() { int hashCode = -793585214; hashCode = hashCode * -1521134295 + MetadataBrokerType.GetHashCode(); hashCode = hashCode * -1521134295 + DateTimeFrom.GetHashCode(); hashCode = hashCode * -1521134295 + DateTimeTo.GetHashCode(); return(hashCode); }
public void SaveExecuted(object param) { int i = dbOperations.QueryEphemerisList().Count; //var counter = dbOperations.QueryEphemerisNamesList().Count; _formData = new FormData(); _formData.MonitorBody = SelectedBody; DateTime dzero = new DateTime(1, 1, 1); StringBuilder buf = new StringBuilder(); _formData.swisseph(buf); List <TableEphemerisEntry> calculatedEntries = new List <TableEphemerisEntry>(); //DateTime from = new DateTime(int.Parse(EDIT_FROM_YEAR.Text), int.Parse(EDIT_FROM_MONTH.Text), int.Parse(EDIT_FROM_DAY.Text)); //DateTime until = new DateTime(int.Parse(EDIT_UNTIL_YEAR.Text), int.Parse(EDIT_UNTIL_MONTH.Text), int.Parse(EDIT_UNTIL_DAY.Text)); //int interval = int.Parse(textBox1.Text); //Crude_Entries ce = new Crude_Entries //{ // ce_id = Guid.NewGuid(), // ce_ephemerisname = EDIT_OBJECT.Text, // ce_from = from, // ce_until = until, // ce_geomatricallatitude = "GeoLat", // ce_geometricallongitude = "GeoLon", // ce_system = "LeSystem", // ce_withasteroids = new byte[] { 1 }, // ce_withhyperbolicbodies = new byte[] { 0 }, // ce_service = "LeService", // ce_object = "Sun", // ce_abovesea = 399, // ce_intervals = "intervals" //}; if (SelectedIntervalString.Equals("Days")) { //Days while ((DateTimeFrom - dzero).TotalDays < (DateTimeUntil - dzero).TotalDays) { _formData.DateTime = DateTimeFrom; _formData.swisseph(buf); calculatedEntries.Add(_formData.ExtractTemplateFromStringBuilder()); DateTimeFrom = DateTimeFrom.AddDays(SelectedInterval); } } else if (SelectedIntervalString.Equals("Months")) { // //Months while (MonthDifference(DateTimeUntil, DateTimeFrom) > 0) { _formData.DateTime = DateTimeFrom; _formData.swisseph(buf); calculatedEntries.Add(_formData.ExtractTemplateFromStringBuilder()); DateTimeFrom = DateTimeFrom.AddMonths(SelectedInterval); } } else if (SelectedIntervalString.Equals("Years")) { // //Years while (YearDifference(DateTimeUntil, DateTimeFrom) > 0) { _formData.DateTime = DateTimeFrom; _formData.swisseph(buf); calculatedEntries.Add(_formData.ExtractTemplateFromStringBuilder()); DateTimeFrom = DateTimeFrom.AddYears(SelectedInterval); } } ////MessageBox.Show(calculatedEntries.Count.ToString(), "asdf"); //Crude_Entries crude = CreateNewCrudeEntries(); //insertCrudeEntry(crude); //CreateTable(crude.ce_id); //InsertObjectIntoTable(crude.ce_id, calculatedEntries); //MessageBox.Show("Done", "ai"); }
public override string ToString() { return($"Від {DateTimeFrom.ToString("dd.MM.yy")} до {DateTimeTill.ToString("dd.MM.yy")}"); }