Example #1
0
        private void cancelbtn_Click(object sender, RoutedEventArgs e)
        {
            dt.Text        = null;
            h1.IsChecked   = false;
            h2.IsChecked   = false;
            h3.IsChecked   = false;
            h4.IsChecked   = false;
            h5.IsChecked   = false;
            h6.IsChecked   = false;
            h7.IsChecked   = false;
            h8.IsChecked   = false;
            h9.IsChecked   = false;
            h10.IsChecked  = false;
            h11.IsChecked  = false;
            h12.IsChecked  = false;
            h13.IsChecked  = false;
            h14.IsChecked  = false;
            h15.IsChecked  = false;
            h16.IsChecked  = false;
            h17.IsChecked  = false;
            h18.IsChecked  = false;
            h19.IsChecked  = false;
            h20.IsChecked  = false;
            h21.IsChecked  = false;
            h22.IsChecked  = false;
            h23.IsChecked  = false;
            h24.IsChecked  = false;
            initialTb.Text = "";

            n = new Hc();
        }
Example #2
0
        /// <summary>
        ///     Returns true if OrderRunnerChange instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderRunnerChange to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderRunnerChange other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Mb == other.Mb || Mb != null && Mb.SequenceEqual(other.Mb)) &&
                   (Uo == other.Uo || Uo != null && Uo.SequenceEqual(other.Uo)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (Hc == other.Hc || Hc != null && Hc.Equals(other.Hc)) &&
                   (FullImage == other.FullImage || FullImage != null && FullImage.Equals(other.FullImage)) &&
                   (Ml == other.Ml || Ml != null && Ml.SequenceEqual(other.Ml)));
        }
Example #3
0
        /// <summary>
        ///     Returns true if RunnerDefinition instances are equal
        /// </summary>
        /// <param name="other">Instance of RunnerDefinition to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RunnerDefinition other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((SortPriority == other.SortPriority || SortPriority != null && SortPriority.Equals(other.SortPriority)) &&
                   (RemovalDate == other.RemovalDate || RemovalDate != null && RemovalDate.Equals(other.RemovalDate)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (Hc == other.Hc || Hc != null && Hc.Equals(other.Hc)) &&
                   (AdjustmentFactor == other.AdjustmentFactor || AdjustmentFactor != null && AdjustmentFactor.Equals(other.AdjustmentFactor)) &&
                   (Bsp == other.Bsp || Bsp != null && Bsp.Equals(other.Bsp)) &&
                   (Status == other.Status || Status != null && Status.Equals(other.Status)));
        }
Example #4
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (SortPriority != null)
                {
                    hash = hash * 59 + SortPriority.GetHashCode();
                }

                if (RemovalDate != null)
                {
                    hash = hash * 59 + RemovalDate.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Hc != null)
                {
                    hash = hash * 59 + Hc.GetHashCode();
                }

                if (AdjustmentFactor != null)
                {
                    hash = hash * 59 + AdjustmentFactor.GetHashCode();
                }

                if (Bsp != null)
                {
                    hash = hash * 59 + Bsp.GetHashCode();
                }

                if (Status != null)
                {
                    hash = hash * 59 + Status.GetHashCode();
                }

                return(hash);
            }
        }
