Ejemplo n.º 1
0
        public void GetShowDataIDExistsShouldPassTest()
        {
            StaticCache.LoadStaticCache();
            ShowController sc = new ShowController();

            var config  = new HttpConfiguration();
            var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:22121/api/show/GetShowData");
            var route   = config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
            var routeData = new HttpRouteData(route, new HttpRouteValueDictionary {
                { "controller", "show" }
            });

            sc.ControllerContext = new HttpControllerContext(config, routeData, request);
            request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            var response = sc.GetShowData(1);

            Assert.AreEqual(response.StatusCode, HttpStatusCode.OK);

            response = sc.GetShowData(100);
            Assert.AreEqual(response.StatusCode, HttpStatusCode.NotFound);
        }
        public void BookingCalculationTest()
        {
            //Arrange
            ShowController sw = new ShowController();

            Booking b = new Booking()
            {
                NoOfSeats = 5, BookingId = 10, DateOfBooking = Convert.ToDateTime("2/18/2019"), Email = "*****@*****.**", PaymentId = 1, ShowId = 43, TimeOfBooking = DateTime.Now, TotalAmount = 0
            };
            Show s = new Show()
            {
                MovieId = 14, Rate = 200, ScreenId = 6, ShowId = 43, Time = TimeSpan.Parse("22:00:00")
            };

            BookingViewModel bvm = new BookingViewModel()
            {
                booking = b, show = s
            };



            //bvm.booking.NoOfSeats = 4;
            //bvm.show.Rate = 190;

            int expected = 1000;

            sw.BookingCalculation(bvm);

            var actual = bvm.booking.TotalAmount;

            //Act

            Assert.AreEqual(expected, actual);
        }
        public void SetUp()
        {
            _shows = new List <DataLayer.Domains.Show>();

            _showStarageMock = new Mock <IShowStorage>();
            _showStarageMock
            .Setup(x => x.AddShows(It.IsAny <ICollection <DataLayer.Domains.Show> >()))
            .Returns((ICollection <DataLayer.Domains.Show> shows) =>
            {
                _shows.AddRange(shows);
                return(Task.CompletedTask);
            });
            _showStarageMock
            .Setup(x => x.GetShows(It.IsAny <int>(), It.IsAny <int>()))
            .ReturnsAsync((int pageNum, int pageSize) => _shows.Skip(pageNum).Take(pageSize).ToList());

            var showProvider = new ShowProvider(_showStarageMock.Object);

            _showGrabberMock = new Mock <IShowGrabber>();
            var showGrabberFactoryMock = new Mock <IShowGrabberFactory>();

            showGrabberFactoryMock
            .Setup(x => x.CreateGrabber(It.IsAny <string>()))
            .Returns(_showGrabberMock.Object);

            _showController = new ShowController(showProvider, showGrabberFactoryMock.Object);
        }
Ejemplo n.º 4
0
        public void CreateShowShouldPassTest()
        {
            StaticCache.LoadStaticCache();
            ShowController sc = new ShowController();

            var config  = new HttpConfiguration();
            var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:22121/api/show/CreateShow");
            var route   = config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}",
                defaults: new { id = RouteParameter.Optional }
                );
            var routeData = new HttpRouteData(route, new HttpRouteValueDictionary {
                { "controller", "show" }
            });

            sc.ControllerContext = new HttpControllerContext(config, routeData, request);
            request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            var show = new ShawCodeExercise.Models.ShowModel();

            show.ID                  = 10;
            show.ShowName            = "the muppets";
            show.ShowCategories      = StaticCache.Categories;
            show.BackgroundImagePath = string.Empty;

            var response = sc.CreateShow(show);

            Assert.AreEqual(response.StatusCode, HttpStatusCode.Created);
        }
Ejemplo n.º 5
0
        public void CreateShowTestShouldFailTest()
        {
            StaticCache.LoadStaticCache();
            ShowController sc = new ShowController();

            var config  = new HttpConfiguration();
            var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:22121/api/show/CreateShow");
            var route   = config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}",
                defaults: new { id = RouteParameter.Optional }
                );
            var routeData = new HttpRouteData(route, new HttpRouteValueDictionary {
                { "controller", "show" }
            });

            sc.ControllerContext = new HttpControllerContext(config, routeData, request);
            request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            ShawCodeExercise.Models.ShowModel show = null;

            var response = sc.CreateShow(show);

            Assert.AreEqual(response.StatusCode, HttpStatusCode.NotAcceptable);
        }
