private PersonalNote BuildPersonalNote() { var phone = new PersonalNote(); phone.Id = 1; phone.LastUpdatedBy = "Hank"; phone.LastUpdatedDate = DateTime.Now; return(phone); }
public async Task <PersonalNote> UpdatePersonalNote(PersonalNote Note) { var existingNote = await _context.PersonalNote.FindAsync(Note.IdNote); existingNote.Description = Note.Description; existingNote.LastModified = Note.LastModified; _context.PersonalNote.Update(existingNote); await _context.SaveChangesAsync(); return(Note); }
private PersonalNote[] GetPersonalNotes(DashboardModel model) { DataRow[] drs = model.GetPersonalNote(currUser.Username); PersonalNote[] notes = new PersonalNote[drs.Count()]; int i = 0; foreach (DataRow dr in drs) { notes[i++] = new PersonalNote(Int32.Parse(dr["noteId"].ToString()), dr["note"].ToString(), Convert.ToDateTime(dr["date"])); } return(notes); }
private PersonalNote BuildPersonalNote() { var personalNote = new PersonalNote(); personalNote.Id = 1; personalNote.Person = new Person() { Id = 1 }; personalNote.Description = "personal note description"; personalNote.StartDate = DateTime.Now; personalNote.DateEnd = DateTime.Now.AddMonths(12); personalNote.LastUpdatedBy = "Hank"; personalNote.LastUpdatedDate = DateTime.Now; personalNote.Note = "notes for personal note"; return(personalNote); }
public void UpdateWindow(int rowIndex) { try { int id = int.Parse(this.dGrid.Rows[rowIndex].Cells[PersonalNoteController.ID_INDEX].Value.ToString()); PersonalNote note = this.View_QueryResults .Where(x => x.Id == id) .FirstOrDefault(); this.lblId.Text = note.Id.ToString(); this.txtDescription.Text = note.Description; this.txtSubject.Text = note.Subject; } catch (ArgumentOutOfRangeException) { /*Skip*/ } catch (Exception ex) { throw ex; } }
private void btnSave_Click(object sender, EventArgs e) { PersonalNote note = new PersonalNote { System_Created = DateTime.Now, }; if (!string.IsNullOrEmpty(this.lblId.Text)) { note = this.View_QueryResults .Where(x => x.Id == int.Parse(this.lblId.Text)) .FirstOrDefault(); } note.Description = this.txtDescription.Text; note.SystemUpdateDateTime = DateTime.Now; note.Subject = this.txtSubject.Text; this.View_SaveRecord(note); this.View_QueryRecords(null); this.WindowInputChanges(ModifierState.Save); }
public async Task <PersonalNote> UpdatePersonalNote(PersonalNote Note) { return(await _personalNoteRepository.UpdatePersonalNote(Note)); }
public async Task <PersonalNote> SaveNewNote(PersonalNote note) { return(await _personalNoteRepository.SaveNewPersonalNote(note)); }
private void SendInvitation(ref GlobusHttpHelper httpHelper, string pageSource, string key1, string authToken1, string goback1, string firstName_Guest1, string lastName_Guest1) { try { Log("[ " + DateTime.Now + " ] => [ Start Sending Invitation With Username >>> " + _UserName + " ]"); string reason = string.Empty; string existingPositionIC = string.Empty; string greeting = string.Empty; string key = string.Empty; string firstName_Guest = string.Empty; string lastName_Guest = string.Empty; string authToken = string.Empty; string subject = string.Empty; string defaultText = string.Empty; string csrfToken = string.Empty; string sourceAlias = string.Empty; string goback = string.Empty; string userName = string.Empty; string userFirstName = string.Empty; string userLastName = string.Empty; string resultForUserDetails = FindTheUserName(pageSource); try { resultForUserDetails = resultForUserDetails.Substring(resultForUserDetails.IndexOf("alt="), resultForUserDetails.IndexOf("height") - resultForUserDetails.IndexOf("alt=")).Replace("alt=", string.Empty).Replace("/", string.Empty).Trim(); userFirstName = resultForUserDetails.Split(' ')[0].Replace("\"", string.Empty).Replace(",", string.Empty); userLastName = resultForUserDetails.Split(' ')[1].Replace("\"", string.Empty).Replace(",", string.Empty); } catch { } firstName_Guest = GetValue(pageSource, "firstName"); if (string.IsNullOrEmpty(firstName_Guest)) { firstName_Guest = firstName_Guest1; } lastName_Guest = GetValue(pageSource, "lastName"); if (string.IsNullOrEmpty(lastName_Guest)) { lastName_Guest = lastName_Guest1; } reason = GetValue(pageSource, "reason"); existingPositionIC = GetValue(pageSource, "existingPositionIC"); firstName_Guest = firstName_Guest.Replace(""", "\""); greeting = PersonalNote.Replace("<FIRSTNAME>", firstName_Guest).Replace("<PROFILEFIRSTNAME>", userFirstName).Trim(); ClsInviteMemberThroughProfileURL.Listgreetmsg = SpinnedListGenerator.GetSpinnedList(new List <string> { greeting }); string messagebody = string.Empty; messagebody = greeting; if (spintaxsearch) { try { messagebody = Listgreetmsg[RandomNumberGenerator.GenerateRandom(0, Listgreetmsg.Count - 1)]; } catch { } } key = GetValue(pageSource, "key"); if (string.IsNullOrEmpty(key)) { key = key1; } authToken = GetValue(pageSource, "authToken"); if (string.IsNullOrEmpty(authToken)) { authToken = authToken1; } subject = GetValue(pageSource, "subject"); defaultText = GetValue(pageSource, "defaultText"); csrfToken = GetValue(pageSource, "csrfToken"); sourceAlias = GetValue(pageSource, "sourceAlias"); goback = GetValue(pageSource, "goback").Replace("/", "%2F"); if (string.IsNullOrEmpty(goback)) { goback = goback1; } string postData = "existingPositionIC=&companyName.0=&titleIC.0=&startYearIC.0=&endYearIC.0=&schoolText=&schoolID=&existingPositionIB=&companyName.1=&titleIB.0=&startYearIB.0=&endYearIB.0=&reason=IF&otherEmail=&greeting=" + Uri.EscapeDataString(messagebody) + "&iweReconnectSubmit=Send+Invitation&key=" + key + "&firstName=" + firstName_Guest + "&lastName=" + lastName_Guest + "&authToken=" + authToken + "&authType=name&trk=prof-0-sb-connect-button&iweLimitReached=false&companyID.0=&companyID.1=&schoolID=&schoolcountryCode=&schoolprovinceCode=&javascriptEnabled=false&existingAssociation=Job+Openings%2C+Job+Leads+and+Job+Connections%21&subject=" + subject + "&defaultText=" + defaultText + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "&goback=" + goback + ""; string postResponse = httpHelper.postFormData(new Uri("http://www.linkedin.com/people/iweReconnectAction"), postData); if (postResponse.Contains("Invitation to") || postResponse.Contains("invitación a")) { Log("[ " + DateTime.Now + " ] => [ Invitation Sent successfully To >>> " + firstName_Guest + " With Username >>> " + _UserName + " ]"); #region Data Saved In CSV File if (!string.IsNullOrEmpty(firstName_Guest) || !string.IsNullOrEmpty(_UserName)) { try { string CSVHeader = "_UserName" + "," + "firstName_Guest" + "," + "lastName_Guest" + "," + "userFirstName" + "," + "userLastName" + ","; string CSV_Content = _UserName + "," + firstName_Guest + "," + lastName_Guest + "," + userFirstName + "," + userLastName + ","; // +TypeOfProfile + ","; CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LinkedininvitememberResultUrlData); //path_LinkedinSearchSearchByProfileURL); Log("[ " + DateTime.Now + " ] => [ Data Saved In CSV File ! ]"); } catch { } } #endregion int delay = new Random().Next(MinDelay, MaxDelay); Log("[ " + DateTime.Now + " ] => [ Delay >>> " + delay + " Seconds With Username >>> " + _UserName + " ]"); Log("[ " + DateTime.Now + " ] => [---------------------------------------------------------------------]"); Thread.Sleep(delay * 1000); } else if (postResponse.Contains("Request Error") || postResponse.Contains("Solicitud de error")) { Log("[ " + DateTime.Now + " ] => [ Request Error With Username >>> " + _UserName + " ]"); if (pageSource.Contains("Sorry, there was a problem processing your request. Please try again")) { Log("[ " + DateTime.Now + " ] => [ Sorry, there was a problem processing your request. Please try again With Username >>> " + _UserName + " ]"); } if (pageSource.Contains("You have no confirmed email addresses")) { Log("[ " + DateTime.Now + " ] => [ You have no confirmed email addresses With Username >>> " + _UserName + " ]"); } } else { if (pageSource.Contains("Sorry, there was a problem processing your request. Please try again")) { Log("[ " + DateTime.Now + " ] => [ Sorry, there was a problem processing your request. Please try again With Username >>> " + _UserName + " ]"); } else if (pageSource.Contains("You have no confirmed email addresses")) { Log("[ " + DateTime.Now + " ] => [ You have no confirmed email addresses With Username >>> " + _UserName + " ]"); } else { Log("[ " + DateTime.Now + " ] => [ Error in request With Username >>> " + _UserName + " ]"); } int delay = new Random().Next(MinDelay, MaxDelay); Log("[ " + DateTime.Now + " ] => [ Delay >>> " + delay + " Seconds With Username >>> " + _UserName + " ]"); Log("[ " + DateTime.Now + " ] => [---------------------------------------------------------------------]"); Thread.Sleep(delay * 1000); } } catch (Exception ex) { Console.WriteLine("Error >>> " + ex.StackTrace); } }
public async Task <IActionResult> UpdatePersonalNote(PersonalNote note) { await _personalNoteService.UpdatePersonalNote(note); return(StatusCode(200, note)); }
public async Task <IActionResult> SaveNewPersonalNote(PersonalNote note) { await _personalNoteService.SaveNewNote(note); return(StatusCode(201, note)); }