Esempio n. 1
0
 public void GwinAppStart()
 {
     GwinApp.Start(typeof(ModelContext), typeof(BaseBLO <>), new FormApplication(), null);
     configEntity        = ConfigEntity.CreateConfigEntity(typeof(TaskProject));
     Entity              = new TaskProject();
     entityMiniConfigBLO = GwinBaseBLO <BaseEntity> .CreateBLO_Instance(typeof(TaskProject), typeof(BaseBLO <>));
 }
Esempio n. 2
0
        /// <summary>
        /// Create an Show ManagerForm
        /// </summary>
        /// <param name="EntityType">Type of Entity</param>
        /// <returns></returns>
        public ManagerForm ShowManagerForm(Type EntityType)
        {
            IGwinBaseBLO baseRepository = GwinBaseBLO <BaseEntity> .CreateBLO_Instance(EntityType, GwinApp.Instance.TypeBaseBLO);

            ManagerForm form = new ManagerForm(baseRepository, null, null, (Form)this.MdiForm);

            this.ShwoForm(form);
            return(form);
        }
        public void ApplyBusinessRolesAfterValuesChangedTest()
        {
            TaskProject EntityMiniConfig = new TaskProject();

            EntityMiniConfig.Title.Current = "Hello";
            // Create entityMinConfigBLO dynamicly
            IGwinBaseBLO entityMinConfigBLO = GwinBaseBLO <BaseEntity> .CreateBLO_Instance(typeof(TaskProject), typeof(BaseBLO <>));

            entityMinConfigBLO.ApplyBusinessRolesAfterValuesChanged(nameof(TaskProject.Title), EntityMiniConfig);

            Assert.AreEqual(EntityMiniConfig.Title.Current, "HELLO");
        }
Esempio n. 4
0
        public void Add_BaseEntryFormTest()
        {
            // Test All EntryForm
            using (ModelContext db = new ModelContext())
            {
                foreach (var item in new GwinEntitiesManager().GetAll_Entities_Type())
                {
                    IGwinBaseBLO EntityBLO = GwinBaseBLO <BaseEntity> .CreateBLO_Instance(item, GwinApp.Instance.TypeBaseBLO);

                    BaseEntryForm baseEntryForm = new BaseEntryForm(EntityBLO);
                }
            }
        }
        /// <summary>
        /// Constructor : Create Application Menu
        /// </summary>
        /// <param name="FormMenu">MDI Form that cotain Menu of Application</param>
        public CreateApplicationMenu(IApplicationMenu FormMenu)
        {
            // Params
            this.MdiFormWithMenu = FormMenu;
            this.menuStrip       = FormMenu.getMenuStrip();
            // MenuStruct Instance
            MenuItems  = new Dictionary <string, Type>();
            MenuStruct = new MenuStruct();
            // Properties
            this.ShowManagementForm         = new CreateAndShowManagerFormHelper(GwinApp.Instance.TypeDBContext, FormMenu);
            this.MenuItemApplicationService = GwinBaseBLO <BaseEntity>
                                              .CreateBLO_Instance(typeof(MenuItemApplication), GwinApp.Instance.TypeBaseBLO);

            // Create Menu
            this.CalculateMenuItems();
            this.ShowMenuItems();
        }
        /// <summary>
        /// Check if User Exist
        /// </summary>
        /// <param name="login">Login </param>
        /// <param name="password">Password </param>
        /// <returns>Existance User or Null</returns>
        private User CheckUser(string login, string password)
        {
            // Create UserBLO Instance
            IGwinBaseBLO userBLO = GwinBaseBLO <User> .CreateBLO_Instance(typeof(User), GwinApp.Instance.TypeBaseBLO);

            Dictionary <string, object> rechercheInfos = new Dictionary <string, object>();

            rechercheInfos.Add(nameof(User.Login), "=" + login);
            rechercheInfos.Add(nameof(User.Password), "=" + password);

            List <object> resultat = userBLO.Recherche(rechercheInfos);

            if (resultat != null && resultat.Count > 0)
            {
                return(resultat[0] as User);
            }
            else
            {
                return(null);
            }
        }