Example #1
0
        public async Task <object> GetPostData(vmCommonParam cmnParam)
        {
            object result = null; string listPost = string.Empty;

            try
            {
                Generic_vmPost = new GenericFactory <vmPost>();

                ht = new Hashtable
                {
                    { "pageNumber", cmnParam.pageNumber },
                    { "pageSize", cmnParam.pageSize },
                    { "search", cmnParam.search },
                    { "LogedUserId", cmnParam.UserId },
                };

                listPost = await Generic_vmPost.ExecuteCommandString(dataUtilities.SpGetPostData, ht, dataUtilities.conString.ToString());
            }
            catch (Exception ex)
            {
//Logs.WriteBug(ex);
            }

            return(result = new
            {
                listPost
            });
        }
 public QueueProcessorNode(
     IReadQueue <TRequestType> requestQueue,
     IGenericFactory <IMessageProcessingLogic <TRequestType> > logicFactory)
 {
     this.requestQueue = requestQueue;
     this.logicFactory = logicFactory;
     this.requestQueue.QueueMessageHandlerEvent += this.HandleMessageEvent;
 }
 public BussinesLogicController(IDataAccessController dataAccess,
                                ILogger logger,
                                IGenericFactory <IStationController> stationControllerFactory)
 {
     this.dataAccess = dataAccess;
     this.logger     = logger;
     this.stationControllerFactory = stationControllerFactory;
 }
Example #4
0
        public bool TryGetFactory(out IDependencyFactory factory, Type genericTypeDefinition, IEnumerable <Type> genericTypeArguments, object serviceKey = null, InstanceOrigins instanceOrigins = InstanceOrigins.All)
        {
            IGenericFactory genericFactory = _genericFactories[genericTypeDefinition, serviceKey, instanceOrigins];

            factory = genericFactory?.GetFactory(genericTypeArguments);

            return(factory != null);
        }
 public LauncherWindow(IGenericFactory factory,
                       CommonSettings settings,
                       ConnectionSettings connectionSettings)
 {
     _factory            = Guard.GetNotNull(factory, "factory");
     _settings           = Guard.GetNotNull(settings, "settings");
     _connectionSettings = Guard.GetNotNull(connectionSettings, "connectionSettings");
     InitializeComponent();
 }
Example #6
0
 public WritableQueueProcessorNode(
     ILogger logger,
     IReadQueue <TRequestType> requestQueue,
     IGenericFactory <IMessageProcessingLogic <TRequestType> > logicFactory,
     IWriteQueueFactory <TRequestType> writeQueueFactory)
     : base(requestQueue, logicFactory)
 {
     this.writeQueueFactory = writeQueueFactory;
     this.WriteQueue        = this.writeQueueFactory.Create();
 }
Example #7
0
 public void Add(IGenericFactory genericFactory)
 {
     if (genericFactory.Key != null)
     {
         _genericFactories.AddToKeyedFactories(genericFactory);
     }
     else
     {
         _genericFactories.AddToDefaultFactories(genericFactory);
     }
 }
Example #8
0
        public PeopleBooksService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{c8886abb-be37-4759-87b9-7a5161156e79}";
            Name            = "Книги на руках";
            Description     = string.Format("Выдача и возврат книг");
            IsVisibleToUser = true;
        }
Example #9
0
        public PeopleService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{1934d486-3fab-41c4-93e2-43488dde73f2}";
            Name            = "Посетители";
            Description     = string.Format("Постетители библиотеки");
            IsVisibleToUser = true;//поменять на true
        }
Example #10
0
        public BookService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{1934d486-3fab-41c4-93e2-43488dde73f3}";
            Name            = "Книги";
            Description     = string.Format("Книги в наличии в библиотеке");
            IsVisibleToUser = true;//поменять на true
        }
Example #11
0
        public ExampleService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{1934d486-3fab-41c4-93e2-43488dde73f1}";
            Name            = "Пример";
            Description     = string.Format("Описание примера");
            IsVisibleToUser = false;//поменять на true
        }
Example #12
0
        public OrdersService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{29bf447a-17b3-469e-842a-12eefc8e6110}";
            Name            = "Заказы";
            Description     = string.Format("Создание новых заказов и их изменение");
            IsVisibleToUser = true;
        }
Example #13
0
        public MoneyService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{1934d486-3fab-41c4-93e2-43488dde73f1}";
            Name            = "Счета";
            Description     = string.Format("Создание нового счета и изменение");
            IsVisibleToUser = true;
        }