Ejemplo n.º 6
0
 public Search()
 {
     InitializeComponent();
     this.Loading         = false;
     this.showController  = new ShowController();
     this.movieController = new MovieController();
     DataContext          = App.SearchViewModel;
 }
Ejemplo n.º 7
0
        private static ShowController ShowController()
        {
            var factoryMock            = new MockShowServiceFactory();
            var partitionManager       = new MockPartitionManager();
            var reservationFactoryMock = new MockReservationServiceFactory();
            var controller             = new ShowController(factoryMock, partitionManager, reservationFactoryMock);

            return(controller);
        }
Ejemplo n.º 8
0
        public static void GetData()
        {
            int id = 0;
            //count of retry for not found
            int     count = 0;
            string  responseBody;
            dynamic response;

            do
            {
                id++;
                responseBody = "";
                string requestURL = " http://api.tvmaze.com/shows/" + id + "?embed=cast";
                using (HttpClient client = new HttpClient())
                {
                    response     = client.GetAsync(requestURL);
                    responseBody = response.Result.Content.ReadAsStringAsync().Result;
                    if (response.Result.StatusCode.ToString() == "OK")
                    {
                        count = 0;
                        Show show = new Show();
                        var  obj  = JObject.Parse(responseBody);
                        show.id   = (int)obj["id"];
                        show.name = (string)obj["name"];
                        var           castarray = obj["_embedded"]["cast"].ToList();
                        List <Person> cast      = new List <Person>();
                        foreach (var member in castarray)
                        {
                            Person person = new Person();
                            person = JsonConvert.DeserializeObject <Person>(member.SelectToken("person").ToString());
                            cast.Add(person);
                        }
                        show.cast = cast.OrderByDescending(c => c.birthday).ToArray();

                        //Insert into DB
                        ShowController sc = new ShowController();
                        sc.Post(show);
                    }
                    //Handle Rate Limit
                    else if (response.Result.StatusCode.ToString() == "TooManyRequests")
                    {
                        Thread.Sleep(12000);
                        continue;
                    }
                    else if (response.Result.StatusCode.ToString() == "NotFound")
                    {
                        count++;
                        continue;
                    }
                    else
                    {
                        //Send Exception to Exception Logger
                    }
                }
            }while (count <= 3);
        }
Ejemplo n.º 9
0
        public Show()
        {
            InitializeComponent();

            SHC = new ShowController();


            dtableHospitals.DataSource   = SHC.InitDataHospitals();
            dtGridViewPatient.DataSource = SHC.InitDataPatients();
        }
Ejemplo n.º 10
0
        public void GetRoomsTest()
        {
            var controller = new ShowController(_context);
            var result     = controller.RoomList();

            var objectResult = Assert.IsType <OkObjectResult>(result);
            var model        = Assert.IsAssignableFrom <IEnumerable <RoomDto> >(objectResult.Value);

            Assert.Equal(_roomDTOs, model);
        }
Ejemplo n.º 11
0
 public async void LoadPosterImage()
 {
     if (!String.IsNullOrEmpty(this.Imdb))
     {
         this.PosterImage = await ShowController.getSmallScreenImage(this.Imdb, this.Season, this.Episode, (this.ImageSource.Contains("poster-dark.jpg") ? this.ImageSource : this.ImageSource.Replace(".jpg", "-138.jpg")), 138);
     }
     else
     {
         this.PosterImage = await ShowController.getSmallScreenImage(this.Tvdb, this.Season, this.Episode, (this.ImageSource.Contains("poster-dark.jpg") ? this.ImageSource : this.ImageSource.Replace(".jpg", "-138.jpg")), 138);
     }
 }
        public async Task Read_Top_Ten_Anime()
        {
            //Arange
            key = "Anime";
            A.CallTo(() => showRepo.GetTrendingShowsAsync(key)).Returns(await Task.FromResult(fakeShows));//Configures the call to return the faked data, making it independent from the API and testing pure code.
            showController = new ShowController(showRepo);

            //Act
            var result = await showController.GetTrendingAnimesAsync(); //Makes the call

            //Assert
            Assert.Equal(count, result.Count()); //Checks if the list is filled
        }