Example #5
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Mb != null)
                {
                    hash = hash * 59 + Mb.GetHashCode();
                }

                if (Uo != null)
                {
                    hash = hash * 59 + Uo.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Hc != null)
                {
                    hash = hash * 59 + Hc.GetHashCode();
                }

                if (FullImage != null)
                {
                    hash = hash * 59 + FullImage.GetHashCode();
                }

                if (Ml != null)
                {
                    hash = hash * 59 + Ml.GetHashCode();
                }

                return(hash);
            }
        }
 void XuliHighScore()
 {
     {
         if (ScoreManage.Score > int.Parse(d10.GetComponent <Text>().text))
         {
             HC._instance.SaveHighScore(Button.N, ScoreManage.Score); highscore = HC._instance.GetHighScore();
             SoundsController.PlaySound(soundsGame.cheer);
             high.SetActive(true);
             if (ScoreManage.Score >= int.Parse(d1.GetComponent <Text>().text))
             {
                 up.SetActive(true);
                 HighScore.ScoreBest = ScoreManage.Score;
                 Hbc.SetActive(true);
                 {
                     UploadHC();
                     Destroy(up, 2);
                 }
             }
             else
             {
                 HighScore.ScoreBest = highscore[0].score;
                 Hc.SetActive(true);
             }
         }
         else
         {
             if (ScoreManage.Score == 0 && checkreset.checkrss == 1)
             {
                 GameOver.SetActive(true);
                 HighScore.ScoreBest = 0;
                 Debug.Log("RESET"); checkreset.checkrss = 0;
             }
             else
             {
                 GameOver.SetActive(true);
                 HighScore.ScoreBest = highscore[0].score;
             }
         }
     }
 }
        /// <summary>
        ///     Returns true if RunnerChange instances are equal
        /// </summary>
        /// <param name="other">Instance of RunnerChange to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RunnerChange other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Tv == other.Tv || Tv != null && Tv.Equals(other.Tv)) &&
                   (Batb == other.Batb || Batb != null && Batb.SequenceEqual(other.Batb)) &&
                   (Spb == other.Spb || Spb != null && Spb.SequenceEqual(other.Spb)) &&
                   (Bdatl == other.Bdatl || Bdatl != null && Bdatl.SequenceEqual(other.Bdatl)) &&
                   (Trd == other.Trd || Trd != null && Trd.SequenceEqual(other.Trd)) &&
                   (Spf == other.Spf || Spf != null && Spf.Equals(other.Spf)) &&
                   (Ltp == other.Ltp || Ltp != null && Ltp.Equals(other.Ltp)) &&
                   (Atb == other.Atb || Atb != null && Atb.SequenceEqual(other.Atb)) &&
                   (Spl == other.Spl || Spl != null && Spl.SequenceEqual(other.Spl)) &&
                   (Spn == other.Spn || Spn != null && Spn.Equals(other.Spn)) &&
                   (Atl == other.Atl || Atl != null && Atl.SequenceEqual(other.Atl)) &&
                   (Batl == other.Batl || Batl != null && Batl.SequenceEqual(other.Batl)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (Hc == other.Hc || Hc != null && Hc.Equals(other.Hc)) &&
                   (Bdatb == other.Bdatb || Bdatb != null && Bdatb.SequenceEqual(other.Bdatb)));
        }
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Tv != null)
                {
                    hash = hash * 59 + Tv.GetHashCode();
                }

                if (Batb != null)
                {
                    hash = hash * 59 + Batb.GetHashCode();
                }

                if (Spb != null)
                {
                    hash = hash * 59 + Spb.GetHashCode();
                }

                if (Bdatl != null)
                {
                    hash = hash * 59 + Bdatl.GetHashCode();
                }

                if (Trd != null)
                {
                    hash = hash * 59 + Trd.GetHashCode();
                }

                if (Spf != null)
                {
                    hash = hash * 59 + Spf.GetHashCode();
                }

                if (Ltp != null)
                {
                    hash = hash * 59 + Ltp.GetHashCode();
                }

                if (Atb != null)
                {
                    hash = hash * 59 + Atb.GetHashCode();
                }

                if (Spl != null)
                {
                    hash = hash * 59 + Spl.GetHashCode();
                }

                if (Spn != null)
                {
                    hash = hash * 59 + Spn.GetHashCode();
                }

                if (Atl != null)
                {
                    hash = hash * 59 + Atl.GetHashCode();
                }

                if (Batl != null)
                {
                    hash = hash * 59 + Batl.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Hc != null)
                {
                    hash = hash * 59 + Hc.GetHashCode();
                }

                if (Bdatb != null)
                {
                    hash = hash * 59 + Bdatb.GetHashCode();
                }

                return(hash);
            }
        }