Example #14
0
        public PaymentService(
            IWindow parent,
            IGenericFactory factory)

        {
            _parentWindow = Guard.GetNotNull(parent, "nativeWindow");
            _factory      = Guard.GetNotNull(factory, "factory");

            Ident           = "{c8886abb-be37-4759-87b9-7a5161156e79}";
            Name            = "Платежи";
            Description     = string.Format("Работа с платежами");
            IsVisibleToUser = true;
        }
 public List <DAL.db.Appointment> SearchNotifyDataPS(int id, int eid)
 {
     _scheduleAppointment = new ScheduleAppointmentFactory();
     try
     {
         var list = new List <DAL.db.Appointment>();
         list = _scheduleAppointment.FindBy(x => (x.Employee.EmployeeID == id || x.EmployeeID == eid) && (x.Status == "N" || x.Status == "P") || (x.Employee.EmployeeID == id && x.EmployeeID == eid) && (x.Status == "N" || x.Status == "P")).ToList();
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public Result SelfPasswordChange(ChangePasswordModel changePassword)
        {
            try
            {
                result          = new Result();
                result.isSucess = false;
                Dictionary <int, CheckSessionData> dictionary = CheckSessionData.GetSessionValues();
                int userGroupId = Convert.ToInt32(dictionary[6].Id == "" ? 0 : Convert.ToInt32(dictionary[6].Id));

                if (userGroupId != 0)
                {
                    int    userId   = Convert.ToInt32(dictionary[3].Id);
                    string userName = dictionary[4].Id;
                    _userFactory = new UserFactory();
                    bool status = _userFactory.GetAll().Any(x => x.UserName == userName && x.UserGroupID == userGroupId);
                    if (status == true)
                    {
                        SEC_UserInformation tblUserInformation;
                        tblUserInformation = _userFactory.FindBy(x => x.ID == userId).FirstOrDefault();
                        _passwordFactory   = new UserPasswordFactory();
                        Encription   encription  = new Encription();
                        SEC_Password tblPassword = _passwordFactory.GetAll().FirstOrDefault(x => x.ID == tblUserInformation.PasswordID);
                        if (tblPassword != null)
                        {
                            tblPassword.OldPassword   = tblPassword.NewPassword;
                            tblPassword.NewPassword   = encription.Encrypt(changePassword.NewPassword.Trim());
                            tblPassword.IsSelfChanged = true;
                            tblPassword.UpdatedDate   = DateTime.Now;
                            tblPassword.UpdatedBy     = userId;
                            _passwordFactory.Edit(tblPassword);
                        }
                        result = _passwordFactory.Save();
                        if (result.isSucess)
                        {
                            result.message = "Changed Password Sucessfully";
                            return(result);
                        }
                    }
                    result.message = "Password not Changed try again";
                    return(result);
                }
                result.message = "LogOut";
            }
            catch (Exception exception)
            {
                result.isSucess = false;
                result.message  = exception.Message;
            }
            return(result);
        }
 public List <DAL.db.Appointment> SearchScheduleAppointment(int employeeID)
 {
     _scheduleAppointment = new ScheduleAppointmentFactory();
     try
     {
         var list = new List <DAL.db.Appointment>();
         list = _scheduleAppointment.FindBy(x => (x.EmployeeID == employeeID) && (x.Status == "A" || x.Status == "I" || x.Status == "B" || x.Status == "N" || x.Status == "AP" || x.Status == "P")).ToList();
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #18
0
 public DAL.db.Appointment SearchCardWiseAppointmentData(string cardNO)
 {
     _unScheduleAppointment = new UnScheduleAppointmentFactory();
     try
     {
         var list = new DAL.db.Appointment();
         list = _unScheduleAppointment.FindBy(x => (x.CardNO == cardNO) && (x.Status == "I")).FirstOrDefault();
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #19
0
 public List <DAL.db.Appointment> SearchCheckBreak(string status)
 {
     _unScheduleAppointment = new UnScheduleAppointmentFactory();
     try
     {
         var list = new List <DAL.db.Appointment>();
         list = _unScheduleAppointment.FindBy(x => x.Status == status).OrderByDescending(x => x.AppointmentID).Take(100).ToList();
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public List <MeetingRoomRequisition> SearchMeetingRoom(int roomId, DateTime date)
 {
     _mrReqFactory = new MeetingRoomReqFactory();
     try
     {
         var list = new List <MeetingRoomRequisition>();
         list = _mrReqFactory.FindBy(x => x.MeetingRoomID == roomId && x.RequiredDate == date).ToList();
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public List <SEC_UserInformation> LoadAllUserName()
 {
     try
     {
         Dictionary <int, CheckSessionData> dictionary = CheckSessionData.GetSessionValues();
         int userGroupId = Convert.ToInt32(dictionary[6].Id == "" ? 0 : Convert.ToInt32(dictionary[6].Id));
         _userFactory = new UserFactory();
         var list = new List <SEC_UserInformation>();
         list = _userFactory.FindBy(x => x.IsActive == true && x.UserGroupID == userGroupId).ToList();
         return(list);
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Example #22
0
        public dynamic GetEditPageList(int userGroupId)
        {
            try
            {
                _userActionMappingFactory = new UserActionMappingFactory();
                _uiPageFactory            = new UiPageFactory();
                _moduleFactory            = new ModuleFactory();
                _userActionMappingFactory = new UserActionMappingFactory();

                var module = _moduleFactory.GetAll().ToList();

                var page = from pag in context.SEC_UIPage
                           join map in context.SEC_UserActionMapping
                           on pag.ID equals map.UIPageID
                           where map.UserGroupID == userGroupId
                           select new
                {
                    PageId     = pag.ID,
                    ModuleId   = map.UIModuleID,
                    ModuleName = pag.Name,
                    Select     = map.IsSelect,
                    Create     = map.IsCreate,
                    Edit       = map.IsEdit,
                    Delete     = map.IsDelete,
                    ShowHide   = true
                };

                var menu = (from item in module
                            select new
                {
                    ID = item.ID,
                    Name = item.Name,
                    Select = true,
                    Edit = true,
                    Create = true,
                    Delete = true,
                    ShowHide = false,
                    children = page.Where(x => x.ModuleId == item.ID).ToList()
                }).ToList();

                return(menu);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #23
0
 public JsonResult GetAllUserGroups()
 {
     try
     {
         _userGroupFactory = new UserGroupFactory();
         var userGroups = _userGroupFactory.GetAll().Select(x => new
         {
             x.ID,
             x.Name
         }).ToList();
         return(Json(userGroups.OrderBy(x => x.Name), JsonRequestBehavior.AllowGet));
     }
     catch (Exception exception)
     {
         return(Json(new { success = false, message = exception.Message }, JsonRequestBehavior.AllowGet));
     }
 }
 public List <Employee> SearchDepWiseEmployee(int depID)
 {
     _scheduleEmpFactory = new ScheduleEmployeeFactory();
     try
     {
         var list = new List <Employee>();
         if (depID > 0)
         {
             list = _scheduleEmpFactory.FindBy(x => x.DepartmentID == depID).ToList();
         }
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public List <Employee> SearchDepWiseEmployeeBehalf(int did, int id)
 {
     _scheduleEmpFactory = new ScheduleEmployeeFactory();
     try
     {
         var list = new List <Employee>();
         if (did > 0)
         {
             list = _scheduleEmpFactory.FindBy(x => x.DepartmentID == did && x.OnBehalfEmployeeID == id && x.EmployeeID != id).ToList();
         }
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public List <Employee> GetDepWiseFloor(int empID)
 {
     _scheduleEmpFactory = new ScheduleEmployeeFactory();
     try
     {
         var list = new List <Employee>();
         if (empID > 0)
         {
             list = _scheduleEmpFactory.FindBy(x => x.EmployeeID == empID).ToList();
         }
         return(list);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #27
0
        public Result DeleteUserGroup(int id)
        {
            Result result = new Result();

            using (var dbContextTransaction = context.Database.BeginTransaction())
            {
                try
                {
                    _userGroupFactory = new UserGroupFactory();
                    _userFactory      = new UserFactory();
                    int countUser = _userFactory.FindBy(x => x.UserGroupID == id).Count();
                    if (countUser == 0)
                    {
                        result.isSucess           = true;
                        _userActionMappingFactory = new UserActionMappingFactory();
                        int countUserAction = _userActionMappingFactory.FindBy(x => x.UserGroupID == id).Count();
                        if (countUserAction > 0)
                        {
                            _userActionMappingFactory.Delete(x => x.UserGroupID == id);
                            result = _userActionMappingFactory.Save();
                        }

                        if (result.isSucess)
                        {
                            _userGroupFactory.Delete(x => x.ID == id);
                            result = _userGroupFactory.Save();
                        }

                        if (result.isSucess)
                        {
                            result.message = result.DeleteSuccessfull(tableName);
                            dbContextTransaction.Commit();
                            return(result);
                        }
                    }
                }
                catch (Exception ex)
                {
                    result.message  = ex.Message;
                    result.isSucess = false;
                    dbContextTransaction.Rollback();
                }
            }

            return(result);
        }
Example #28
0
        public IEngine Create(EvolutionParameters evolutionParameters, IGenericFactory <Solution> solutionsFactory, IGenericFactory <PopulationGeneratorBase> populationGeneratorsFactory, IGenericFactory <MutatorBase> objectMutatorsFactory, IGenericFactory <MutatorBase> stdDevsMutatorsFactory, IGenericFactory <MutationRuleSupervisorBase> mutationRuleSupervisorsFactory, IGenericFactory <ParentsSelectorBase> parentsSelectorsFactory, IGenericFactory <SurvivorsSelectorBase> survivorsSelectorsFactory,
                              IGenericFactory <MutatorBase> rotationsMutatorsFactory     = null, IGenericFactory <RecombinerBase> objectRecombinersFactory    = null,
                              IGenericFactory <RecombinerBase> stdDevsRecombinersFactory = null, IGenericFactory <RecombinerBase> rotationsRecombinersFactory = null)
        {
            IEngine engine;

            var populationGenerator    = populationGeneratorsFactory.Create(evolutionParameters);
            var objectMutator          = objectMutatorsFactory.Create(evolutionParameters);
            var stdDevsMutator         = stdDevsMutatorsFactory.Create(evolutionParameters);
            var mutationRuleSupervisor = mutationRuleSupervisorsFactory.Create(evolutionParameters);
            var rotationsMutator       = rotationsMutatorsFactory?.Create(evolutionParameters);
            var parentsSelector        = parentsSelectorsFactory.Create(evolutionParameters);
            var survivorsSelector      = survivorsSelectorsFactory.Create(evolutionParameters);
            var objectRecombiner       = objectRecombinersFactory?.Create(evolutionParameters);
            var stdDevsRecombiner      = stdDevsRecombinersFactory?.Create(evolutionParameters);
            var rotationsRecombiner    = rotationsRecombinersFactory?.Create(evolutionParameters);
            var statistics             = new Statistics();
            var stoper = new Stopwatch();

            var typeOfMutation = (MutationType)evolutionParameters.TypeOfMutation;

            if (typeOfMutation == MutationType.Correlated)
            {
                if (evolutionParameters.UseRecombination)
                {
                    engine = new CmEngineWithRecombination(evolutionParameters, solutionsFactory, populationGenerator, objectMutator, stdDevsMutator, mutationRuleSupervisor, parentsSelector, survivorsSelector, statistics, stoper, objectRecombiner, stdDevsRecombiner, rotationsMutator, rotationsRecombiner);
                }
                else
                {
                    engine = new CmEngineWithoutRecombination(evolutionParameters, solutionsFactory, populationGenerator, objectMutator, stdDevsMutator, mutationRuleSupervisor, parentsSelector, survivorsSelector, statistics, stoper, rotationsMutator);
                }
            }
            else
            {
                if (evolutionParameters.UseRecombination)
                {
                    engine = new UmEngineWithRecombination(evolutionParameters, solutionsFactory, populationGenerator, objectMutator, stdDevsMutator, mutationRuleSupervisor, parentsSelector, survivorsSelector, statistics, stoper, objectRecombiner, stdDevsRecombiner);
                }
                else
                {
                    engine = new UmEngineWithoutRecombination(evolutionParameters, solutionsFactory, populationGenerator, objectMutator, stdDevsMutator, mutationRuleSupervisor, parentsSelector, survivorsSelector, statistics, stoper);
                }
            }

            return(engine);
        }
Example #29
0
 public Card GetFreeCard(int deviceNo)
 {
     //int enrollmentID = 0;
     _card = new CardFactory();
     try
     {
         var card = _card.FindBy(x => x.DeviceNO == deviceNo && x.CardNO == null).FirstOrDefault();
         //if (data != null)
         //{
         //    enrollmentID = data.ID;
         //}
         return(card);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #30
0
        protected EngineBase(EvolutionParameters evolutionParameters, IGenericFactory <Solution> solutionsFactory, PopulationGeneratorBase populationGenerator, MutatorBase objectMutator, MutatorBase stdDeviationsMutator, MutationRuleSupervisorBase mutationRuleSupervisor, ParentsSelectorBase parentsSelector, SurvivorsSelectorBase survivorsSelector, Statistics statistics, Stopwatch stoper)
        {
            Parameters             = evolutionParameters;
            SolutionsFactory       = solutionsFactory;
            PopulationGenerator    = populationGenerator;
            ObjectMutator          = objectMutator;
            StdDeviationsMutator   = stdDeviationsMutator;
            MutationRuleSupervisor = mutationRuleSupervisor;
            ParentsSelector        = parentsSelector;
            SurvivorsSelector      = survivorsSelector;
            Statistics             = statistics;
            Stoper = stoper;

            BasePopulation       = new Solution[evolutionParameters.BasePopulationSize];
            OffspringPopulation  = new Solution[evolutionParameters.OffspringPopulationSize];
            EvolutionStepsSimple = new List <Solution>(evolutionParameters.NumberOfGenerations);
            EvolutionSteps       = new Dictionary <int, EvolutionStep>(evolutionParameters.NumberOfGenerations);
        }
Example #31
0
 public LinkedGenericFactory(Type type, IGenericFactory factory, object serviceKey, Substitution substitution)
     : base(type, serviceKey, substitution)
 {
     _factory = factory;
 }
 public void Initialize()
 {
     m_Factory = new GenericFactory();
 }