Пример #1
0
 public LoginController()
 {
     _accountManager = new AccountManager();
     _genderManager  = new GenderManager();
     _countryManager = new CountryManager();
     _stateManager   = new StateManager();
 }
Пример #2
0
        public void RegistroSexoUsuarios(IMongoDatabase db, ObjectId id)
        {
            var genderAPI  = new GenderManager();
            var collection = db.GetCollection <Analysis>("analysis");
            var analysis   = collection.Find(d => d.id == id).FirstOrDefault();

            if (analysis != null)
            {
                var newlistUser         = new List <UserTwitter>();
                var listalluser         = analysis.listUser;
                var listalluserdistinct = analysis.listUser.Select(d => d.Nombre).Distinct().ToList();

                foreach (var item in listalluserdistinct)
                {
                    var sexoCalculado = genderAPI.GetGender(item);

                    var listfilter = listalluser.Where(d => d.Nombre == item && d.Sexo == (int)Sexo.NoProcesado).ToList();
                    foreach (var filter in listfilter)
                    {
                        filter.Sexo = sexoCalculado;
                        newlistUser.Add(filter);
                    }
                }

                collection.FindOneAndUpdate(Builders <Analysis> .Filter.Eq("id", id), Builders <Analysis> .Update.Set("listUser", newlistUser));
            }
        }
Пример #3
0
        public ActionResult Edit(PatientViewModel model)
        {
            ModelState.Clear();
            model.Genders  = GenderManager.GetAllGenderTitle();
            model.Diseases = DiseasesManager.GetAllDiseases();

            if (model.PatientId > 0)
            {
                var patient = PatientManager.GetAllPatienById(model.PatientId) ?? new Patient();

                model.PatientId = patient.PatientId;

                model.Name           = patient.Name;
                model.Age            = patient.Age;
                model.Contact        = patient.Contact;
                model.Email          = patient.Email;
                model.SerialNumber   = patient.SerialNumber;
                model.Address        = patient.Address;
                model.CallingDate    = patient.CallingDate;
                model.VisitingtDate  = patient.VisitingtDate;
                model.AppionmentDate = patient.AppionmentDate;
                model.GenderId       = patient.GenderId;
                model.DiseasesId     = patient.DiseasesId;
                model.PatientCode    = patient.PatientCode;
            }
            return(View(model));
        }
Пример #4
0
 public HomeController()
 {
     _countryManager = new CountryManager();
     _stateManager   = new StateManager();
     _genderManager  = new GenderManager();
     _messageManager = new MessageManager();
     _accountManager = new AccountManager();
 }
        public void GetAll_AllGendersReturned_ExpectedCountEqualsActualCount()
        {
            const int expectedCount = 3;

            using (var genderManager = new GenderManager(new FakeBrothershipUnitOfWork()))
            {
                var actualCount = genderManager.GetAll().Count;
                Assert.AreEqual(expectedCount, actualCount);
            }
        }
Пример #6
0
        public JsonResult Save(GenderViewModel model)
        {
            int saveIndex = 0;

            Gender _gender = new Gender();

            _gender.GenderId = model.GenderId;
            _gender.Title    = model.Title;
            saveIndex        = model.GenderId == 0 ? GenderManager.Save(_gender) : GenderManager.Edit(_gender);
            return(Reload(saveIndex));
        }
Пример #7
0
        //
        // GET: /Gender/
        public ActionResult Index(GenderViewModel model)
        {
            ModelState.Clear();

            var totalrecords = 0;

            model.Genders = GenderManager.GetAllGender(out totalrecords, model);

            model.TotalRecords = totalrecords;
            return(View(model));
        }
Пример #8
0
        public ActionResult Edit(GenderViewModel model)
        {
            ModelState.Clear();
            if (model.GenderId > 0)
            {
                var _gender = GenderManager.GetGenderById(model.GenderId);

                model.GenderId = _gender.GenderId;
                model.Title    = _gender.Title;
            }
            return(View(model));
        }
Пример #9
0
        public async Task <List <Gender> > GetGenderAsync()
        {
            List <Gender> genders = null;
            await Task.Run(() =>
            {
                genders          = GenderManager.GetAllAsync();
                lbltwo.Text      = "Complete Two";
                lbltwo.ForeColor = Color.Blue;
            });

            return(genders);
        }
