public static int SaveObject(quickregistration MyObject)
        {
            //get method name
            string MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;

            //initialize entities
            var ctx = new rentalanguageteacherEntities();
            {
                try
                {
                    log.Debug(MethodName + "**********************************************************************************************************");
                    log.Debug(MethodName + "() - Start");

                    //Check object state, add or update

                    if (MyObject.quick_registration_id == 0)
                    {
                        //Add new object
                        ctx.quickregistrations.Add(MyObject);
                        log.Debug(MethodName + "() - New object added");
                    }

                    else
                    {
                        //Update object
                        ctx.Entry(MyObject).State = System.Data.EntityState.Detached;
                        ctx.Entry(MyObject).State = System.Data.EntityState.Modified;
                        // log.Debug(MethodName + "() - The object for ID " + MyObject.quick_registration_id + " was updated");
                    }

                    //save context changes
                    int num = ctx.SaveChanges();

                    //return?
                    return(num);
                }

                catch (Exception e)
                {
                    log.Error(MethodName + "() - " + e.Message);
                    log.Debug(MethodName + "() - " + e.StackTrace);
                    throw (e);
                }

                finally
                {
                    log.Debug(MethodName + "() - Finish");
                    log.Debug(MethodName + "**********************************************************************************************************");
                }
            }
        }
        public static int DeleteObject(quickregistration MyObject)
        {
            //get method name
            string MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;

            //initialize entities
            var ctx = new rentalanguageteacherEntities();
            {
                try
                {
                    log.Debug(MethodName + "**********************************************************************************************************");
                    log.Debug(MethodName + "() - Start");

                    ctx.Entry(MyObject).State = System.Data.EntityState.Deleted;

                    //Delete user
                    ctx.quickregistrations.Remove(MyObject);

                    //save context changes
                    int num = ctx.SaveChanges();

                    //return?
                    return(num);
                }

                catch (Exception e)
                {
                    log.Error(MethodName + "() - " + e.Message);
                    log.Debug(MethodName + "() - " + e.StackTrace);
                    throw (e);
                }

                finally
                {
                    log.Debug(MethodName + "() - Finish");
                    log.Debug(MethodName + "**********************************************************************************************************");
                }
            }
        }