Exemplo n.º 1
0
    //private void CreateSlide(WebClientDbContext context)
    //{
    //    if (context.SLIDEs.Count() == 0)
    //    {
    //        List<SLIDE> listSlide = new List<SLIDE>()
    //        {
    //            new SLIDE() {
    //                Name ="Slide 1",
    //                DisplayOrder =1,
    //                Status =true,
    //                Url ="#",
    //                Image ="/Assets/client/images/bag.jpg",
    //                Content =@"	<h2>FLAT 50% 0FF</h2>
    //                        <label>FOR ALL PURCHASE <b>VALUE</b></label>
    //                        <p>Lorem ipsum dolor sit amet, consectetur
    //                    adipisicing elit, sed do eiusmod tempor incididunt ut labore et </ p >
    //                <span class=""on-get"">GET NOW</span>" },
    //            new SLIDE() {
    //                Name ="Slide 2",
    //                DisplayOrder =2,
    //                Status =true,
    //                Url ="#",
    //                Image ="/Assets/client/images/bag1.jpg",
    //            Content=@"<h2>FLAT 50% 0FF</h2>
    //                        <label>FOR ALL PURCHASE <b>VALUE</b></label>

    //                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et </ p >

    //                        <span class=""on-get"">GET NOW</span>"},
    //        };
    //        context.SLIDEs.AddRange(listSlide);
    //        context.SaveChanges();
    //    }
    //}

    private void CreatePage(WebClientDbContext context)
    {
        if (context.PAGEs.Count() == 0)
        {
            try
            {
                var page = new PAGE()
                {
                    Name     = "Giới thiệu",
                    Alias    = "gioi-thieu",
                    PContent = @"Trường Đại học Tiền Giang mong muốn được hợp tác với các tổ chức, cá nhân trong và ngoài nước
về giáo dục, đào tạo, nghiên cứu, ứng dụng và chuyển giao khoa học - công nghệ.",
                    Status   = true
                };
                context.PAGEs.Add(page);
                context.SaveChanges();
            }
            catch (DbEntityValidationException ex)
            {
                foreach (var eve in ex.EntityValidationErrors)
                {
                    Trace.WriteLine($"Entity of type \"{eve.Entry.Entity.GetType().Name}\" in state \"{eve.Entry.State}\" has the following validation error.");
                    foreach (var ve in eve.ValidationErrors)
                    {
                        Trace.WriteLine($"- Property: \"{ve.PropertyName}\", Error: \"{ve.ErrorMessage}\"");
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
        public void Modifier()
        {
            if (dataGridElements.SelectedItems.Count == 1)
            {
                //Faire la modif
                //Civilite civiliteAModifier = dataGridElements.SelectedItem as Civilite;
                PAGE PageAModifier = (PAGE)dataGridElements.SelectedItem;

                windows.Page window = new windows.Page(PageAModifier);
                window.ShowDialog();

                if (window.DialogResult.HasValue && window.DialogResult == true)
                {
                    //Sauvegarde
                    ((App)App.Current).entity.SaveChanges();
                }
                else
                {
                    //On rafraichit l'entity pour éviter les erreurs de données "fantomes" mal déliées
                    ((App)App.Current).entity = new LISA_DIGITALEntities();
                }
            }
            else
            {
                MessageBox.Show("Merci de sélectionner un et un élément maximum");
            }
            RefreshDatas();
        }
Exemplo n.º 3
0
        public void Supprimer()
        {
            if (dataGridElements.SelectedItems.Count == 1)
            {
                //Faire la modif
                PAGE pageASupprimer = (PAGE)dataGridElements.SelectedItem;

                if (MessageBox.Show("Êtes-vous sûr de vouloir supprimer cet élément ?",
                                    "Suppression",
                                    MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    ((App)App.Current).entity.PAGE.Remove(pageASupprimer);

                    //Sauvegarde
                    ((App)App.Current).entity.SaveChanges();
                    DATA(pageASupprimer.CAT_Id);
                }
                else
                {
                    //On rafraichit l'entity pour éviter les erreurs de données "fantomes" mal déliées
                    ((App)App.Current).entity = new LISA_DIGITALEntities();
                }
            }
            else
            {
                MessageBox.Show("Merci de sélectionner un et un élément maximum");
            }
        }
Exemplo n.º 4
0
 public static void SendGump(Mobile from, PAGE page, RevRaffle REVR)
 {
     if (from.HasGump(typeof(RevGuide)))
     {
         from.CloseGump(typeof(RevGuide));
     }
     from.SendGump(new RevGuide(from, REVR, page));
 }
    public void OpenModePage()
    {
        string name = EventSystem.current.currentSelectedGameObject.name;

        Debug.Log("call : " + name);
        currentPage = PAGE.MODE;
        MovePage(currentPage);
    }
Exemplo n.º 6
0
        private void Creer_Click(object sender, RoutedEventArgs e)
        {
            long cid            = longConvert(Int32.Parse(id_cat.Text.ToString()));
            PAGE pageASupprimer = (PAGE)dataGridElements.SelectedItem;

            Windows.Catalogues.page.CreerPage CP = new Windows.Catalogues.page.CreerPage(cid);
            CP.Show();
            CP.creer.Click += CreerAcces_Click;
        }
        public static IntPtr CreateFileMapping(PAGE pageProtect, SEC secProtect, uint dwMaximumSizeHigh, uint dwMaximumSizeLow, string lpName)
        {
            // This is a messy function to wrap.
            // GetLastError returns ERROR_ALREADY_EXISTS if the mapping already exists, and the handle is returned.
            // not all PAGE and SEC combos are legit

            IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // SafeFileHandle.Invalid?
            return _CreateFileMapping(INVALID_HANDLE_VALUE, IntPtr.Zero, (int)pageProtect | (int)secProtect, dwMaximumSizeHigh, dwMaximumSizeLow, lpName);
        }
Exemplo n.º 8
0
        public static IntPtr CreateFileMapping(PAGE pageProtect, SEC secProtect, uint dwMaximumSizeHigh, uint dwMaximumSizeLow, string lpName)
        {
            // This is a messy function to wrap.
            // GetLastError returns ERROR_ALREADY_EXISTS if the mapping already exists, and the handle is returned.
            // not all PAGE and SEC combos are legit

            IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // SafeFileHandle.Invalid?

            return(_CreateFileMapping(INVALID_HANDLE_VALUE, IntPtr.Zero, (int)pageProtect | (int)secProtect, dwMaximumSizeHigh, dwMaximumSizeLow, lpName));
        }
Exemplo n.º 9
0
    //
    void Start()
    {
        PlayBand.OnConnectResultEvent  += ConnectResult;
        PlayBand.OnIncomingDataEventP1 += ReceiveData;
        PlayBand.OnButtonClickedEvent  += ButtonClicked;
        PlayBand.OnBatteryStatusEvent  += BatteryStatus;
        PlayBand.OnCalibratedEvent     += OnCalibrated;

        m_CurPage = PAGE.OPERATION;
    }
Exemplo n.º 10
0
        public async Task <IHttpActionResult> GetPAGE(long id)
        {
            PAGE pAGE = await db.PAGE.FindAsync(id);

            if (pAGE == null)
            {
                return(NotFound());
            }

            return(Ok(pAGE));
        }
Exemplo n.º 11
0
 public void Topup() {
     if(currentPage == PAGE.HOME) {
         homePanel.SetActive(false);
     } else if(currentPage == PAGE.DATA) {
         dataPanel.SetActive(false);
     }
     topupConfirmPanel.SetActive(false);
     topupPanel.SetActive(true);
     currentPage = PAGE.TOPUP;
     pageText.text = "Top Up Saldo";
 }
Exemplo n.º 12
0
 public void Data() {
     if(currentPage == PAGE.HOME) {
         homePanel.SetActive(false);
     } else if(currentPage == PAGE.TOPUP) {
         topupPanel.SetActive(false);
         topupConfirmPanel.SetActive(false);
     }
     dataPanel.SetActive(true);
     currentPage = PAGE.DATA;
     pageText.text = "Data Kelistrikan";
 }
Exemplo n.º 13
0
 public void Home() {
     if(currentPage == PAGE.DATA) {
         dataPanel.SetActive(false);
     } else if(currentPage == PAGE.TOPUP) {
         topupPanel.SetActive(false);
         topupConfirmPanel.SetActive(false);
     }
     homePanel.SetActive(true);
     currentPage = PAGE.HOME;
     pageText.text = "Beranda";
 }
Exemplo n.º 14
0
        public long returnPagSelectionee()
        {
            long a = 0;

            if (dataGridElements.SelectedItems.Count == 1)
            {
                //Faire la modif
                PAGE pagselectionne = (PAGE)dataGridElements.SelectedItem;
                a = pagselectionne.Id;
            }
            return(a);
        }
Exemplo n.º 15
0
 public Page(PAGE PAGEAmodifier = null)
 {
     InitializeComponent();
     if (PAGEAmodifier == null)
     {
         this.DataContext = new PAGE();
     }
     else
     {
         this.DataContext = PAGEAmodifier;
     }
 }
Exemplo n.º 16
0
        private void creer_Click(object sender, RoutedEventArgs e)
        {
            PAGE CE = new PAGE()
            {
                Number = Int32.Parse(Price.Text.ToString()),
                CAT_Id = Int32.Parse(cat_id.Text.ToString())
            };

            db.PAGE.Add(CE);
            db.SaveChanges();
            this.Close();
        }
Exemplo n.º 17
0
    public void OpenGuide()
    {
        var checkItem = EventSystem.current.currentSelectedGameObject.transform.parent.GetComponentInChildren <TogglePannel>().GetToggleItemAny();

        if (!checkItem)
        {
            ShowLearningCheckNullAlert();
            return;
        }

        prevePage   = currentPage;
        currentPage = PAGE.GUIDE;
        MovePage(currentPage);
    }
Exemplo n.º 18
0
    void MovePage(PAGE page)
    {
        switch (page)
        {
        case PAGE.TITLE:
            DisablePage();
            prevePage = PAGE.TITLE;
            title.gameObject.SetActive(true);
            break;

        case PAGE.MAIN:
            DisablePage();
            prevePage = PAGE.TITLE;
            main.gameObject.SetActive(true);
            SetButton();
            //topUi.gameObject.SetActive(true);
            break;

        case PAGE.GUIDE:
            DisablePage();
            guide.gameObject.SetActive(true);
            //topUi.gameObject.SetActive(true);
            SetButton();
            break;

        case PAGE.MODE:
            DisablePage();
            prevePage = PAGE.MAIN;
            mode.gameObject.SetActive(true);
            break;

        case PAGE.LEARNING:
            DisablePage();
            prevePage = PAGE.MODE;
            element   = ELEMENT.None;
            learning.gameObject.SetActive(true);
            ToggleItemManager.Instance.SetTogglePannelList();
            break;

        case PAGE.TEST:
            DisablePage();
            prevePage = PAGE.MODE;
            element   = ELEMENT.None;
            test.gameObject.SetActive(true);
            break;

        default:
            break;
        }
    }
Exemplo n.º 19
0
        public async Task <IHttpActionResult> DeletePAGE(long id)
        {
            PAGE pAGE = await db.PAGE.FindAsync(id);

            if (pAGE == null)
            {
                return(NotFound());
            }

            db.PAGE.Remove(pAGE);
            await db.SaveChangesAsync();

            return(Ok(pAGE));
        }
Exemplo n.º 20
0
    private void Start() {
        currentPage = PAGE.HOME;
        HomeDisplay();
        DataDisplay();

        string topic = PlayerPrefs.GetString("topic", "off");
        if(topic == "off") {
            FirebaseServiceHandler.instance.SubscribeTopic(LocalData.instance.Unit.unit_id.ToString());
        } else if(topic != LocalData.instance.Unit.unit_id.ToString()) {
            FirebaseServiceHandler.instance.UnsubscribeTopic();
            FirebaseServiceHandler.instance.SubscribeTopic(LocalData.instance.Unit.unit_id.ToString());
        }

        StartCoroutine(GetNotification(LocalData.instance.Unit.unit_id.ToString()));
    }
Exemplo n.º 21
0
        public RevGuide(Mobile from, RevRaffle RS, PAGE page)
            : base(50, 50)
        {
            REVR            = RS;
            caller          = from;
            this.Closable   = page == PAGE.Props || page == PAGE.PlayerScreen ? true : false;
            this.Disposable = page == PAGE.Props || page == PAGE.PlayerScreen ? true : false;
            this.Dragable   = true;
            this.Resizable  = false;

            AddPage(0);
            AddBackground(0, 0, w, h, 9270);
            AddPage(1);

            ShowPage(page, from);
        }
Exemplo n.º 22
0
        public async Task <IHttpActionResult> PostPAGE(PAGE pAGE)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            pAGE.CREATED_DATE = DateTime.Now;
            pAGE.UPDATED_DATE = DateTime.Now;
            pAGE.CREATED_BY   = User.Identity.Name;
            pAGE.UPDATED_BY   = User.Identity.Name;
            pAGE.STATUS       = "New";
            db.PAGE.Add(pAGE);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = pAGE.BO_ID }, pAGE));
        }
Exemplo n.º 23
0
        private void AfficherSection_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (dataGridElements.SelectedItems.Count == 1)
                {
                    PAGE caten = (PAGE)dataGridElements.SelectedItem;

                    this.ListeSection.Children.Add(new Controlleur.Catalogues.Section.ListSection(caten.Id));
                }
                else
                {
                    MessageBox.Show("Merci de sélectionner un et un élément maximum");
                }
            }
            catch (Exception er)
            {
                throw er;
            }
        }
