private void BtnHome_Click(object sender, RoutedEventArgs e) { this.Visibility = System.Windows.Visibility.Collapsed; if (Login.role == "Aprover") { AproverForm ap = new AproverForm((obj.GetIdeaInfo().Where(x => x.PendingWith == Login.Name)).ToList()); ap.ShowDialog(); } if (Login.role == "Student") { MyIdea MyIdea = new MyIdea(); MyIdea.ShowDialog(); } }
private void BtnAprove_Click(object sender, RoutedEventArgs e) { String status = null; int i = 0; if (Ideainfo.status == "Submited") { status = "level1"; i = 1; } if (Ideainfo.status == "level1") { status = "level2"; i = 2; } if (TxtComments.Text == "") { MessageBox.Show("Enter Comments"); return; } obj.updatesatus(id, TxtComments.Text, status, i); MessageBox.Show("Approved"); IEnumerable <string> maillist = obj.GetIdeaInfo().Where(x => x.ideaid == id).Select(x => x.Mailtoid); String Data = "Dear Approver," + Environment.NewLine + "Below idea has been submitted by " + Login.Name + " and is awaiting your approvals." + Environment.NewLine + "Please review and provide your feedback." + Environment.NewLine + "Idea# " + id + Environment.NewLine + " Idea Desc: " + Ideainfo.Title; foreach (string temp in maillist) { if (Ideainfo.status == "Submited") { obj.SendMail(temp, Data); } } this.Visibility = System.Windows.Visibility.Collapsed; AproverForm ap = new AproverForm((obj.GetIdeaInfo().Where(x => x.PendingWith == Login.Name)).ToList()); ap.ShowDialog(); }
private void BtnLogin1_Click(object sender, RoutedEventArgs e) { if (((TxtUserName.Text).ToString()).Trim() == "") { MessageBox.Show("Enter UserName"); return; } if (((PwdPassword.Password).ToString()).Trim() == "") { MessageBox.Show("Enter Password"); return; } int res = Obj.LoginCheck(TxtUserName.Text, PwdPassword.Password); // MessageBox.Show(res); if (res > 0) { if (Login.role == "Admin") { Admin Adminwindow = new Admin(); this.Visibility = Visibility.Collapsed; Adminwindow.ShowDialog(); } if (Login.role == "Student") { MyIdea IdeaWindow = new MyIdea(); this.Visibility = Visibility.Collapsed; IdeaWindow.ShowDialog(); } if (Login.role == "Aprover") { IEnumerable <IdeaRecords> result = from Ideas in IdeasCollection where Ideas.PendingWith == Login.Name select Ideas; AproverForm ideaswindow = new AproverForm(result.ToList()); this.Visibility = System.Windows.Visibility.Collapsed; ideaswindow.ShowDialog(); } } }
private void BtnReject_Click(object sender, RoutedEventArgs e) { String status = null; int i = 0; if (Ideainfo.comment1 == "") { i = 1; status = "Rejected"; } else { i = 2; status = "Rejected"; } obj.updatesatus(id, TxtComments.Text, status, i); MessageBox.Show("Rejected"); this.Visibility = System.Windows.Visibility.Collapsed; AproverForm ap = new AproverForm((obj.GetIdeaInfo().Where(x => x.PendingWith == Login.Name)).ToList()); ap.ShowDialog(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { this.Visibility = System.Windows.Visibility.Collapsed; if (Login.role == "Aprover") { AproverForm ap = new AproverForm((obj.GetIdeaInfo().Where(x => x.PendingWith == Login.Name)).ToList()); ap.ShowDialog(); } if (Login.role == "Student") { if (Login.Link == "Total") { // this.Visibility = System.Windows.Visibility.Collapsed; IEnumerable <IdeaRecords> result = from Ideas in obj.GetIdeaInfo() select Ideas; IdeasRecords ideaswindow = new IdeasRecords(result.ToList()); ideaswindow.ShowDialog(); } if (Login.Link == "Self") { // this.Visibility = System.Windows.Visibility.Collapsed; IEnumerable <IdeaRecords> result = from Ideas in obj.GetIdeaInfo() where Ideas.Name == Login.Name select Ideas; IdeasRecords ideaswindow = new IdeasRecords(result.ToList()); ideaswindow.ShowDialog(); } if (Login.Link == "Course") { // this.Visibility = System.Windows.Visibility.Collapsed; IEnumerable <IdeaRecords> result = from Ideas in obj.GetIdeaInfo() where Ideas.Course == Login.CourseName select Ideas; IdeasRecords ideaswindow = new IdeasRecords(result.ToList()); ideaswindow.ShowDialog(); } } }