public Juror GetSummonsRecipientLogin(string socialLastFour, int juryId)
        {
            DataCommand command = new DataCommand("EXEC spGetSummonsRecipientLogin '" + socialLastFour + "', " + juryId);

            SqlDataReader dataReader = command.ExecuteReader();

            Juror juror = dataReader.Read() ? Juror.GetJuror(dataReader.GetInt32(0)) : null;

            command.Close();

            return(juror);
        }
示例#2
0
        private void doneButton_Click(object sender, EventArgs e)
        {
            foreach (Control c in jurorButtonPanel.Controls)
            {
                Button b = c as Button;


                Juror j = TheCase.TheJurors[Convert.ToInt16(b.Text) - 1];
                if (inGroupMode)
                {
                    if (b.BackColor == Color.Gray)
                    {
                        j.TheInfo.Add(new Info((GroupQuestion), "True"));
                    }
                    else
                    {
                        j.TheInfo.Add(new Info(GroupQuestion, "False"));
                    }
                }

                if (j.TheLikeState == Juror.LikeState.Like)
                {
                    b.BackColor = Color.LightBlue;
                }
                if (j.TheLikeState == Juror.LikeState.Dislike)
                {
                    b.BackColor = Color.LightCoral;
                }
                if (j.TheLikeState == Juror.LikeState.Neutral)
                {
                    b.BackColor = SystemColors.Control;
                }
                c.Tag = 0;
            }
            doneButton.Hide();
            caseNameLabel.Text     = TheCase.Name;
            caseNameLabel.Enabled  = true;
            sidePanel.Enabled      = true;
            inGroupMode            = false;
            caseNameLabel.Location = new Point((int)(Width * .5), (int)(Height * .08));
            caseNameLabel.Click   += caseNameLabel_Click;
            holderPanel.Controls.Clear();
            holderPanel.Hide();
            typeComboBox.Text = "";
            inSearchMode      = false;
            numberOfSearchs   = 0;
            sbutton.Text      = "Search";
            searchCancelButton.Show();
        }
示例#3
0
        private Juror MapRowToJuror(SqlDataReader reader)
        {
            Juror juror = new Juror
            {
                ID            = Convert.ToInt32(reader["rosterID"]),
                firstName     = Convert.ToString(reader["firstName"]),
                lastName      = Convert.ToString(reader["lastName"]),
                streetAddress = Convert.ToString(reader["streetAddress"]),
                city          = Convert.ToString(reader["city"]),
                state         = Convert.ToString(reader["stateABV"]),
                zipcode       = Convert.ToInt32(reader["zipcode"]),
            };

            return(juror);
        }
示例#4
0
        //[AuthorizationFilter("User")]
        public IActionResult ListPool(NumJuror model)
        {
            int        numberOfJurors = model.numberOfJurors;
            JurySQLDAO jurySQLDAO     = new JurySQLDAO();
            JuryPool   jury           = new JuryPool();
            int        rows           = jurySQLDAO.GetRows();
            RandomID   randomID       = new RandomID();

            for (int i = 0; i < numberOfJurors; i++)
            {
                Juror juror = new Juror();
                juror = jurySQLDAO.GetJuror(randomID.getRandomID(rows));
                jury.Pool.Add(juror);
            }

            return(View(jury));
        }
        public object GetSummonsRecipientLogin(string socialLastFour, int jurorId)
        {
            try {
                DataCommand command = new DataCommand("spGetSummonsRecipientLogin");
                command.AddParameter("@socialLastFour", socialLastFour);
                command.AddParameter("@jurorId", jurorId);

                DataReader dataReader = command.ExecuteReader();

                object juror = dataReader.Read() ? (object)Juror.GetJuror((int)dataReader.GetInteger("JurorID")) : (object)Json.Nothing;

                command.Close();

                return(juror);
            } catch (Exception e) {
                return(Error.LogError(_logger, e));
            }
        }
示例#6
0
        public IActionResult ListPool(int numberOfJurors)
        {
            //added temp data to ensure working code
            //int numberOfJurors = numJuror.numberOfJurors;
            JurySQLDAO jurySQLDAO = new JurySQLDAO(); numberOfJurors = 7;
            JuryPool   jury       = new JuryPool();
            int        rows       = jurySQLDAO.GetRows();
            RandomID   randomID   = new RandomID();

            for (int i = 0; i < numberOfJurors; i++)
            {
                Juror juror = new Juror();
                juror = jurySQLDAO.GetJuror(randomID.getRandomID(rows));
                jury.Pool.Add(juror);
            }

            return(View(jury));
        }
示例#7
0
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter the number of Jurors need for this pool:");
            string temp = Console.ReadLine();
            int    numberOfJurors;
            bool   success = Int32.TryParse(temp, out numberOfJurors);

            if (success)
            {
                numberOfJurors = int.Parse(temp);

                JuryPool   juryPool     = new JuryPool();
                JurySQLDAO juryDAO      = new JurySQLDAO();
                RandomID   randomID     = new RandomID();
                int        numberOfRows = juryDAO.GetRows();

                for (int i = 0; i < numberOfJurors; i++)
                {
                    Juror juror = new Juror();
                    juror = juryDAO.GetJuror(randomID.getRandomID(numberOfRows));
                    juryPool.Pool.Add(juror);
                }
                Console.WriteLine();
                Console.WriteLine("Jury Pool:");
                Console.WriteLine();

                foreach (Juror juror in juryPool.Pool)
                {
                    Console.WriteLine(juror.firstName + " " + juror.lastName);
                    Console.WriteLine(juror.streetAddress);
                    Console.WriteLine(juror.city + ", " + juror.state + " " + juror.zipcode);
                    Console.WriteLine();
                }
            }
            else
            {
                Console.WriteLine("Please enter a valid whole number");
            }



            Console.ReadLine();
        }
