Exemplo n.º 1
0
        private void tBook_Click(object sender, RoutedEventArgs e)
        {
            int       index = 0, index_1 = 0;
            Entities1 entity = new Entities1();

            try
            {
                Ticket t = new Ticket();
                if (txttid.Text != "" && txttcat.SelectedIndex >= 0 && cbmaname.Text != "")
                {
                    try
                    {
                        TicketCategory tc = new TicketCategory();
                        t.TicketCategoryId = txttcat.SelectedIndex;
                        t.MatchId          = int.Parse(cbmaname.Text);
                        t.NumberOfTickets  = txttid.Text;
                        int x = txttcat.SelectedIndex;
                        //MessageBox.Show(x.ToString());
                        txttpice.Text = ((x + 1) * 1000 * int.Parse(txttid.Text)).ToString();



                        t.Price = int.Parse(txttpice.Text);

                        //txtcnt.Text = (int.Parse(txtcnt.Text)-int.Parse(txttid.Text)).ToString();

                        CUSTOMER_BLL obj = new CUSTOMER_BLL();
                        obj.insert_Customer_Ticket(t);
                        //int[,] count = new int[10, 10];



                        index   = txttcat.SelectedIndex;
                        index_1 = int.Parse(cbmaname.Text);
                        //MessageBox.Show((count[index + 1, index_1] - int.Parse(txttid.Text)).ToString());
                        count[index + 1, index_1] = count[index + 1, index_1] - int.Parse(txttid.Text);
                        txtcnt.Text     = (count[index + 1, index_1]).ToString();
                        pview.IsEnabled = true;
                        MessageBoxResult result = MessageBox.Show(this, "Ticket Booked Successfully",
                                                                  "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                    catch (Exception ex)
                    {
                        MessageBoxResult result = MessageBox.Show(this, "All Fields are Required",
                                                                  "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxResult result = MessageBox.Show(this, "" + ex.Message + "",
                                                          "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
Exemplo n.º 2
0
 private void LoadStat()
 {
     try {
         CUSTOMER_BLL obj = new CUSTOMER_BLL();
         List <Stat>  st  = obj.GetAll_Stat().ToList();
         txttmid.ItemsSource       = st;
         txttmid.DisplayMemberPath = "TeamId";
     }
     catch (StatisticException ex)
     {
         MessageBoxResult result = MessageBox.Show(this, "" + ex.Message + "",
                                                   "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }
Exemplo n.º 3
0
        protected void Unnamed9_Click(object sender, EventArgs e)
        {
            int       index = 0, index_1 = 0;
            Entities1 entity = new Entities1();

            try
            {
                Ticket t = new Ticket();
                if (nooftic.Text != "" && MatchName.SelectedIndex >= 0 && ticcategory.SelectedIndex >= 0)
                {
                    TicketCategory tc = new TicketCategory();
                    t.TicketCategoryId = ticcategory.SelectedIndex;
                    t.MatchId          = (MatchName.SelectedIndex) + 1;
                    t.NumberOfTickets  = nooftic.Text;
                    int x = ticcategory.SelectedIndex;
                    //MessageBox.Show(x.ToString());
                    price1.Text = ((x + 1) * 1000 * int.Parse(nooftic.Text)).ToString();



                    t.Price = int.Parse(price1.Text);

                    //txtcnt.Text = (int.Parse(txtcnt.Text)-int.Parse(txttid.Text)).ToString();

                    CUSTOMER_BLL obj = new CUSTOMER_BLL();
                    obj.insert_Customer_Ticket(t);
                    //int[,] count = new int[10, 10];



                    index   = MatchName.SelectedIndex;
                    index_1 = (ticcategory.SelectedIndex) + 1;
                    //MessageBox.Show((count[index + 1, index_1] - int.Parse(txttid.Text)).ToString());
                    count[index + 1, index_1] = count[index + 1, index_1] - int.Parse(nooftic.Text);
                    ticcategory.Text          = (count[index + 1, index_1]).ToString();
                    Response.Write("<script type='text/javascript'>alert('Ticket Booked Successfully')</script>");
                }
            }



            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        protected void Unnamed9_Click(object sender, EventArgs e)
        {
            int       index = 0, index_1 = 0;
            Entities1 entity = new Entities1();

            try
            {
                Ticket t = new Ticket();
                if (Played.Text != "" && DropDownList1.SelectedIndex >= 0 && won1.Text != "")
                {
                    TicketCategory tc = new TicketCategory();
                    t.TicketCategoryId = DropDownList1.SelectedIndex;
                    t.MatchId          = (won1.SelectedIndex) + 1;
                    t.NumberOfTickets  = Played.Text;
                    int x = DropDownList1.SelectedIndex;
                    //MessageBox.Show(x.ToString());
                    Tied.Text = ((x + 1) * 1000 * int.Parse(Played.Text)).ToString();



                    t.Price = int.Parse(Tied.Text);

                    //txtcnt.Text = (int.Parse(txtcnt.Text)-int.Parse(txttid.Text)).ToString();

                    CUSTOMER_BLL obj = new CUSTOMER_BLL();
                    obj.insert_Customer_Ticket(t);
                    //int[,] count = new int[10, 10];



                    index   = DropDownList1.SelectedIndex;
                    index_1 = (won1.SelectedIndex) + 1;
                    //MessageBox.Show((count[index + 1, index_1] - int.Parse(txttid.Text)).ToString());
                    count[index + 1, index_1] = count[index + 1, index_1] - int.Parse(Played.Text);
                    TeamName1.Text            = (count[index + 1, index_1]).ToString();
                }
            }



            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
 private void sub_Click(object sender, RoutedEventArgs e)
 {
     try {
         var          data   = new List <Stat>();
         int          search = int.Parse(txttmid.Text);
         CUSTOMER_BLL obje   = new CUSTOMER_BLL();
         data           = obje.view_stat(search);
         txtplayed.Text = (data[0].Played).ToString();
         txtwon.Text    = (data[0].Won).ToString();
         txtlost.Text   = (data[0].Lost).ToString();
         txttied.Text   = (data[0].Tied).ToString();
         txtnr.Text     = (data[0].NR).ToString();
         txtnetrr.Text  = (data[0].NetRR).ToString();
         txtpts.Text    = (data[0].Pts).ToString();
         txtfpts.Text   = (data[0].FromPoints).ToString();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
 protected void TeamName_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var          data   = new List <Stat>();
         string       search = (TeamName.SelectedValue.ToString());
         CUSTOMER_BLL obje   = new CUSTOMER_BLL();
         data                 = obje.view_stat(search);
         txtPlayed.Text       = (data[0].Played).ToString();
         txtwon.Text          = (data[0].Won).ToString();
         txtlost.Text         = (data[0].Lost).ToString();
         txtTied.Text         = (data[0].Tied).ToString();
         txtnr.Text           = (data[0].NR).ToString();
         txtnetrr.Text        = (data[0].NetRR).ToString();
         txtpts.Text          = (data[0].Pts).ToString();
         txtfrompts.Text      = (data[0].FromPoints).ToString();
         txtPlayed.Visible    = true;
         txtwon.Visible       = true;
         txtlost.Visible      = true;
         txtTied.Visible      = true;
         txtnr.Visible        = true;
         txtnetrr.Visible     = true;
         txtpts.Visible       = true;
         txtfrompts.Visible   = true;
         lblfrmpoints.Visible = true;
         lbllost.Visible      = true;
         lblname.Visible      = true;
         lblnr.Visible        = true;
         lblnrr.Visible       = true;
         lblplayed.Visible    = true;
         lblwon.Visible       = true;
         lbltied.Visible      = true;
         lblpoints.Visible    = true;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 7
0
 public void loadTicket()
 {
     try
     {
         CUSTOMER_BLL obj = new CUSTOMER_BLL();
         List <Match> pl  = obj.GetAll_Ticket().ToList();
         cbmaname.ItemsSource       = pl;
         cbmaname.DisplayMemberPath = "MatchId";
         txtnews.ItemsSource        = pl;
         txtnews.DisplayMemberPath  = "MatchId";
     }
     catch (TicketException ex)
     {
         MessageBoxResult result = MessageBox.Show(this, "" + ex.Message + "",
                                                   "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
     catch (Exception ex)
     {
         MessageBoxResult result = MessageBox.Show(this, "" + ex.Message + "",
                                                   "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
 }