Ejemplo n.º 13
0
 public async void LoadScreenImage()
 {
     if (_screenImage == null)
     {
         if (!String.IsNullOrEmpty(this.Imdb))
         {
             this.ScreenImage = await ShowController.getSmallScreenImage(this.Imdb, this.Season.ToString(), this.Episode.ToString(), (this.Screen.Contains("poster-dark.jpg") ? this.Screen : this.Screen.Replace(".jpg", "-138.jpg")), 138);
         }
         else
         {
             this.ScreenImage = await ShowController.getSmallScreenImage(this.Tvdb, this.Season.ToString(), this.Episode.ToString(), (this.Screen.Contains("/fanart/") ? this.Screen.Replace("-940.86.jpg", "-218.jpg") : this.Screen.Replace(".jpg", "-218.jpg")), 120);
         }
     }
 }
Ejemplo n.º 14
0
        public Main()
        {
            InitializeComponent();
            DataContext = App.ViewModel;

            App.MainPage           = this;
            this.showController    = new ShowController();
            this.episodeController = new EpisodeController();
            this.userController    = new UserController();
            this.movieController   = new MovieController();

            this.Loading = false;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
Ejemplo n.º 15
0
        public async void LoadOriginalScreenImage()
        {
            if (this.ImageSource == null)
            {
                return;
            }

            if (!String.IsNullOrEmpty(this.Imdb))
            {
                this.ScreenImageOriginal = await ShowController.getSmallScreenImage(this.Imdb, this.Season, this.Episode, (this.ImageSource.Contains("/fanart/") ? this.ImageSource.Replace("-940.86.jpg", "-218.jpg") : this.ImageSource.Replace(".jpg", "-218.jpg")));
            }
            else
            {
                this.ScreenImageOriginal = await ShowController.getSmallScreenImage(this.Tvdb, this.Season, this.Episode, (this.ImageSource.Contains("/fanart/") ? this.ImageSource.Replace("-940.86.jpg", "-218.jpg") : this.ImageSource.Replace(".jpg", "-218.jpg")));
            }
        }
Ejemplo n.º 16
0
        private void ViewEpisode_Loaded(object sender, RoutedEventArgs e)
        {
            LayoutRoot.Opacity = 1;


            if (!App.EpisodeViewModel.IsDataLoaded)
            {
                this.episodeController = new EpisodeController();
                this.showController    = new ShowController();
                LoadingActive          = false;

                LoadEpisode();
            }

            this.EpisodePanorama.SelectedIndex = lastIndex;
        }
        public void GetAll()
        {
            //Arrange
            string expectedMessage = "a beauty tag";
            var    mockService     = new Mock <ShowService>(null);

            mockService.Setup(service => service.GetShowLabel())
            .Returns(expectedMessage);
            var showController = new ShowController(mockService.Object);

            //Act
            ObjectResult actionResult = showController.GetAll() as ObjectResult;

            //Assert
            Assert.Equal(200, actionResult.StatusCode);
            Assert.Equal(expectedMessage, actionResult.Value);
        }
        public void Should_return_expected_message_when_GetAll_successfully()
        {
            // given
            string expectedMessage = "a beauty tag";
            var    mockService     = new Mock <ShowService>(null);

            mockService.Setup(service => service.GetShowLabel())
            .Returns(expectedMessage);
            var showController = new ShowController(mockService.Object);

            // when
            ObjectResult actionResult = showController.GetAll() as ObjectResult;

            // then
            Assert.Equal(200, actionResult.StatusCode);
            Assert.Equal(expectedMessage, actionResult.Value);
        }
Ejemplo n.º 19
0
        public void AddNewShowTest()
        {
            var newShow = new ShowDto
            {
                movieId   = _context.Movies.Single(o => o.Title == "TEST_MOVIE_2").Id,
                roomId    = _context.Rooms.Single(o => o.RoomName == "TEST_ROOM").Id,
                StartTime = "2019-12-20 10:00:00"
            };

            var controller = new ShowController(_context);
            var result     = controller.NewShow(newShow);

            var objectResult = Assert.IsType <OkResult>(result);

            Assert.Equal(_showDTOs.Count + 1, _context.Shows.Count());
            Assert.Equal(200, objectResult.StatusCode);
        }
Ejemplo n.º 20
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int showId = Convert.ToInt32(Request.QueryString["ShowId"]);

            List <Models.Review> reviews = ReviewController.GetShowReviewByShowId(showId);

            if (reviews.Count > 0)
            {
                lblError.Text = "Show has been reviewed, can't delete show";
            }
            else
            {
                if (ShowController.DeleteShow(showId))
                {
                    Response.Redirect("../Home/HomePage.aspx");
                }
            }
        }
