public void Create(Schedule obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Schedule_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("HallID", obj.Hall.ID);
                 sqlCommand.Parameters.AddWithValue("MovieID", obj.Movie.ID);
                 sqlCommand.Parameters.AddWithValue("StartTime", obj.StartTime);
                 sqlCommand.Parameters.AddWithValue("EndTime", obj.EndTime);
                 sqlCommand.Parameters.AddWithValue("Description", obj.Description);
                 sqlCommand.Parameters.AddWithValue("isMaintained", obj.isMaintained);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception e)
     {
     }
 }
Exemple #2
0
 public void Create(EventDetails obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_EventDetails_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("Title", obj.Title);
                 sqlCommand.Parameters.AddWithValue("EventTypeID", obj.EventType.ID);
                 sqlCommand.Parameters.AddWithValue("Description", obj.Description);
                 sqlCommand.Parameters.AddWithValue("Sales", obj.Sales);
                 sqlCommand.Parameters.AddWithValue("ImagePath", obj.ImagePath);
                 sqlCommand.Parameters.AddWithValue("StartDate", obj.StartDate);
                 sqlCommand.Parameters.AddWithValue("EndDate", obj.EndDate);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }
 public void Create(Movie obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Movie_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("Title", obj.Title);
                 sqlCommand.Parameters.AddWithValue("Description", obj.Description);
                 sqlCommand.Parameters.AddWithValue("ImagePath", obj.ImagePath);
                 sqlCommand.Parameters.AddWithValue("ReleaseDate", obj.ReleaseDate);
                 sqlCommand.Parameters.AddWithValue("CategoryID", obj.Category.ID);
                 sqlCommand.Parameters.AddWithValue("isActive", obj.isActive);
                 sqlCommand.Parameters.AddWithValue("Price", obj.Price);
                 sqlCommand.Parameters.AddWithValue("Duration", obj.Duration);
                 sqlCommand.Parameters.AddWithValue("TrailerLink", obj.TrailerLink);
                 sqlCommand.Parameters.AddWithValue("MinimumAge", obj.MinimumAge);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception e)
     {
     }
 }
 public void Create(Client obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Client_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("FirstName", obj.FirstName);
                 sqlCommand.Parameters.AddWithValue("LastName", obj.LastName);
                 sqlCommand.Parameters.AddWithValue("UserName", obj.UserName);
                 sqlCommand.Parameters.AddWithValue("Password", obj.Password);
                 sqlCommand.Parameters.AddWithValue("Birthday", obj.Birthday);
                 sqlCommand.Parameters.AddWithValue("GenreID", obj.Gender.ID);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception e)
     {
     }
 }
 public void Create(Ticket obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Ticket_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("CinemaID", obj.Cinema.ID);
                 sqlCommand.Parameters.AddWithValue("BookingID", obj.Booking.ID);
                 sqlCommand.Parameters.AddWithValue("PaymentID", obj.Payment.ID);
                 sqlCommand.Parameters.AddWithValue("Price", obj.Price);
                 sqlCommand.Parameters.AddWithValue("VAT", obj.VAT);
                 sqlCommand.Parameters.AddWithValue("Date", obj.Date);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #6
0
        public void Create(Booking obj)
        {
            try
            {
                using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
                {
                    sqlConnection.Open();
                    using (SqlCommand sqlCommand = new SqlCommand("usp_Booking_Create", sqlConnection))
                    {
                        sqlCommand.CommandType = CommandType.StoredProcedure;
                        sqlCommand.Parameters.AddWithValue("ClientID", obj.Client.ID);
                        sqlCommand.Parameters.AddWithValue("ChairID", obj.Chair.ID);
                        sqlCommand.Parameters.AddWithValue("ScheduleID", obj.Schedule.ID);

                        AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);

                        sqlCommand.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception e)
            {
                string a = e.Message;
            }
        }
Exemple #7
0
 public void Create(User obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_User_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("FirstName", obj.FirstName);
                 sqlCommand.Parameters.AddWithValue("LastName", obj.LastName);
                 sqlCommand.Parameters.AddWithValue("UserName", obj.UserName);
                 sqlCommand.Parameters.AddWithValue("Password", obj.Password);
                 sqlCommand.Parameters.AddWithValue("RoleID", obj.Role.ID);
                 if (obj.LastLoginDate == default(DateTime))
                 {
                     sqlCommand.Parameters.AddWithValue("LastLoginDate", DBNull.Value);
                 }
                 else
                 {
                     sqlCommand.Parameters.AddWithValue("LastLoginDate", obj.LastLoginDate);
                 }
                 if (obj.LastPasswordChangeDate == default(DateTime))
                 {
                     sqlCommand.Parameters.AddWithValue("LastPasswordChangeDate", DBNull.Value);
                 }
                 else
                 {
                     sqlCommand.Parameters.AddWithValue("LastPasswordChangeDate", obj.LastPasswordChangeDate);
                 }
                 if (obj.IsPasswordChanged == default(bool))
                 {
                     sqlCommand.Parameters.AddWithValue("IsPasswordChanged", obj.IsPasswordChanged);
                     //sqlCommand.Parameters.AddWithValue("LastLoginDate", DBNull.Value);
                 }
                 else
                 {
                     sqlCommand.Parameters.AddWithValue("IsPasswordChanged", obj.IsPasswordChanged);
                 }
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception e)
     {
         string a = e.Message;
     }
 }
 public void Create(Payment obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Payment_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("CashPaymentDetails", obj.CashPaymentDetails.ID);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }
 public void Create(Category obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Category_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("Name", obj.Name);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }
 public void Create(Cinema obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Cinema_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("Adress", obj.CinemaAdress);
                 sqlCommand.Parameters.AddWithValue("FiscalNumber", obj.FiscalNumber);
                 sqlCommand.Parameters.AddWithValue("CinemaLogoPath", obj.CinemaLogoPath);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }
 public void Create(ClientPremiumDetails obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_ClientPremiumDetails_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("SubscribedDate", obj.SubscribedDate);
                 sqlCommand.Parameters.AddWithValue("ExpireDate", obj.ExpiredDate);
                 sqlCommand.Parameters.AddWithValue("Discount", obj.Discount);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }
 public void Create(Chair obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Chair_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("Column", obj.Column);
                 sqlCommand.Parameters.AddWithValue("Row", obj.Row);
                 sqlCommand.Parameters.AddWithValue("isBooked", obj.isBooked);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception e)
     {
         string a = e.Message;
     }
 }
 public void Create(Hall obj)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(Connection.ConnectionString))
         {
             sqlConnection.Open();
             using (SqlCommand sqlCommand = new SqlCommand("usp_Hall_Create", sqlConnection))
             {
                 sqlCommand.CommandType = CommandType.StoredProcedure;
                 sqlCommand.Parameters.AddWithValue("Name", obj.Name);
                 sqlCommand.Parameters.AddWithValue("NoRow", obj.NoRow);
                 sqlCommand.Parameters.AddWithValue("NoColumn", obj.NoColumn);
                 sqlCommand.Parameters.AddWithValue("TechnologyID", obj.Technology.ID);
                 AuditionColumn.OnCreate(sqlCommand, obj.BaseAuditObject);
                 sqlCommand.ExecuteNonQuery();
             }
         }
     }
     catch (Exception)
     {
     }
 }