Beispiel #1
0
        public JsonResult SaveExcelData()
        {
            List <Patient> lstPatient = new List <Patient>();
            List <Gender>  lstGender  = new GenderDao().GetAllGender().ToList();

            lstPatient = HttpContext.Session.GetObjectFromJson <List <Patient> >("patient");
            ReturnMessage returnMessage = new ReturnMessage();

            for (int i = 0; i < lstPatient.Count; i++)
            {
                lstPatient[i].GenderID = (from x in lstGender
                                          where x.GenderName == lstPatient[i].GenderName
                                          select x.GenderID).FirstOrDefault();

                lstPatient[i].Created_By  = 1;
                lstPatient[i].Created_On  = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                lstPatient[i].Modified_By = 1;
                lstPatient[i].Modified_On = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                lstPatient[i].Active      = true;
            }

            returnMessage = new PatientDao().Import(lstPatient);

            return(Json(lstPatient));
        }
Beispiel #2
0
        protected TestBase()
        {
            var config  = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
            var section = config.GetSection("ConnectionStrings").GetSection("huraceTest");

            var provider         = section["ProviderName"];
            var connectionString = section["ConnectionString"];

            ConnectionFactory =
                new ConcreteConnectionFactory(DbUtil.GetProviderFactory(provider), connectionString);

            RaceDao        = new RaceDao(ConnectionFactory, StatementFactory);
            SeasonDao      = new SeasonDao(ConnectionFactory, StatementFactory);
            LocationDao    = new LocationDao(ConnectionFactory, StatementFactory);
            CountryDao     = new CountryDao(ConnectionFactory, StatementFactory);
            DisciplineDao  = new DisciplineDao(ConnectionFactory, StatementFactory);
            SkierDao       = new SkierDao(ConnectionFactory, StatementFactory);
            StartListDao   = new StartListDao(ConnectionFactory, StatementFactory);
            RaceEventDao   = new RaceEventDao(ConnectionFactory, StatementFactory);
            SkierEventDao  = new SkierEventDao(ConnectionFactory, StatementFactory);
            TimeDataDao    = new TimeDataDao(ConnectionFactory, StatementFactory);
            GenderDao      = new GenderDao(ConnectionFactory, StatementFactory);
            SensorDao      = new SensorDao(ConnectionFactory, StatementFactory);
            RaceDataDao    = new RaceDataDao(ConnectionFactory, StatementFactory);
            RaceStateDao   = new RaceStateDao(ConnectionFactory, StatementFactory);
            StartStateDao  = new StartStateDao(ConnectionFactory, StatementFactory);
            EventTypeDao   = new EventTypeDao(ConnectionFactory, StatementFactory);
            _dataGenerator = new DataGenerator.Core.DataGenerator(provider, connectionString);
        }
Beispiel #3
0
 public bool Validate(GenderDao g)
 {
     if (PrimaryKeyValidate(g.GenderID) &&
         StringValidate(g.Name, 50))
     {
         return(true);
     }
     return(false);
 }
 public HumanResourcesService(ManagedEmployeeDao managedEmployeeDao, GenderDao genderDao, MaritalStatusDao maritalStatusDao, PersonDao personDao, EmployeeDao employeeDao, BusinessEntityDao businessEntityDao)
 {
     _managedEmployeeDao = managedEmployeeDao;
     _genderDao          = genderDao;
     _maritalStatusDao   = maritalStatusDao;
     _personDao          = personDao;
     _employeeDao        = employeeDao;
     _businessEntityDao  = businessEntityDao;
 }
Beispiel #5
0
 public bool DeleteGender(GenderDao gender)
 {
     try
     {
         return(ac.DeleteGender(emap.MapToData(gender)));
     }
     catch (Exception)
     {
         return(false);
     }
 }
      /// <summary>
      /// Validates the data coming in from the data layer
      /// </summary>
      public bool ValidateSoapData(GenderDao gender)
      {
         int maxName = 50;

         if (val.ValidateInt(gender.GenderID)
            && val.ValidateRequiredString(gender.Name, maxName))
         {
            return true;
         }
         else
         {
            return false;
         }
      }
Beispiel #7
0
 public bool UpdateGender(GenderDao gender)
 {
     try
     {
         if (genderVal.Validate(gender))
         {
             return(ac.UpdateGender(emap.MapToData(gender)));
         }
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #8
0
 public bool InsertGender(GenderDao newgender)
 {
     try
     {
         if (genderVal.Validate(newgender))
         {
             return(ac.InsertGender(emap.MapToData(newgender)));;
         }
         return(false);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #9
0
        public IActionResult EditPatient(string patientId)
        {
            Patient       patient   = new PatientDao().GetAllPatient().Where(x => x.PatientID == Convert.ToInt32(patientId)).ToList()[0];
            List <Gender> lstGender = new GenderDao().GetAllGender().ToList();

            lstGender.Insert(0, new Gender()
            {
                GenderID = 0, GenderName = "Select Gender Name"
            });
            ViewBag.GenderList = new SelectList(lstGender, "GenderID", "GenderName");

            List <Attachments> lstAttachments = new AttachmentDao().GetAllTmpAttachmentsByIssueId(Convert.ToInt32(patientId)).ToList();

            ViewBag.AttachmentsList = lstAttachments;
            return(View(patient));
        }
Beispiel #10
0
        public IActionResult Index()
        {
            //if (!IsAllowed(2,2))
            //{
            //    return RedirectToAction("NoPermission", "AppBase");
            //}

            List <Gender> lstGender = new GenderDao().GetAllGender().ToList();

            lstGender.Insert(0, new Gender()
            {
                GenderID = 0, GenderName = "Select Gender Name"
            });
            ViewBag.GenderList = new SelectList(lstGender, "GenderID", "GenderName");

            return(View());
        }
 /// <summary>
 /// After successful validation, this method will map the data from the Data Layer to the Dto
 /// </summary>
 public GenderDto MapToRest(GenderDao g)
 {
    var mapper = genderMapper.CreateMapper();
    return mapper.Map<GenderDto>(g);
 }
        public Gender MapToData(GenderDao gender)
        {
            var mapper = GenderMapper.CreateMapper();

            return(mapper.Map <Gender>(gender));
        }