Пример #10
0
        public ActionResult Create()
        {
            CreateClientViewModel model = new CreateClientViewModel();
            var allEthnicities          = EthnicityManager.GetAll();
            var allDemographics         = DemographicManager.GetAll();
            var allAbuseTypes           = AbuseTypeManager.GetAll();
            var allCounties             = CountyManager.GetAll();
            var allServiceCounties      = CountyManager.GetInServiceArea();
            var allTypes    = TypeManager.GetAll();
            var allStates   = StateManager.GetAll();
            var allGenders  = GenderManager.GetAll();
            var allStatuses = StatusManager.GetAll();

            var checkBoxListItems          = new List <CheckBoxListItem>();
            var abuseTypeCheckBoxListItems = new List <CheckBoxListItem>();

            model.Ethnicities       = allEthnicities;
            model.CountyOfResidence = allCounties;
            model.CountyOfIncident  = allServiceCounties;
            model.Genders           = allGenders;
            model.Types             = allTypes;
            model.States            = allStates;
            model.Statuses          = allStatuses;

            foreach (var demographic in allDemographics)
            {
                checkBoxListItems.Add(new CheckBoxListItem()
                {
                    ID        = demographic.DemographicId,
                    Display   = demographic.DemographicName,
                    IsChecked = false //On the add view, no genres will be selected by default
                });
            }

            model.Demographics = checkBoxListItems;

            foreach (var abuseType in allAbuseTypes)
            {
                abuseTypeCheckBoxListItems.Add(new CheckBoxListItem()
                {
                    ID        = abuseType.AbuseTypeId,
                    Display   = abuseType.AbuseTypeName,
                    IsChecked = false //On the add view, no genres will be selected by default
                });
            }

            model.AbuseTypes = abuseTypeCheckBoxListItems;

            return(View(model));
        }
Пример #11
0
        //
        // GET: /Patient/
        public ActionResult Index(PatientViewModel model)
        {
            ModelState.Clear();

            var totalrecords = 0;

            model.Name         = model.SearchByName;
            model.Genders      = GenderManager.GetAllGenderTitle();
            model.Diseases     = DiseasesManager.GetAllDiseases();
            model.Patients     = PatientManager.GetAllPatienByPaging(out totalrecords, model).Where(x => (x.VisitingtDate >= model.FromDate || model.FromDate == null) && (x.VisitingtDate <= model.ToDate || model.ToDate == null)).ToList();
            model.TotalRecords = totalrecords;


            return(View(model));
        }
Пример #12
0
        public JsonResult Delete(GenderViewModel model)
        {
            int deleteIndex = 0;

            try
            {
                deleteIndex = GenderManager.DeleteGender(model.GenderId);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }

            return(deleteIndex > 0 ? Reload() : ErroResult("Failed to Delete"));
        }
Пример #13
0
        //
        // GET: /Doctor/
        public ActionResult Index(DoctorviewModel model)
        {
            ModelState.Clear();
            var totalrecords = 0;

            model.Name                = model.SearchbyName;
            model.RegistrationNo      = model.SearchByRegistrationNumber;
            model.DoctorsDesignations = DoctorDesignationManager.GetAllDesignation();
            model.Genders             = GenderManager.GetAllGenderTitle();
            model.Doctors             = DoctorManager.GetAllDoctorByPaging(out totalrecords, model);

            //.Where(x=>(x.Name==model.Name||model.Name==null)&&(x.RegistrationNo==model.RegistrationNo||model.RegistrationNo==null)&&(x.GenderId==model.GenderId||model.GenderId==0)&&(x.DessignationId==model.DessignationId||model.DessignationId==0)).ToList();

            model.TotalRecords = totalrecords;
            return(View(model));
        }