Exemplo n.º 24
0
        public static void GoPage(MyFragment fragment, PAGE page)
        {
            MyAppCompatActivity.CURRENT_PAGE = page;

            FragmentTransaction ft = fragment.FragmentManager.BeginTransaction();

            if (page == PAGE.HOME)
            {
                ft.Replace(Resource.Id.page_placeholder, new PageMainFragment(), MyFragment.PAGE_CONTENT);
            }
            else if (page == PAGE.REGI)
            {
                ft.Replace(Resource.Id.page_placeholder, new PageRegisterFragment(), MyFragment.PAGE_CONTENT);
            }
            else if (page == PAGE.LIST)
            {
                ft.Replace(Resource.Id.page_placeholder, new PageListFragment(), MyFragment.PAGE_CONTENT);
            }
            ft.Commit();
        }
Exemplo n.º 25
0
        public void Ajouter()
        {
            windows.Page window = new windows.Page();
            window.ShowDialog();


            if (window.DialogResult.HasValue && window.DialogResult == true)
            {
                //Sauvegarde

                PAGE PAGEToAdd = (PAGE)window.DataContext;
                PAGEToAdd.CAT_Id = CatId;
                ((App)App.Current).entity.PAGE.Add(PAGEToAdd);
                ((App)App.Current).entity.SaveChanges();
            }
            else
            {
                //On rafraichit l'entity pour éviter les erreurs de données "fantomes" mal déliées
                ((App)App.Current).entity = new LISA_DIGITALEntities();
            }
            DataContext = null;
            RefreshDatas();
        }
Exemplo n.º 26
0
        public async Task <IHttpActionResult> PutPAGE(long id, PAGE pAGE)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != pAGE.BO_ID)
            {
                return(BadRequest());
            }


            pAGE.UPDATED_DATE = DateTime.Now;
            pAGE.UPDATED_BY   = User.Identity.Name;

            db.Entry(pAGE).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PAGEExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public PAGE page(PAGE page)
 {
     return(page);
 }
Exemplo n.º 28
0
 public void OpenLearning()
 {
     currentPage = PAGE.LEARNING;
     MovePage(currentPage);
 }
Exemplo n.º 29
0
 public void OpenTest()
 {
     currentPage = PAGE.TEST;
     MovePage(currentPage);
 }
Exemplo n.º 30
0
 internal static extern IntPtr VirtualAlloc(IntPtr lpAddress, UIntPtr dwSize, MEM flAllocationType, PAGE flProtect);
Exemplo n.º 31
0
 public void BackPage()
 {
     currentPage = prevePage;
     MovePage(prevePage);
 }