Ejemplo n.º 1
0
        private void BtnBack_Click(object sender, RoutedEventArgs e)
        {
            this.Visibility = System.Windows.Visibility.Collapsed;
            MyIdea my = new MyIdea();

            my.ShowDialog();
        }
        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();
            }
        }
Ejemplo n.º 3
0
        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();
                }
            }
        }
Ejemplo n.º 4
0
        private void BtnSubmitIdea_Click(object sender, RoutedEventArgs e)
        {
            Ideas rec = new Ideas();

            // byte[] data=null;
            rec.Title            = TxtTitle.Text;
            rec.Description      = TxtDesc.Text;
            rec.category         = CmbCategory.Text;
            rec.currentprocess   = TxtCurrentProcess.Text;
            rec.Proposedsolution = TxtProposedSolution.Text;
            rec.Benfits          = TxtBenfits.Text;
            rec.otherInformation = TxtOtherInformations.Text;
            rec.status           = "Submited";
            rec.createdon        = DateTime.Now;


            if (Documentid > 0)
            {
                rec.documentid = Documentid;
            }

            if (TxtTitle.Text == "")
            {
                MessageBox.Show("Enter Title");
                return;
            }
            if (TxtDesc.Text == "")
            {
                MessageBox.Show("Enter Description");
                return;
            }
            //if (CmbCategory.SelectedValue == null)
            //{
            //    MessageBox.Show("Select category");
            //    return;
            //}
            if (TxtCurrentProcess.Text == "")
            {
                MessageBox.Show("Select CurrentProcess");
                return;
            }
            if (TxtProposedSolution.Text == "")
            {
                MessageBox.Show("Select PoposedSolution");
                return;
            }
            if (TxtBenfits.Text == "")
            {
                MessageBox.Show("Select Benfits");
                return;
            }

            Ideaid = Obj.CreateIdea(rec);
            MessageBox.Show("Idea " + Ideaid + " Created");
            Ideas IdeaRec = Obj.IdeaDisplay(Ideaid);



            IEnumerable <string> maillist = Obj.GetIdeaInfo().Where(x => x.ideaid == Ideaid).Select(x => x.Mailtoid);

            String Data = "Dear Approver," + Environment.NewLine
                          + "Below idea submitted by " + Login.Name + " is awaiting your approvals." + Environment.NewLine
                          + "Please review and provide your feedback." + Environment.NewLine
                          + "Idea#       " + Ideaid + Environment.NewLine
                          + " Idea Desc:  " + rec.Title;

            foreach (string temp in maillist)
            {
                Obj.SendMail(temp, Data);
            }


            this.Visibility = System.Windows.Visibility.Collapsed;
            MyIdea my = new MyIdea();

            my.ShowDialog();
        }