示例#8
0
        public void DeleteJuror(Juror juror)
        {
            try
            {
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    SqlCommand cmd = new SqlCommand(DeleteJurorSQL, conn);
                    cmd.Parameters.AddWithValue("@id", juror.ID);

                    cmd.ExecuteNonQuery();

                    return;
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
示例#9
0
        private void cancelButton_Click(object sender, EventArgs e)
        {
            foreach (Control c in jurorButtonPanel.Controls)
            {
                Button b = c as Button;


                Juror j = TheCase.TheJurors[Convert.ToInt16(b.Text) - 1];

                if (j.TheLikeState == Juror.LikeState.Like)
                {
                    b.BackColor = Color.LightBlue;
                }
                if (j.TheLikeState == Juror.LikeState.Dislike)
                {
                    b.BackColor = Color.LightCoral;
                }
                if (j.TheLikeState == Juror.LikeState.Neutral)
                {
                    b.BackColor = SystemColors.Control;
                }
                doneButton.Hide();
                caseNameLabel.Text    = TheCase.Name;
                caseNameLabel.Enabled = true;
                sidePanel.Enabled     = true;
                inGroupMode           = false;
                inSearchMode          = false;
                textBox1.Text         = "";
            }
            caseNameLabel.Location = new Point((int)(Width * .5), (int)(Height * .08));
            holderPanel.Controls.Clear();
            holderPanel.Hide();
            ((TextBox)groupQuestonPanel.Controls[3]).Text = "";
            caseNameLabel.Click   += caseNameLabel_Click;
            typeComboBox.Text      = "";
            questionComboBox1.Text = "";
            answerComboBox.Text    = "";
            searchLabel.Text       = "Search Type";
        }
示例#10
0
        private void SearchButtons(string question, string answer, Info.theType type)
        {
            int max = 0;

            foreach (Control c in jurorButtonPanel.Controls)
            {
                Button b = c as Button;

                Juror j = TheCase.TheJurors[Convert.ToInt16(b.Text) - 1];
                if (j.MeetsSearchCriteria(question, answer, type))
                {
                    int i = (int)c.Tag;
                    b.BackColor = colors[i + numberOfSearchs];
                    b.Tag       = i + 1;
                    if (i > max)
                    {
                        max = i;
                    }
                }
            }

            //for (int n = max; n >= 0; n--)
            //    searchButtons[n].Visible = true;
        }
示例#11
0
        void theFormShowed(object sender, EventArgs e)
        {
            List <int> ins = new List <int>();

            if (inSearchMode)
            {
                foreach (Control b in jurorButtonPanel.Controls)
                {
                    ins.Add((int)b.Tag);
                }
            }
            jurorButtonPanel.Controls.Clear();
            int buttonWidth  = (int)(Math.Sqrt((jurorButtonPanel.Width * jurorButtonPanel.Height) / TheCase.NumberOfJurors) * .8);
            int buttonHeight = (int)(Math.Sqrt((jurorButtonPanel.Width * jurorButtonPanel.Height) / TheCase.NumberOfJurors) * .8);

            for (int i = 1; i < TheCase.NumberOfJurors + 1; i++)
            {
                if (!TheCase.TheJurors[i - 1].Deleted)
                {
                    Button theButton = new Button();
                    theButton.Text   = i.ToString();
                    theButton.Height = buttonHeight;
                    theButton.Width  = buttonWidth;
                    if (inSearchMode)
                    {
                        theButton.Tag = ins[0];
                        if (ins[0] + numberOfSearchs == 0)
                        {
                            theButton.BackColor = colors[0];
                        }
                        else
                        {
                            theButton.BackColor = colors[ins[0] + numberOfSearchs - 1];
                        }
                        ins.RemoveAt(0);
                    }
                    else
                    {
                        theButton.Tag       = 0;
                        theButton.BackColor = SystemColors.Control;
                    }
                    theButton.Click += new EventHandler(JurorButtonClicked);
                    jurorButtonPanel.Controls.Add(theButton);
                }
            }

            if (TheCase == null || TheCase.TheJurors == null)
            {
                return;
            }
            if (!inSearchMode)
            {
                foreach (Control b in jurorButtonPanel.Controls)
                {
                    Button button = b as Button;
                    b.Tag = 0;
                    Juror j = TheCase.TheJurors[Convert.ToInt16(button.Text) - 1];
                    if (j.TheLikeState == Juror.LikeState.Like)
                    {
                        b.BackColor = Color.LightBlue;
                    }
                    if (j.TheLikeState == Juror.LikeState.Dislike)
                    {
                        b.BackColor = Color.LightCoral;
                    }
                    if (j.TheLikeState == Juror.LikeState.Neutral)
                    {
                        b.BackColor = SystemColors.Control;
                    }
                }
            }
        }
示例#12
0
 public IActionResult DeleteJuror(Juror juror)
 {
     adminSQLDAO.DeleteJuror(juror);
     return(View());
 }
示例#13
0
 public IActionResult CreateJuror(Juror juror)
 {
     adminSQLDAO.CreateJuror(juror);
     return(View());
 }