Ejemplo n.º 1
0
 private void EventDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     //MessageBox.Show("Changed");
     if (e.AddedItems.Count > 0)
     {
         EventList.EventsList p = (EventList.EventsList)e.AddedItems[0];
         EventIdTexBox.Text = p.EventId;
     }
 }
Ejemplo n.º 2
0
        public int AddEvent(EventsList EL)
        {
            SqlConnection connection = new SqlConnection("Server=Tanmoy-pc; Database=Wedding Management; User Id=sa; Password=1238628257");

            connection.Open();
            string     query = "INSERT INTO EventList(EventId,EventDate,StartTime,PhotographyCost,DecorationCost,CenterCost,Vat,Discount,TotalCost,AdvancePayment,Remaining,CustomerName,CustomerContact, CustomerEmail,CustomerAddress,PackageId,PackageCost,EDate,PaymentStatus) VALUES('" + EL.EventId + "', '" + EL.EventDate + "', '" + EL.StartTime + "', '" + EL.PhotographyCost + "','" + EL.DecorationCost + "','" + EL.CenterCost + "','" + EL.Vat + "','" + EL.Discount + "','" + EL.TotalCost + "','" + EL.AdvancePayment + "','" + EL.Remaining + "','" + EL.CustomerName + "','" + EL.CustomerContactNo + "','" + EL.CustomerEmail + "','" + EL.CustomerAddress + "','" + EL.PackageId + "','" + EL.PackageCost + "','" + EventCalculation.date + "','" + EventCalculation.paymentStatus + "')";
            SqlCommand cmd   = new SqlCommand(query, connection);
            int        i     = cmd.ExecuteNonQuery();

            return(i);
        }