Пример #14
0
 private void LoadGender()
 {
     try
     {
         List <Gender> list = GenderManager.GetAll();
         if (list != null && list.Count > 0)
         {
             gvGender.DataSource = list;
             gvGender.DataBind();
         }
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }
        //
        // GET: /EmployeeDetails/
        public ActionResult Index(EmployeeViewModel model)
        {
            ModelState.Clear();
            var totalrecords = 0;

            model.Name = model.SearchbyName;

            model.Employeedesignations = EmployeeDesignationManager.GetAllDesignation();
            model.Genders         = GenderManager.GetAllGenderTitle();
            model.ClinicEmployees = EmployeeManager.GetAllEmployeeByPaging(out totalrecords, model);



            model.TotalRecords = totalrecords;

            return(View(model));
        }
        public ActionResult Edit(EmployeeViewModel model)
        {
            model.Genders = GenderManager.GetAllGenderTitle();
            model.Employeedesignations = EmployeeDesignationManager.GetAllDesignation();
            if (model.ClinicEmployeeId > 0)
            {
                ClinicEmployee empl = EmployeeManager.GetEmployeeById(model.ClinicEmployeeId);

                model.ClinicEmployeeId      = empl.ClinicEmployeeId;
                model.GenderId              = empl.GenderId;
                model.EmployeeDesignationId = empl.EmployeeDesignationId;
                model.Name    = empl.Name;
                model.Address = empl.Address;
                model.Salary  = empl.Salary;
                model.Contact = empl.Contact;
                model.Email   = empl.Email;
            }

            return(View(model));
        }
Пример #17
0
        /// <summary>
        /// Create an instance of StaticVault
        /// </summary>
        /// <param name="client"></param>
        /// <param name="vaultId"></param>
        /// <param name="vaultName"></param>
        /// <param name="masterKey"></param>
        private StaticVault(Client client, string vaultId, string vaultName, string masterKey)
        {
            Client    = client;
            VaultId   = vaultId;
            VaultName = vaultName;
            MasterKey = masterKey;
            _security = new Security();

            Address             = new AddressManager(this);
            DateOfBirth         = new DateOfBirthManager(this);
            DriversLicense      = new DriversLicenseManager(this);
            FirstName           = new FirstNameManager(this);
            Gender              = new GenderManager(this);
            Generic             = new GenericManager(this);
            LastName            = new LastNameManager(this);
            Passport            = new PassportManager(this);
            PlaceOfBirth        = new PlaceOfBirthManager(this);
            Race                = new RaceManager(this);
            Random              = new RandomManager(this);
            Ssn                 = new SsnManager(this);
            TaxPayer            = new TaxPayerManager(this);
            VehicleRegistration = new VehicleRegistrationManager(this);
        }
Пример #18
0
        public ActionResult Edit(DoctorviewModel model)
        {
            model.Genders             = GenderManager.GetAllGenderTitle();
            model.DoctorsDesignations = DoctorDesignationManager.GetAllDesignation();
            if (model.DoctorId > 0)
            {
                Doctor doctor = DoctorManager.GetDoctorById(model.DoctorId);

                model.DoctorId       = doctor.DoctorId;
                model.GenderId       = doctor.GenderId;
                model.DessignationId = doctor.DessignationId;
                model.Name           = doctor.Name;
                model.RegistrationNo = doctor.RegistrationNo;
                model.Adress         = doctor.Adress;
                model.Contact        = doctor.Contact;
                model.Email          = doctor.Email;

                model.Website    = doctor.Website;
                model.FacebookId = doctor.FacebookId;
                model.Twitter    = doctor.Twitter;
            }

            return(View(model));
        }
Пример #19
0
 public TestDictionaries()
 {
     genderMng        = new GenderManager(new BezvizContext(CONNECT));
     checkPointMng    = new CheckPointManager(new BezvizContext(CONNECT));
     nationalitiesMng = new NationalityManager(new BezvizContext(CONNECT));
 }
Пример #20
0
 public void GenerateGender(GenderManager genderManager)
 {
     genderManager.SetGender();
 }
Пример #21
0
        public ActionResult Edit(int id)
        {
            var client = ClientManager.GetById(id);
            var model  = new EditClientViewModel()
            {
                ID = client.ID,
                ClientFirstName     = client.ClientFirstName,
                ClientMiddleInitial = client.ClientMiddleInitial,
                ClientLastName      = client.ClientLastName,
                DateofBirth         = client.DateofBirth,
                DateofFirstContact  = client.DateofFirstContact,
                Address1            = client.Address1,
                Address2            = client.Address2,
                City    = client.City,
                Phone   = client.Phone,
                ZipCode = client.ZipCode,
                EmergencyContactName  = client.EmergencyContactName,
                EmergencyContactPhone = client.EmergencyContactPhone,
                EthnicityId           = client.EthnicityId,
                ClientNumber          = client.ClientNumber,
                CountyOfResidenceId   = client.CountyOfResidenceId,
                CountyOfIncidentId    = client.CountyOfIncidentId,
                StateId  = client.StateId,
                GenderId = client.GenderId,
                TypeId   = client.TypeId,
                StatusId = client.StatusId
            };


            var allGenders     = GenderManager.GetAll();
            var allEthnicities = EthnicityManager.GetAll();
            var allCounties    = CountyManager.GetAll();
            var allStates      = StateManager.GetAll();
            var allTypes       = TypeManager.GetAll();
            var allStatuses    = StatusManager.GetAll();


            model.Genders           = allGenders;
            model.Ethnicities       = allEthnicities;
            model.CountyOfIncident  = allCounties;
            model.CountyOfResidence = allCounties;
            model.States            = allStates;
            model.Types             = allTypes;
            model.Statuses          = allStatuses;

            var clientDemographics = DemographicManager.GetForClient(id);
            var allDemographics    = DemographicManager.GetAll();
            var checkBoxListItems  = new List <CheckBoxListItem>();

            foreach (var demographic in allDemographics)
            {
                checkBoxListItems.Add(new CheckBoxListItem()
                {
                    ID        = demographic.DemographicId,
                    Display   = demographic.DemographicName,
                    IsChecked = clientDemographics.Where(x => x.DemographicId == demographic.DemographicId).Any()
                });
            }
            ;

            model.Demographics = checkBoxListItems;

            var clientAbuseTypes           = AbuseTypeManager.GetForClient(id);
            var allAbuseTypes              = AbuseTypeManager.GetAll();
            var abuseTypeCheckBoxListItems = new List <CheckBoxListItem>();

            foreach (var abuseType in allAbuseTypes)
            {
                abuseTypeCheckBoxListItems.Add(new CheckBoxListItem()
                {
                    ID        = abuseType.AbuseTypeId,
                    Display   = abuseType.AbuseTypeName,
                    IsChecked = clientAbuseTypes.Where(x => x.AbuseTypeId == abuseType.AbuseTypeId).Any()
                });
            }
            ;

            model.AbuseTypes = abuseTypeCheckBoxListItems;

            return(View(model));
        }
Пример #22
0
        public void InitDatabase()
        {
            SQLiteCommand cmd = this.connection.CreateCommand();

            //Setup the Pragma
            cmd.CommandText = " PRAGMA foreign_keys = false;";
            cmd.ExecuteNonQuery();

            //Init Table City
            cmd.CommandText = CityManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Country
            cmd.CommandText = CountryManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Customer
            cmd.CommandText = CustomerManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Employee
            cmd.CommandText = EmployeeManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Gender
            cmd.CommandText = GenderManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Holiday
            cmd.CommandText = HolidayManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Invoice
            cmd.CommandText = InvoiceManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table InvoiceProduct
            cmd.CommandText = InvoiceProductManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Payment;
            cmd.CommandText = PaymentManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Product
            cmd.CommandText = ProductManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Role
            cmd.CommandText = RoleManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Stock
            cmd.CommandText = StockManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init Table Store
            cmd.CommandText = StoreManager.CreationQuery();
            cmd.ExecuteNonQuery();

            //Init the Index City
            cmd.CommandText = CityManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the Index Customer
            cmd.CommandText = CustomerManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index Employee
            cmd.CommandText = EmployeeManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index Holiday
            cmd.CommandText = HolidayManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index Invoice
            cmd.CommandText = InvoiceManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index InvoiceProduct
            cmd.CommandText = InvoiceProductManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index role
            cmd.CommandText = RoleManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index stock
            cmd.CommandText = StockManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Init the index store
            cmd.CommandText = StoreManager.CreationIndex();
            cmd.ExecuteNonQuery();

            //Fill Fixtures
            cmd.CommandText = CountryManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = CityManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = StoreManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = PaymentManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = GenderManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = RoleManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = CustomerManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = EmployeeManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = ProductManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = InvoiceManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = InvoiceProductManager.Fixtures();
            cmd.ExecuteNonQuery();

            cmd.CommandText = HolidayManager.Fixtures();
            cmd.ExecuteNonQuery();

            //Close the pragma
            cmd.CommandText = " PRAGMA foreign_keys = true;";
            cmd.ExecuteNonQuery();
        }