Example #9
0
        private void MenuItem_ClickEdit(object sender, RoutedEventArgs e)
        {
            DataRowView myh = (DataRowView)hclist.SelectedItem;

            n = new Hc();
            //MessageBox.Show(dList[hclist.SelectedIndex].Id.ToString());
            dt.Text = myh[0].ToString();
            cDate   = myh[0].ToString();

            initialTb.Text = myh[25].ToString();

            h1.IsChecked  = string.IsNullOrEmpty(myh[1].ToString()) ? false : true;
            n.H1          = myh[1].ToString();
            h2.IsChecked  = string.IsNullOrEmpty(myh[2].ToString()) ? false : true;
            n.H2          = myh[2].ToString();
            h3.IsChecked  = string.IsNullOrEmpty(myh[3].ToString()) ? false : true;
            n.H3          = myh[3].ToString();
            h4.IsChecked  = string.IsNullOrEmpty(myh[4].ToString()) ? false : true;
            n.H4          = myh[4].ToString();
            h5.IsChecked  = string.IsNullOrEmpty(myh[5].ToString()) ? false : true;
            n.H5          = myh[5].ToString();
            h6.IsChecked  = string.IsNullOrEmpty(myh[6].ToString()) ? false : true;
            n.H6          = myh[6].ToString();
            h7.IsChecked  = string.IsNullOrEmpty(myh[7].ToString()) ? false : true;
            n.H7          = myh[7].ToString();
            h8.IsChecked  = string.IsNullOrEmpty(myh[8].ToString()) ? false : true;
            n.H8          = myh[8].ToString();
            h9.IsChecked  = string.IsNullOrEmpty(myh[9].ToString()) ? false : true;
            n.H9          = myh[9].ToString();
            h10.IsChecked = string.IsNullOrEmpty(myh[10].ToString()) ? false : true;
            n.H10         = myh[10].ToString();
            h11.IsChecked = string.IsNullOrEmpty(myh[11].ToString()) ? false : true;
            n.H11         = myh[11].ToString();
            h12.IsChecked = string.IsNullOrEmpty(myh[12].ToString()) ? false : true;
            n.H12         = myh[12].ToString();
            h13.IsChecked = string.IsNullOrEmpty(myh[13].ToString()) ? false : true;
            n.H13         = myh[13].ToString();
            h14.IsChecked = string.IsNullOrEmpty(myh[14].ToString()) ? false : true;
            n.H14         = myh[14].ToString();
            h15.IsChecked = string.IsNullOrEmpty(myh[15].ToString()) ? false : true;
            n.H15         = myh[15].ToString();
            h16.IsChecked = string.IsNullOrEmpty(myh[16].ToString()) ? false : true;
            n.H16         = myh[16].ToString();
            h17.IsChecked = string.IsNullOrEmpty(myh[17].ToString()) ? false : true;
            n.H17         = myh[17].ToString();
            h18.IsChecked = string.IsNullOrEmpty(myh[18].ToString()) ? false : true;
            n.H18         = myh[18].ToString();
            h19.IsChecked = string.IsNullOrEmpty(myh[19].ToString()) ? false : true;
            n.H19         = myh[19].ToString();
            h20.IsChecked = string.IsNullOrEmpty(myh[20].ToString()) ? false : true;
            n.H20         = myh[20].ToString();
            h21.IsChecked = string.IsNullOrEmpty(myh[21].ToString()) ? false : true;
            n.H21         = myh[21].ToString();
            h22.IsChecked = string.IsNullOrEmpty(myh[22].ToString()) ? false : true;
            n.H22         = myh[22].ToString();
            h23.IsChecked = string.IsNullOrEmpty(myh[23].ToString()) ? false : true;
            n.H23         = myh[23].ToString();
            h24.IsChecked = string.IsNullOrEmpty(myh[24].ToString()) ? false : true;
            n.H24         = myh[24].ToString();

            no   = Int32.Parse(myh[26].ToString());
            n.Tc = Int32.Parse(myh[26].ToString());

            tbentry.IsSelected = true;
        }