Ejemplo n.º 21
0
        protected DataSet GetData(int sellerId)
        {
            // Harusnya munculin cuma show yang dijual sama si seller
            List <Show> shows   = ShowController.GetShowBySellerId(sellerId);
            DataSet     dataset = new DataSet();

            var dataset_shows = dataset.Show;
            var dataset_transaction_headers = dataset.TransactionHeader;
            var dataset_transaction_details = dataset.TransactionDetail;
            var dataset_users = dataset.User;

            foreach (var show in shows)
            {
                var newShowRow = dataset_shows.NewRow();
                newShowRow["Id"]   = show.Id;
                newShowRow["Name"] = show.Name;
                dataset_shows.Rows.Add(newShowRow);

                List <TransactionHeader> headers = TransactionController.GetAllTransactionHeaderByShowId(show.Id);

                foreach (var header in headers)
                {
                    var newHeaderRow = dataset_transaction_headers.NewRow();
                    newHeaderRow["ShowId"]    = header.ShowId;
                    newHeaderRow["BuyerId"]   = header.BuyerId;
                    newHeaderRow["CreatedAt"] = header.CreatedAt;

                    List <TransactionDetail> details = TransactionController.GetAllTransactionDetailById(header.Id);

                    newHeaderRow["Quantity"] = details.Count;
                    newShowRow["Price"]      = show.Price * details.Count;

                    User user = UserController.GetUserById(header.BuyerId);

                    newHeaderRow["BuyerName"] = user.Name;

                    dataset_transaction_headers.Rows.Add(newHeaderRow);
                }
            }

            return(dataset);
        }
Ejemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            hideNavButton();
            string RoleId;

            if (Session["RoleId"] == null)
            {
                RoleId = "-1";
            }
            else
            {
                RoleId = Session["RoleId"].ToString();
            }

            int UserId;

            if (Session["UserId"] == null)
            {
                UserId = -1;
            }
            else
            {
                UserId = int.Parse(Session["UserId"].ToString());
            }

            int ShowId = int.Parse(Request.QueryString["ShowId"]);

            showButton(RoleId, ShowId, UserId);
            Models.ShowDetail show = ShowController.GetShowDetailById(ShowId);

            if (show != null)
            {
                lblNameContent.Text          = show.Show_Name;
                lblPriceContent.Text         = String.Format(CultureInfo.CreateSpecificCulture("id-id"), "Rp. {0:N}", show.Show_Price);
                lblSellerContent.Text        = show.Seller_Name;
                lblDescriptionContent.Text   = show.Description;
                lblAverageRatingContent.Text = (show.Average_Rating).ToString();

                FillGrid(ShowId);
            }
        }
Ejemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string RoleID;

            if (Session["RoleId"] != null)
            {
                RoleID = Session["RoleId"].ToString();
            }
            else
            {
                if (Request.Cookies["remember"] != null)
                {
                    RoleID = Request.Cookies["remember"].Value;
                }
                else
                {
                    RoleID = "-1";
                }
            }
            ShowAdditionalNavBar(RoleID);

            string token = Request.QueryString["Token"];

            if (token == null)
            {
                Response.Redirect("../RedeemToken/RedeemTokenPage.aspx");
            }
            else
            {
                Show          currentShow   = ShowController.GetShowByToken(token);
                User          currentSeller = UserController.GetUserById(currentShow.SellerId);
                Models.Review currentReview = ReviewController.GetReviewByToken(token);

                showButton(currentReview);
                showRating(currentReview);

                lblShowName.Text        = currentShow.Name;
                lblShowSellerName.Text  = currentSeller.Name;
                lblShowDescription.Text = currentShow.Description;
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            int    SellerId    = int.Parse(Session["UserId"].ToString());
            string name        = txtName.Text;
            string URL         = txtURL.Text;
            string description = txtDesc.Text;
            string price       = txtPrice.Text;

            List <Show> Shows = ShowController.GetAllShow();

            bool ShowNameUnique = true;

            foreach (var show in Shows)
            {
                if (name.Equals(show.Name))
                {
                    ShowNameUnique = false;
                }
            }

            string response = "";

            if (ShowNameUnique)
            {
                response = ShowController.CheckAddShow(SellerId, name, URL, description, price);
            }
            else
            {
                response = "Show Name Must be Unique!";
            }

            if (response == "")
            {
                Response.Redirect("../Home/HomePage.aspx");
                return;
            }
            else
            {
                lblError.Text = response;
            }
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            int    ShowId      = int.Parse(Request.QueryString["ShowId"]);
            string name        = txtName.Text;
            string URL         = txtURL.Text;
            string description = txtDesc.Text;
            string price       = txtPrice.Text;

            string response = ShowController.CheckUpdateShow(ShowId, name, URL, description, price);

            if (response == "")
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Update Success')", true);
                Response.Redirect("../Home/HomePage.aspx");
                return;
            }
            else
            {
                lblError.Text = response;
            }
        }
