Пример #1
0
        private void PhoneNo_Button_Click(object sender, EventArgs e)
        {
            DafestyEntities ctx = new DafestyEntities();
            var             q   = from x in ctx.Customers
                                  where x.PhoneNumber == PhoneNo_TextBox.Text
                                  select new { x.CustomerID, x.CustomerName, x.MemberCategory, x.PhoneNumber };

            CustGridView.DataSource = q.ToList();
        }
Пример #2
0
        public RentalForm()
        {
            InitializeComponent();
            DafestyEntities ctx = new DafestyEntities();

            var t = ctx.IssueTrans.OrderByDescending(y => y.TransactionID).First();

            TransId_Label.Text = (t.TransactionID + 1).ToString();
        }
Пример #3
0
        private void CustCheck_Button_Click(object sender, EventArgs e)
        {
            DafestyEntities ctx = new DafestyEntities();
            var             q   = from x in ctx.IssueTrans
                                  select x.CustomerID;
            bool present = false;

            foreach (var qry in q)
            {
                if (CustId_TextBox.Text == qry)
                {
                    present = true;
                    var r = ctx.Customers.Where(z => z.CustomerID == qry).First();
                    CustName_TextBox.Text = r.CustomerName.ToString();
                }
            }

            if (present == false)
            {
                CustName_TextBox.Text = "No customer found";
            }
        }
Пример #4
0
        private void MovieCheck_Button_Click(object sender, EventArgs e)
        {
            DafestyEntities ctx = new DafestyEntities();
            var             q   = from x in ctx.IssueTrans
                                  select x.VideoCode;
            bool present = false;

            foreach (var qry in q)
            {
                if (MovieId_TextBox.Text == qry.ToString())
                {
                    present = true;
                    var r = ctx.Movies.Where(z => z.VideoCode == qry).First();
                    MovieName_TextBox.Text = r.MovieTitle.ToString();
                    StockLeft_TextBox.Text = r.TotalStock.ToString();
                }
            }

            if (present == false)
            {
                MovieName_TextBox.Text = "No movie found";
                StockLeft_TextBox.Text = "NULL";
            }
        }