Example #10
0
        private void savebtn_Click(object sender, RoutedEventArgs e)
        {
            if (dt.SelectedDate == null)
            {
                MessageBox.Show("Enter the date");
            }
            else
            {
                if (string.IsNullOrEmpty(initialTb.Text))
                {
                    MessageBox.Show("Enter your initials");
                }
                else
                {
                    Hc ne = n;
                    ne.Dt       = (DateTime)dt.SelectedDate;
                    ne.Initials = initialTb.Text;
                    ne.Id       = no;

                    try
                    {
                        dbms d = new dbms(@"HCdb.sqlite");
                        d.connect(@"HCdb.sqlite");
                        d.insertDt(ne.Dt.ToShortDateString(), ne.H1, ne.H2, ne.H3, ne.H4, ne.H5, ne.H6, ne.H7, ne.H8, ne.H9, ne.H10, ne.H11, ne.H12, ne.H13, ne.H14, ne.H15, ne.H16, ne.H17, ne.H18, ne.H19, ne.H20, ne.H21, ne.H22, ne.H23, ne.H24, ne.Initials, ne.Tc);
                        try
                        {
                            string sql = "select * from hourlycheck;";
                            ds = new DataSet();
                            var da = new SQLiteDataAdapter(sql, d.dbConnection);
                            da.Fill(ds);
                            hclist.ItemsSource = ds.Tables[0].DefaultView;
                            d.close();
                        }
                        catch (Exception mye)
                        {
                            MessageBox.Show(mye.Message);
                        }
                        dt.Text        = null;
                        h1.IsChecked   = false;
                        h2.IsChecked   = false;
                        h3.IsChecked   = false;
                        h4.IsChecked   = false;
                        h5.IsChecked   = false;
                        h6.IsChecked   = false;
                        h7.IsChecked   = false;
                        h8.IsChecked   = false;
                        h9.IsChecked   = false;
                        h10.IsChecked  = false;
                        h11.IsChecked  = false;
                        h12.IsChecked  = false;
                        h13.IsChecked  = false;
                        h14.IsChecked  = false;
                        h15.IsChecked  = false;
                        h16.IsChecked  = false;
                        h17.IsChecked  = false;
                        h18.IsChecked  = false;
                        h19.IsChecked  = false;
                        h20.IsChecked  = false;
                        h21.IsChecked  = false;
                        h22.IsChecked  = false;
                        h23.IsChecked  = false;
                        h24.IsChecked  = false;
                        initialTb.Text = "";
                        n = new Hc();
                        tbshow.IsSelected = true;
                        no++;
                    }
                    catch (Exception myE)
                    {
                        MessageBoxResult d = MessageBox.Show("Record already exist, do you want to update?", "Are you sure", MessageBoxButton.YesNo);
                        if (d == MessageBoxResult.Yes)
                        {
                            dbms dd = new dbms(@"HCdb.sqlite");
                            dd.connect(@"HCdb.sqlite");
                            dd.updateDt(ne.H1, ne.H2, ne.H3, ne.H4, ne.H5, ne.H6, ne.H7, ne.H8, ne.H9, ne.H10, ne.H11, ne.H12, ne.H13, ne.H14, ne.H15, ne.H16, ne.H17, ne.H18, ne.H19, ne.H20, ne.H21, ne.H22, ne.H23, ne.H24, initialTb.Text, ne.Tc, dt.Text);
                            string sql = "select * from hourlycheck;";
                            ds = new DataSet();
                            var da = new SQLiteDataAdapter(sql, dd.dbConnection);
                            da.Fill(ds);
                            hclist.ItemsSource = ds.Tables[0].DefaultView;
                            dd.close();

                            dt.Text        = null;
                            h1.IsChecked   = false;
                            h2.IsChecked   = false;
                            h3.IsChecked   = false;
                            h4.IsChecked   = false;
                            h5.IsChecked   = false;
                            h6.IsChecked   = false;
                            h7.IsChecked   = false;
                            h8.IsChecked   = false;
                            h9.IsChecked   = false;
                            h10.IsChecked  = false;
                            h11.IsChecked  = false;
                            h12.IsChecked  = false;
                            h13.IsChecked  = false;
                            h14.IsChecked  = false;
                            h15.IsChecked  = false;
                            h16.IsChecked  = false;
                            h17.IsChecked  = false;
                            h18.IsChecked  = false;
                            h19.IsChecked  = false;
                            h20.IsChecked  = false;
                            h21.IsChecked  = false;
                            h22.IsChecked  = false;
                            h23.IsChecked  = false;
                            h24.IsChecked  = false;
                            initialTb.Text = "";
                            n = new Hc();
                            tbshow.IsSelected = true;
                        }
                        else if (d == MessageBoxResult.No)
                        {
                        }
                    }
                    n = new Hc();
                }
            }
        }