private void ReferenceToolStripMenuItem_Click(object sender, EventArgs e) { ///Reference letter Frm_SelectUserToSendLetter frm_SU = new Frm_SelectUserToSendLetter(); frm_SU.btn_SendLetter.Text = "Reference letter"; frm_SU.labelX1.Text = "Reference letter form"; frm_SU.GetLetterID = Convert.ToInt32(dgv_showAllRecievedReferenceLetters.CurrentRow.Cells["LetterID"].Value); frm_SU.IsErja = 1; frm_SU.GetReplyLetter_User = Convert.ToInt32(dgv_showAllRecievedReferenceLetters.CurrentRow.Cells["userID_creator"].Value); frm_SU.ShowDialog(); }
private void mnu_erja_Click(object sender, EventArgs e) { var query_accsess = (from UA in database.UsereAccesses where UA.userID == PublicVariable.gUserId where UA.SystemPardID == 29 select UA).ToList(); if (query_accsess.Count == 0) { MessageBox.Show("You do not have access to this section"); } ///Reference letter Frm_SelectUserToSendLetter frm_SU = new Frm_SelectUserToSendLetter(); frm_SU.btn_SendLetter.Text = "Reference letter"; frm_SU.labelX1.Text = "Reference form"; frm_SU.GetLetterID = Convert.ToInt32(dgv_showAllRecievedLetters.CurrentRow.Cells["LetterID"].Value); frm_SU.IsErja = 1; frm_SU.GetReplyLetter_User = Convert.ToInt32(dgv_showAllRecievedLetters.CurrentRow.Cells["userID_sender"].Value); frm_SU.ShowDialog(); }
private void btn_SendLetter_Click(object sender, EventArgs e) { int item = dgv_ShowDraft.SelectedCells.Count; if (item>0) { int getReplyLetterID; int getcreatorLetter; if (Convert.ToInt32(dgv_ShowDraft.CurrentRow.Cells["LetterT"].Value) == 2) { getReplyLetterID = Convert.ToInt32(dgv_ShowDraft.CurrentRow.Cells["ReplyLetterID"].Value); var query = (from L in database.Letters where L.LetterId == getReplyLetterID select L).ToList(); if (query.Count> 0) { getcreatorLetter = query[0].userID; Frm_SelectUserToSendLetter frm_SU = new Frm_SelectUserToSendLetter(); frm_SU.GetLetterID = Convert.ToInt32(dgv_ShowDraft.CurrentRow.Cells["LetterID"].Value); frm_SU.GetReplyLetter_User = getcreatorLetter; frm_SU.IsReply = 1; frm_SU.ShowDialog(); } } else { Frm_SelectUserToSendLetter frm_SU = new Frm_SelectUserToSendLetter(); frm_SU.GetLetterID = Convert.ToInt32(dgv_ShowDraft.CurrentRow.Cells["LetterID"].Value); frm_SU.ShowDialog(); } ShowDraft(searchCondition()); } else { MessageBox.Show("To send a letter, select a letter from the draft list."); } }