Ejemplo n.º 26
0
        public void ConvertBirthDayFromEntityToResponse()
        {
            //collect data
            int pageSize = 50;
            int page     = 1;

            var testShowCollection = GetTestShowCollection();

            ShowDataService.Setup(s => s.GetShowAndCastData(page, pageSize)).Returns(testShowCollection);

            //convert to Json response
            var showController = new ShowController(ShowDataService.Object);
            var actionResult   = showController.ShowsWithCast(page, pageSize);

            //check for valid actionresult type
            var result = actionResult as OkObjectResult;

            Assert.IsNotNull(result);

            //check for valid responsetype
            var resultContent = result.Value as List <ShowResponse>;

            Assert.IsNotNull(resultContent);

            //the amount of shows should be the same as what we started with
            Assert.AreEqual(1, resultContent.Count);

            var castMembers = resultContent.First().Cast;

            //first show should have 3 cast members
            Assert.AreEqual(3, castMembers.Count);

            //check the datetime values for correctness
            foreach (var cast in castMembers)
            {
                //expect max 10 characters yyyy-MM-dd
                Assert.AreEqual(10, cast.BirthDayDate.Length);
            }
        }
        public void BookingAvailablityTest()
        {
            // Arrange
            DateTime dateofbooking = Convert.ToDateTime("02/15/2019");       ///MM/dd/yyyy


            int      showId        = 71;
            DateTime DateOfBooking = Convert.ToDateTime("2/18/2019");
            int      expected      = 190;

            ShowController sc = new ShowController();

            var var1 = sc.BookingAvailablity(dateofbooking, showId).Data;

            var actual = Convert.ToInt32(var1);

            //Act



            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 28
0
        public Show(bool readme)
        {
            InitializeComponent();

            SHC = new ShowController();


            dtableHospitals.DataSource   = SHC.InitDataHospitals();
            dtGridViewPatient.DataSource = SHC.InitDataPatients();



            this.redirectme = readme;

            if (this.redirectme == true)
            {
                ShowTab.SelectedTab = ShowHospitalTab;
            }
            else
            {
                ShowTab.SelectedTab = ShowPatientTab;
            }
        }
Ejemplo n.º 29
0
        private void ViewShow_Loaded(object sender, RoutedEventArgs e)
        {
            this.ShowPanorama.SelectedIndex = lastIndex;
            this.showController             = new ShowController();
            this.episodeController          = new EpisodeController();
            this.LoadingActive = false;

            String tvdb;

            NavigationContext.QueryString.TryGetValue("id", out tvdb);

            if (!String.IsNullOrEmpty(App.ShowViewModel.Tvdb))
            {
                RefreshBottomBar();
            }

            if (!this.LoadingActive)
            {
                this.LoadingActive = true;
                LoadShow(tvdb);
                this.LoadingActive = false;
            }
        }
Ejemplo n.º 30
0
        private void showButton(string RoleId, int ShowId, int UserId)
        {
            this.btnOrder.Visible  = true;
            this.btnUpdate.Visible = true;

            // Kalau Buyer
            if (RoleId.Equals("1"))
            {
                btnUpdate.Visible = false;
                btnDelete.Visible = false;

                Button button = this.Master.FindControl("btnHomeOnNav") as Button;
                button.Visible = true;

                button         = this.Master.FindControl("btnAddShowOnNav") as Button;
                button.Visible = false;

                button         = this.Master.FindControl("btnReportsOnNav") as Button;
                button.Visible = false;

                button         = this.Master.FindControl("btnLoginOnNav") as Button;
                button.Visible = false;

                button         = this.Master.FindControl("btnRegisterOnNav") as Button;
                button.Visible = false;

                button         = this.Master.FindControl("btnTransactionOnNav") as Button;
                button.Visible = true;

                button         = this.Master.FindControl("btnAccountOnNav") as Button;
                button.Visible = true;

                button         = this.Master.FindControl("btnRedeemOnNav") as Button;
                button.Visible = true;

                button         = this.Master.FindControl("btnLogoutOnNav") as Button;
                button.Visible = true;
            }
            // Kalau Seller
            else if (RoleId.Equals("2") && ShowController.CheckShowWithSeller(ShowId, UserId))
            {
                btnOrder.Visible = false;
                navForSeller();
            }
            else
            {
                btnOrder.Visible  = false;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;

                if (!RoleId.Equals("2"))
                {
                    Button button = this.Master.FindControl("btnHomeOnNav") as Button;
                    button.Visible = true;

                    button         = this.Master.FindControl("btnAddShowOnNav") as Button;
                    button.Visible = false;

                    button         = this.Master.FindControl("btnReportsOnNav") as Button;
                    button.Visible = false;

                    button         = this.Master.FindControl("btnLoginOnNav") as Button;
                    button.Visible = true;

                    button         = this.Master.FindControl("btnRegisterOnNav") as Button;
                    button.Visible = true;

                    button         = this.Master.FindControl("btnTransactionOnNav") as Button;
                    button.Visible = false;

                    button         = this.Master.FindControl("btnAccountOnNav") as Button;
                    button.Visible = false;

                    button         = this.Master.FindControl("btnRedeemOnNav") as Button;
                    button.Visible = true;

                    button         = this.Master.FindControl("btnLogoutOnNav") as Button;
                    button.Visible = false;
                }
                else
                {
                    navForSeller();
                }
            }
        }
Ejemplo n.º 31
0
    // Use this for initialization
    void Start()
    {
        bool isReload = true;

        Collider2D collider = transform.GetComponent<Collider2D>();
        collider.enabled = false;
        if(father == null){
            isReload = false;
            father = new GameObject();
            father.name = gameObject.name + "Show";
            father.transform.parent = transform.parent;
            father.transform.position = transform.position;
            father.AddComponent<ShowCollider>();

            Rigidbody2D fatherRigidbody = father.AddComponent<Rigidbody2D>();
            fatherRigidbody.angularDrag = 0f;
            //fatherRigidbody.drag = 0.1f;

            fatherRigidbody.mass *= 3f;
            if(AreaStatusAndShapeMG.findAreaStatus(gameObject) == 3){
                fatherRigidbody.mass *= 2f;
            }

            Collider2D fatherCollider;
            if(collider.GetType() == typeof(BoxCollider2D)){
                fatherRigidbody.mass *= 2f;
                fatherCollider = father.AddComponent<BoxCollider2D>();
                ((BoxCollider2D)fatherCollider).size = new Vector2(((BoxCollider2D)collider).size.x * transform.localScale.x, ((BoxCollider2D)collider).size.y * transform.localScale.y);
                ((BoxCollider2D)fatherCollider).center = ((BoxCollider2D)collider).center;

            }else if(collider.GetType() == typeof(CircleCollider2D)){
                fatherCollider = father.AddComponent<CircleCollider2D>();

                ((CircleCollider2D)fatherCollider).radius = ((CircleCollider2D)collider).radius * transform.localScale.x;
                ((CircleCollider2D)fatherCollider).center = ((CircleCollider2D)collider).center;
            }else if(collider.GetType() == typeof(EdgeCollider2D)){
                fatherCollider = father.AddComponent<EdgeCollider2D>();
            }else if(collider.GetType() == typeof(PolygonCollider2D)){
                fatherCollider = father.AddComponent<PolygonCollider2D>();
            }

        }

        Destroy(collider);

        transform.parent = father.transform;
        gameObject.AddComponent<FallDownMonitor>();

        loadFace(gameObject, null);

        if(!isReload){
            controller = father.AddComponent<ShowController>();
        }else{
            controller = father.GetComponent<ShowController>();
        }
        controller.area = gameObject;
        controller.face = faceInstace;
    }