public async Task <int> UpdateGroupNo(GroupNumber groupNumber, int id) { GroupNumber g = _context.GroupNumbers.Where(e => e.Id == id).First(); g.GroupNum = groupNumber.GroupNum; return(await _context.SaveChangesAsync()); }
private async void btnSave_Click(object sender, RoutedEventArgs e) { GroupNumberDataService groupNumberDataService = new GroupNumberDataService(new EntityFramework.TimetableManagerDbContext()); if (textBoxgrpNo.Text != "") { if (isEditState) { isEditState = false; groupNumber.GroupNum = textBoxgrpNo.Text; await groupNumberDataService.UpdateGroupNo(groupNumber, groupNumber.Id); } else { GroupNumber groupNumber = new GroupNumber { GroupNum = textBoxgrpNo.Text }; await groupNumberDataService.AddGroupNumber(groupNumber); } textBoxgrpNo.Clear(); } else { MessageBox.Show("Insert a Group Number!!"); } this.GroupNumberDataList.Clear(); _ = load(); }
public override int GetHashCode() { int hash = 1; if (booking_ != null) { hash ^= Booking.GetHashCode(); } if (GroupName.Length != 0) { hash ^= GroupName.GetHashCode(); } if (GroupNumber.Length != 0) { hash ^= GroupNumber.GetHashCode(); } if (GroupContactName.Length != 0) { hash ^= GroupContactName.GetHashCode(); } if (GroupType != 0) { hash ^= GroupType.GetHashCode(); } if (groupProperty_ != null) { hash ^= GroupProperty.GetHashCode(); } hash ^= quantities_.GetHashCode(); return(hash); }
public override int GetHashCode() { int hash = 1; if (entityId_ != null) { hash ^= EntityId.GetHashCode(); } if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (GroupType != 0) { hash ^= GroupType.GetHashCode(); } if (GroupNumber.Length != 0) { hash ^= GroupNumber.GetHashCode(); } if (creditLimit_ != null) { hash ^= CreditLimit.GetHashCode(); } if (Active != false) { hash ^= Active.GetHashCode(); } if (contactInfo_ != null) { hash ^= ContactInfo.GetHashCode(); } return(hash); }
public void SetLiveVideos() { if (GroupNumber.Equals("0") || WeekNumber.Equals("0")) { return; } _serviceAgent.SetLiveVideos(GroupNumber, WeekNumber, SelectedVideoInput, SelectedHomeTeams, SelectedAwayTeams); }
public static List <Student> GroupStudsByGroup(List <Student> students, GroupNumber wantedGroup) { var studentsWantedGroup = (from stud in students where stud.Group.GroupNumber == wantedGroup orderby stud.FirstName select stud).ToList(); return(studentsWantedGroup); }
private async Task LoadGroupForEdit(int id) { GroupNumberDataService groupNumberDataService = new GroupNumberDataService(new EntityFramework.TimetableManagerDbContext()); groupNumber = await groupNumberDataService.GetGroupNoById(id); textBoxgrpNo.Text = groupNumber.GroupNum; isEditState = true; }
public int CompareTo(object obj) { DiceGroup dg = obj as DiceGroup; if (dg == null) { return(1); } int compare = Group.CompareTo(dg.Group); return((compare == 0) ? GroupNumber.CompareTo(dg.GroupNumber) : compare); }
public async Task <bool> AddGroupNumber(GroupNumber groupNumber) { _context.GroupNumbers.Add(groupNumber); int result = await _context.SaveChangesAsync(); if (result > 0) { return(true); } return(false); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { GroupNumber grpno = (GroupNumber)dataGridgrpNo.SelectedItem; GroupNumberDataService groupNumberData = new GroupNumberDataService(new EntityFramework.TimetableManagerDbContext()); groupNumberData.DeleteGroupNumbers(grpno.Id).ContinueWith(result => { MessageBox.Show("Deleted"); }); _ = GroupNumberDataList.Remove(grpno); }
public async Task load() { GroupNumberDataService groupNumberDataService = new GroupNumberDataService(new EntityFramework.TimetableManagerDbContext()); GroupNumberList = await groupNumberDataService.GetGroupNumbers(); GroupNumberList.ForEach(e => { GroupNumber l = new GroupNumber(); l.Id = e.Id; l.GroupNum = e.GroupNum; GroupNumberDataList.Add(l); }); }
//constructor public StimSweeper(SweepParameters parameters, SummitSystem theSummit, GroupNumber groupNum, string quitKey) { //assign all values m_sweepParameters = parameters; m_currentAmp = m_sweepParameters.ampValues[0]; m_currentPulseWidth = m_sweepParameters.pulseWidthValues[0]; m_currentFreq = m_sweepParameters.freqValues[0]; m_stimPaused = false; m_summit = theSummit; m_groupNum = groupNum; m_stopSweep = false; m_stimOutOfRangeFlag = false; m_sweepFinished = true; m_quitKey = quitKey; }
public int CompareTo(Location other) { if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } var bookNumberComparison = BookNumber.CompareTo(other.BookNumber); if (bookNumberComparison != 0) { return(bookNumberComparison); } var sectionNumberComparison = SectionNumber.CompareTo(other.SectionNumber); if (sectionNumberComparison != 0) { return(sectionNumberComparison); } // Non-exact locations sort after exact ones if (!other.Exact) { return(1); } if (!Exact) { return(-1); } var groupNumberComparison = GroupNumber.CompareTo(other.GroupNumber); if (groupNumberComparison != 0) { return(groupNumberComparison); } return(WordNumber.CompareTo(other.WordNumber)); }
private async void Save() { SaveLabel.Focus(); if (GroupNumber.Text.Equals(string.Empty)) { GroupNumber.Focus(); BadGroup.BorderBrush = Brushes.Red; BadLabel.Content = "Заполните обязательные поля"; BadLabel.Visibility = Visibility.Visible; return; } var group_number = GroupNumber.Text; if (_group != 0) { if (group_number == this.group_number) { this.Close(); return; } } if (repository.GetGroup(GroupNumber.Text) != null) { GroupNumber.Focus(); BadLabel.Content = "Группа с таким номером уже существует"; BadLabel.Visibility = Visibility.Visible; return; } repository.SaveGroup(new Group { GroupID = _group, GroupNumber = group_number }); await this.ShowMessageAsync(string.Empty, "Group saved."); GlobalVars.SaveFlag = true; this.Close(); }
public void ChangeColors() { const string DarkGreen = "#FF006400"; const string DarkRed = "#FF8B0000"; string group = "-" + GroupNumber; const string reset = "-0"; EnableButton = !WeekNumber.Equals("0") && !GroupNumber.Equals("0"); if (group.Equals(reset)) { ResetColor(); return; } for (int i = 0; i <= 15; i++) { if (SelectedVideoInput[i] != null) { Brushes[i] = SelectedVideoInput[i].Contains(@group) ? DarkGreen : DarkRed; } } }
public EditGroup() { InitializeComponent(); SaveBt.MouseDown += GlobalVars.mMouseDown; CancelBt.MouseDown += GlobalVars.mMouseDown; SaveBt.MouseUp += GlobalVars.mMouseUp; CancelBt.MouseUp += GlobalVars.mMouseUp; SaveBt.MouseLeave += GlobalVars.mMouseLeave; CancelBt.MouseLeave += GlobalVars.mMouseLeave; SaveBt.MouseUp += mMouseUp; CancelBt.MouseUp += mMouseUp; GroupNumber.TextChanged += mTextChanged; GroupNumber.PreviewKeyDown += (sender, e) => { if (e.Key == Key.Enter) { Save(); } }; BadLabel.Visibility = Visibility.Hidden; this.Title = _group == 0 ? "New Group" : "Edit Group"; if (_group != 0) { group_number = repository.GetGroupNumber(_group); GroupNumber.Text = group_number; } GlobalVars.SaveFlag = false; GroupNumber.Focus(); }
// TODO: Add methods that will be called by the view public void GetTeams() { EnableButton = !WeekNumber.Equals("0") && !GroupNumber.Equals("0"); SelectedAwayTeams = _serviceAgent.GetSelecetedAwayTeams(WeekNumber); SelectedHomeTeams = _serviceAgent.GetSelectedHomeTeams(WeekNumber); }
private void EditButton_Click(object sender, RoutedEventArgs e) { GroupNumber ys = (GroupNumber)dataGridgrpNo.SelectedItem; _ = LoadGroupForEdit(ys.Id); }
/// <summary> /// Gets the Stim parameters for a Group /// </summary> /// <param name="theSummit">SummitSystem for making the api call to INS</param> /// <param name="group">Group number to get the data</param> /// <returns>StimParameterModel that contains stim amp, stim rate and pulse width</returns> public Tuple <bool, string, TherapyGroup> GetTherapyDataForGroup(SummitSystem theSummit, GroupNumber group) { TherapyGroup insStateGroup = null; if (theSummit == null || theSummit.IsDisposed) { return(Tuple.Create(false, "Summit Disposed", insStateGroup)); } try { //Get the data from the api bufferInfo = theSummit.ReadStimGroup(group, out insStateGroup); if (bufferInfo.RejectCode != 0 || insStateGroup == null) { _log.Warn("Could not read stim group from Medtronic api call"); return(Tuple.Create(false, "Could not read stim group from Medtronic api call", insStateGroup)); } } catch (Exception e) { _log.Error(e); return(Tuple.Create(false, "Error reading stim group.", insStateGroup)); } return(Tuple.Create(true, "Success", insStateGroup)); }
public override string ToString() { return(GroupNumber.ToString() + "." + OperationNumber.ToString()); }
/// <summary> /// Gets the stim parameters based on group from the actual API /// </summary> /// <param name="theSummit">SummitSystem for making the API call to INS</param> /// <param name="groupNumber">Group number corresponding to which group we want to get stim parameters from such as Group0, Group1, etc</param> /// <returns>StimParameterModel that contains stim amp, stim rate and pulse width</returns> private StimParameterModel GetStimParameterModel(SummitSystem theSummit, GroupNumber groupNumber, int program) { if (theSummit == null || theSummit.IsDisposed) { return(null); } TherapyGroup insStateGroup = null; AmplitudeLimits ampLimits = null; try { int counter = 5; do { bufferInfo = theSummit.ReadStimGroup(groupNumber, out insStateGroup); counter--; } while ((insStateGroup == null || bufferInfo.RejectCode != 0) && counter > 0); if (bufferInfo.RejectCode != 0 && counter == 0) { _log.Warn("Could not read stim group from Medtronic api call"); } } catch (Exception e) { _log.Error(e); } try { int counter = 5; do { bufferInfo = theSummit.ReadStimAmplitudeLimits(groupNumber, out ampLimits); counter--; } while ((insStateGroup == null || bufferInfo.RejectCode != 0) && counter > 0); if (bufferInfo.RejectCode != 0 && counter == 0) { _log.Warn("Could not read amp limits from Medtronic api call"); } } catch (Exception e) { _log.Error(e); } int pulseWidthValue = -1; double rateValue = -1; double ampValue = -1; try { //parse the data to get the pulsewidth if (insStateGroup != null) { pulseWidth = insStateGroup.Programs[program].PulseWidthInMicroseconds.ToString(); stimRate = insStateGroup.RateInHz.ToString(); stimAmp = insStateGroup.Programs[program].AmplitudeInMilliamps.ToString(); stimElectrode = FindStimElectrodes(insStateGroup, program); electrodes = insStateGroup?.Programs[program]?.Electrodes; pulseWidthValue = insStateGroup.Programs[program].PulseWidthInMicroseconds; rateValue = insStateGroup.RateInHz; ampValue = insStateGroup.Programs[program].AmplitudeInMilliamps; } } catch (Exception e) { _log.Error(e); } //Set the Model with these values and return model if (rateValue == -1 || ampValue == -1 || pulseWidthValue == -1) { StimParameterModel StimParameterModel = new StimParameterModel(pulseWidth, stimRate, stimAmp, stimElectrode, electrodes, insStateGroup, ampLimits); return(StimParameterModel); } else { StimParameterModel StimParameterModel = new StimParameterModel(pulseWidth, stimRate, stimAmp, stimElectrode, electrodes, insStateGroup, ampLimits, rateValue, ampValue, pulseWidthValue); return(StimParameterModel); } }
public Group(GroupNumber groupNumber) { this.GroupNumber = groupNumber; this.DepartmentName = departments[(int)groupNumber]; }
public static List<Student> Students(this List<Student> student, string name, string lastName, string facultyNumber, string tel, string email, List<int> mark, GroupNumber group) { Student addingStudent = new Student { FirstName = name, LastName = lastName, FacultyNumber = facultyNumber, Tel = tel, Email = email, Mark = mark, Group = group }; student.Add(addingStudent); return student; }
/// <summary> /// either returns the group number if one is set or a random string if it isn't /// </summary> /// <returns></returns> private string PrepareID() { return(ID + "_" + (GroupNumber > 0 ? GroupNumber.ToString() : Guid.NewGuid().ToString().Substring(0, 6))); }
/// <summary> /// Determines if two SocialSecurityNumber objects are equal. /// </summary> /// <param name="other">The other number.</param> /// <returns><c>true</c> if equal, <c>false</c> otherwise.</returns> public bool Equals(SocialSecurityNumber other) { return(AreaNumber.Equals(other.AreaNumber) && GroupNumber.Equals(other.GroupNumber) && SerialNumber.Equals(other.SerialNumber)); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data /// structures like a hash table. /// </returns> public override int GetHashCode() { return(AreaNumber.GetHashCode() + GroupNumber.GetHashCode() + SerialNumber.GetHashCode()); }
public override int GetHashCode() { return(GroupNumber.GetHashCode() ^ OperationNumber.GetHashCode()); }
public static List <Student> GroupStudsByGroupMethods(List <Student> students, GroupNumber wantedGroup) { var studsWantedGr = students .Where(stud => stud.Group.GroupNumber == wantedGroup) .OrderBy(stud => stud.FirstName) .ToList(); return(studsWantedGr); }