示例#1
0
        public void GetByCPFTest()
        {
            var item   = RegisterRepositoryTest.itens[1];
            var fromDb = new RegisterRepository().GetByCPF(item.CPF);

            Assert.IsNotNull(fromDb);
            Assert.AreNotSame(item, fromDb);
            Assert.AreEqual(item.Tipo, fromDb.Tipo);
            Assert.AreEqual(item.Nome, fromDb.Nome);
            Assert.AreEqual(item.CPF, fromDb.CPF);
            Assert.AreEqual(item.RG, fromDb.RG);
            Assert.AreEqual(item.Telefone, fromDb.Telefone);
            Assert.AreEqual(item.Celular, fromDb.Celular);

            Assert.AreEqual(item.Tipo, fromDb.Tipo);
            Assert.AreEqual(item.Nome, fromDb.Nome);
            Assert.AreEqual(item.RazaoSocial, fromDb.RazaoSocial);
            Assert.AreEqual(item.Contato, fromDb.Contato);
            Assert.AreEqual(item.CPF, fromDb.CPF);
            Assert.AreEqual(item.RG, fromDb.RG);

            Assert.IsNotNull(fromDb.CorrespCep);
            Assert.AreEqual(item.CorrespCep.Id, fromDb.CorrespCep.Id);
            Assert.AreEqual(item.CorrespNumero, fromDb.CorrespNumero);
            Assert.AreEqual(item.CorrespComplemento, fromDb.CorrespComplemento);

            Assert.AreEqual(item.Telefone, fromDb.Telefone);
            Assert.AreEqual(item.Celular, fromDb.Celular);
            Assert.AreEqual(item.Fax, fromDb.Fax);
            Assert.AreEqual(item.EMail, fromDb.EMail);

            Assert.AreEqual(item.DataNascimento, fromDb.DataNascimento);
            Assert.AreEqual(item.DataInclusao, fromDb.DataInclusao);
            Assert.AreEqual(item.DataAlteracao, fromDb.DataAlteracao);
        }
示例#2
0
        public void SetUpOrganisationTests()
        {
            var databaseConnection = new SqlConnection(_databaseService.WebConfiguration.SqlConnectionString);
            var unitOfWork         = new UnitOfWork(databaseConnection);

            _repository           = new RegisterRepository(unitOfWork, new Mock <ILogger <RegisterRepository> >().Object);
            _validationRepository = new RegisterValidationRepository(unitOfWork);

            _organisationIdCreated = "EPA0987";
            _ukprnCreated          = 123321;
            _org2IdCreated         = "EPA0001";
            _organisationTypeId    = 5;
            OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel {
                Id = _organisationTypeId, Status = "new", Type = "organisation type 1"
            });
            _id = Guid.NewGuid();

            _organisation = new OrganisationModel
            {
                Id                             = _id,
                CreatedAt                      = DateTime.Now,
                EndPointAssessorName           = "name 2",
                EndPointAssessorOrganisationId = _organisationIdCreated,
                EndPointAssessorUkprn          = _ukprnCreated,
                PrimaryContact                 = null,
                OrganisationTypeId             = _organisationTypeId,
                OrganisationData               = null,
                Status                         = OrganisationStatus.New
            };

            _organisation2 = new OrganisationModel
            {
                Id                             = Guid.NewGuid(),
                CreatedAt                      = DateTime.Now,
                EndPointAssessorName           = "name 1",
                EndPointAssessorOrganisationId = _org2IdCreated,
                OrganisationTypeId             = null,
                Status                         = OrganisationStatus.New
            };

            _username = "******";
            OrganisationHandler.InsertRecord(_organisation);
            OrganisationHandler.InsertRecord(_organisation2);

            _contactId = Guid.NewGuid();

            _contact = new EpaContact
            {
                Id = _contactId,
                EndPointAssessorOrganisationId = _organisationIdCreated,
                Username    = _username,
                DisplayName = "Joe Cool",
                Email       = "*****@*****.**",
                PhoneNumber = "555 55555",
                Status      = OrganisationStatus.New,
                SigninType  = "",
                FirstName   = "zzz",
                LastName    = "Ftagn"
            };
        }
示例#3
0
 public List <RegisterModel> GetAllPatients()
 {
     using (var deprepo = new RegisterRepository())
     {
         return(deprepo.GetAll().Where(x => x.Role == "Staff").Select(x => new RegisterModel()
         {
             Email = x.Email,
             FullName = x.FullName,
             Surname = x.Surname,
             Title = x.Title,
             MaritalStatus = x.MaritalStatus,
             DOB = x.DOB,
             Age = x.Age,
             Sex = x.Sex,
             Address1 = x.Address1,
             Address2 = x.Address2,
             Address3 = x.Address3,
             PostalCode = x.PostalCode,
             Telephone = x.Telephone,
             Employer = x.Employer,
             EmployerTelephone = x.EmployerTelephone,
             Occupation = x.Occupation,
             NationalId = x.NationalId,
             Status = x.Status,
             MedicalAidName = x.MedicalAidName,
             MedicalAidNo = x.MedicalAidNo
         }).ToList());
     }
 }
示例#4
0
        public ActionResult Employees()
        {
            var    list         = new List <UserViewModel>();
            string ErrorMessage = new RegisterRepository().GetEmployees(ref list);

            return(View(list));
        }
示例#5
0
        public ActionResult GetEmployeeById(string id)
        {
            UserViewModel item         = new UserViewModel();
            var           ErrorMessage = new RegisterRepository().GetEmployeeById(id, ref item);

            return(Json(item));
        }
示例#6
0
        public ActionResult Orders(int status)
        {
            var    models       = new List <OrderViewModel>();
            string ErrorMessage = new RegisterRepository().GetOrders(status, ref models);

            return(View(models));
        }
示例#7
0
        public ActionResult Announcements(int status)
        {
            var    model        = new List <AnnouncementViewModel>();
            string ErrorMessage = new RegisterRepository().GetAnnouncements(status, ref model);

            return(View(model));
        }
        public ActionResult NewApplication(TestInfo testInfo)
        {
            string response = "";
            if (ModelState.IsValid)
            {
                response = new RegisterRepository().RegisterTest(testInfo);

                MailMessage message = new MailMessage();
                string username = "******";
                string password = "******";
                string receiverEmail = testInfo.StudentInfo.AddressInfo.Email;
                ContentType mimeType = new ContentType("text/html");
                AlternateView alternate = AlternateView.CreateAlternateViewFromString("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> <html><head><META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\"></head><body><b>Dear " + testInfo.StudentInfo.FirstName + testInfo.StudentInfo.LastName + "</b>, <br /><br /><br />Greetings from IELTS !!! <br/><br/><br/> Your registration was successful. Thank You for registering IELTS Examination. <br/> <br/> <br/> Please see below the registration details <br/> <b>&nbsp;&nbsp;&nbsp;&nbsp;Your Receipt Number  :</b> " + testInfo.ReceiptNumber + ".<br /><b>&nbsp;&nbsp;&nbsp;&nbsp;Registered Date Time  :</b> " + testInfo.CreatedDate.ToString() + "<br /><br /> <b>Note: </b> Receipt Number and Passport or National Identity Card is mandatory to check your test results. <br /><br /><br /> Thank You,<br/><br/><br/> IELTS Admin</body></html>.", mimeType);
                message.From = new MailAddress(username);
                message.To.Add(receiverEmail);
                message.Subject = "IELTS Registration - Congrats, " + testInfo.StudentInfo.FirstName + " " + testInfo.StudentInfo.LastName + "!";
                //message.Body = "<html><head></head><body><b>Dear " + testInfo.StudentInfo.FirstName + testInfo.StudentInfo.LastName + "</b>, <br /><br /><br />Greetings from IELTS !!! <br/> Your registration was successful. Thank You for registering IELTS Examination. <br/> Please see below the registration details <br/> <dd /><b>Your Receipt Number  :</b> " + testInfo.ReceiptNumber + ".<br /><dd /><b>Registered Date Time  :</b> "+testInfo.CreatedDate.ToString()+"<br /><br /> <b>Note: </b> Receipt Number is mandatory to check your test results. <br /><br /><br /> Thank You, IELTS Admin</body></html>.";
                message.AlternateViews.Add(alternate);
                message.IsBodyHtml = true;
                message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
                SmtpClient smtpClient = new SmtpClient("smtp.gmail.com", 587);
                smtpClient.EnableSsl = true;
                smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
                smtpClient.UseDefaultCredentials = false;
                smtpClient.Credentials = new NetworkCredential(username, password);
                smtpClient.Send(message);
                RedirectToAction("SubmitApplicationForm");
            }
            return View(testInfo);
        }
示例#9
0
        /// <summary>
        /// 查找当前用户报名信息
        /// </summary>
        /// <param name="id">学生编号</param>
        /// <param name="context">数据库连接上下文对象</param>
        /// <returns></returns>
        public async Task <InformationViewModel> GetInformationAsync(long id, ApplicationDbContext context)
        {
            var webModel = new InformationViewModel();

            try
            {
                //Get register Data
                var register = await RegisterRepository.GetEntityAsync(id, context);

                if (register != null)
                {
                    webModel.ArriveTime = register.ArriveTime.ToString("yyyy-MM-dd");
                    webModel.ExpressId  = register.ExpressId;
                    webModel.Id         = register.Id.ToString();
                    webModel.IsExpress  = register.IsExpress;
                    webModel.Place      = register.Place;
                    webModel.Remark     = register.Remark;
                    webModel.Way        = register.Way;
                }

                var user = await PSURepository.GetUserByIdAsync(CurrentUser.UserId, context);

                webModel.SId        = user.Id.ToString();
                webModel.Department = user.Department;
                webModel.MajorClass = user.MajorClass;
                webModel.Name       = user.Name;
            }
            catch (Exception ex)
            {
                _logger.LogError("获取用户报名数据失败:{0},\r\n内部错误信息:{1}", ex.Message, ex.InnerException.Message);
            }
            return(webModel);
        }
示例#10
0
        public RegisterPresenter(IRegisterView view)
        {
            _view = view;

            _registerRepository = new RegisterRepository();
            _profileRepository  = new MyProfileRepository();
        }
示例#11
0
        public void GetByName()
        {
            var item   = RegisterRepositoryTest.itens[1];
            var fromDb = new RegisterRepository().GetByName(item.Nome);

            Assert.IsNotNull(fromDb);
            Assert.IsTrue(fromDb.Count > 0);
        }
示例#12
0
        public ActionResult GetUserPermission(string uid)
        {
            string permissions = new RegisterRepository().GetUserPermission(uid);

            return(Json(new
            {
                permissions
            }));
        }
示例#13
0
        public ActionResult CheckUser(string iin)
        {
            var IsExist = new RegisterRepository().CheckUser(iin);

            return(Json(new
            {
                IsExist
            }));
        }
示例#14
0
        public static void MyClassCleanup()
        {
            IRegisterRepository r = new RegisterRepository();

            foreach (var item in itens)
            {
                r.Remove(item);
            }
        }
示例#15
0
        public JsonResult SaveBank(string userid, string name, string bik, string iik, int?kbe, string accounttype, string opendate, string accountcurrency, string address)
        {
            var item = new RegisterRepository().AddBank(userid, name, bik, iik, kbe, accounttype, opendate, accountcurrency, address);

            ItemResponse result = new ItemResponse();

            result.IsError      = false;
            result.ErrorMessage = "";
            return(Json(result));
        }
示例#16
0
        public void GetAllSuppliers()
        {
            var fromDb = new RegisterRepository().GetAllSuppliers();

            Assert.IsNotNull(fromDb);
            foreach (var c in fromDb)
            {
                Assert.IsTrue(c.EhFornecedor());
            }
        }
示例#17
0
        public void GetAllClients()
        {
            var fromDb = new RegisterRepository().GetAllClients();

            Assert.IsNotNull(fromDb);
            foreach (var c in fromDb)
            {
                Assert.IsTrue(c.EhCliente());
            }
        }
示例#18
0
        public void AddTest()
        {
            Cadastro item = new Cadastro()
            {
                Situacao = ActiveInactiveType.Active, Nome = "Nome03", CPF = "12345678903", RG = "70010013", Telefone = "4499778877", Celular = "4499778855", Fax = "4477884488", DataNascimento = DateTime.Parse("29/01/1970"), EMail = "[email protected]", CorrespCep = cep, Tipo = PersonType.Fisica
            };
            IRegisterRepository target = new RegisterRepository();

            target.Add(item);

            try
            {
                // use session to try to load the product
                using (ISession session = NHibernateHelper.OpenSession())
                {
                    var fromDb = session.Get <Cadastro>(item.Id);

                    Assert.IsNotNull(fromDb);
                    Assert.AreNotSame(item, fromDb);
                    Assert.AreEqual(item.Tipo, fromDb.Tipo);
                    Assert.AreEqual(item.Nome, fromDb.Nome);
                    Assert.AreEqual(item.CPF, fromDb.CPF);
                    Assert.AreEqual(item.RG, fromDb.RG);
                    Assert.AreEqual(item.Telefone, fromDb.Telefone);
                    Assert.AreEqual(item.Celular, fromDb.Celular);

                    Assert.AreEqual(item.Tipo, fromDb.Tipo);
                    Assert.AreEqual(item.Nome, fromDb.Nome);
                    Assert.AreEqual(item.RazaoSocial, fromDb.RazaoSocial);
                    Assert.AreEqual(item.Contato, fromDb.Contato);
                    Assert.AreEqual(item.CPF, fromDb.CPF);
                    Assert.AreEqual(item.RG, fromDb.RG);

                    Assert.IsNotNull(fromDb.CorrespCep);
                    Assert.AreEqual(item.CorrespCep.Id, fromDb.CorrespCep.Id);
                    Assert.AreEqual(item.CorrespNumero, fromDb.CorrespNumero);
                    Assert.AreEqual(item.CorrespComplemento, fromDb.CorrespComplemento);

                    Assert.AreEqual(item.Telefone, fromDb.Telefone);
                    Assert.AreEqual(item.Celular, fromDb.Celular);
                    Assert.AreEqual(item.Fax, fromDb.Fax);
                    Assert.AreEqual(item.EMail, fromDb.EMail);

                    Assert.AreEqual(item.DataNascimento, fromDb.DataNascimento);
                    Assert.AreEqual(item.DataInclusao, fromDb.DataInclusao);
                    Assert.AreEqual(item.DataAlteracao, fromDb.DataAlteracao);
                }
            }
            finally
            {
                target.Remove(item);
            }
        }
示例#19
0
        public JsonResult SaveExistCompanyUser(string email, string lastname, string firstname, string secondname, string iin, string password, string mobilephone, string extraphone, string workphone, string userposition, int?role, string juridicalname, string bin)
        {
            string userId = "-1";
            var    item   = new RegisterRepository().AddExistCompanyUser(email, lastname, firstname, secondname, iin, password, mobilephone, extraphone, workphone, userposition, role, juridicalname, bin, ref userId);

            ItemResponse result = new ItemResponse();

            result.IsError      = false;
            result.ErrorMessage = "";
            result.Id           = userId;
            return(Json(result));
        }
示例#20
0
        /// <summary>
        /// 获取寝室信息
        /// </summary>
        /// <param name="context">数据库连接上下文对象</param>
        /// <returns></returns>
        public async Task <DormitoryViewModel> GetDormitoryAsync(ApplicationDbContext context)
        {
            DormitoryViewModel webModel = new DormitoryViewModel();

            try
            {
                //Source Data List
                var list = await RegisterRepository.GetDormitoryListAsync(context);

                //Return Data List
                var dataList = new List <InformationData>();

                if (list != null && list.Any())
                {
                    foreach (var item in list)
                    {
                        var model = new InformationData
                        {
                            Id            = item.Id.ToString(),
                            Name          = item.Name,
                            BuildingName  = item.BuildingName,
                            Count         = item.Count,
                            Floor         = item.Floor,
                            SelectedCount = item.SelectedCount,
                            Type          = item.BunkName,
                        };
                        dataList.Add(model);
                    }
                }
                webModel.InformationList = dataList;
                var dorm = await RegisterRepository.GetDormitoryAsync(context);

                webModel.IsChosen = dorm != null;

                if (dorm != null)
                {
                    webModel.DormitoryInfo = new DormitoryInfo
                    {
                        BuildingName = dorm.BuildingName,
                        Floor        = (short)dorm.Floor,
                        Id           = dorm.Id.ToString(),
                        Name         = dorm.DormName,
                        Type         = dorm.BunkType,
                        DateTime     = dorm.DateTime.ToString("yyyy-MM-dd HH:mm:ss")
                    };
                }
            }
            catch (Exception ex)
            {
                _logger.LogError("获取物品信息列表失败:{0},\r\n内部错误信息:{1}", ex.Message, ex.InnerException.Message);
            }
            return(webModel);
        }
示例#21
0
        //public UnitOfWork()
        //{
        //    UserRegisters = new RegisterRepository(_applicationDbContext);
        //    UserRoles = new RoleRepository(_applicationDbContext);

        //    Appointment = new AppointmentRepository(_applicationDbContext);
        //    Doctors = new DoctorRepository(_applicationDbContext);
        //    Patient = new PatientRepository(_applicationDbContext);
        //    Specialization = new SpecializationRepository(_applicationDbContext);
        //    TimeSlot = new TimeSlotRepository(_applicationDbContext);
        //}
        public UnitOfWork(ApplicationDbContext applicationDbContext)
        {
            _applicationDbContext = applicationDbContext;
            UserRegisters         = new RegisterRepository(_applicationDbContext);
            UserRoles             = new RoleRepository(_applicationDbContext);
            Locations             = new LocationRepository(_applicationDbContext);
            States         = new StateRepository(_applicationDbContext);
            Appointment    = new AppointmentRepository(_applicationDbContext);
            Doctors        = new DoctorRepository(_applicationDbContext);
            Patient        = new PatientRepository(_applicationDbContext);
            Specialization = new SpecializationRepository(_applicationDbContext);
            TimeSlot       = new TimeSlotRepository(_applicationDbContext);
        }
示例#22
0
        public JsonResult CheckCompany(string bin)
        {
            if (new RegisterRepository().CheckCompany(bin))
            {
                var item = new RegisterRepository().GetCompanyByBin(bin);
                item.IsExist = true;
                return(Json(item));
            }

            CompanyViewModel item2 = new CompanyViewModel();

            item2.IsExist = false;
            return(Json(item2));
        }
示例#23
0
        public ActionResult AddUserPermission(string uid, string permissions)
        {
            bool   IsSuccess    = true;
            string ErrorMessage = new RegisterRepository().AddUserPermission(uid, permissions);

            if (ErrorMessage != "")
            {
                IsSuccess = false;
            }
            return(Json(new
            {
                IsSuccess,
                ErrorMessage
            }));
        }
示例#24
0
        public void SetUpOrganisationTests()
        {
            _repository            = new RegisterRepository(_databaseService.WebConfiguration, new Mock <ILogger <RegisterRepository> >().Object);
            _validationRepository  = new RegisterValidationRepository(_databaseService.WebConfiguration);
            _queryRepository       = new RegisterQueryRepository(_databaseService.WebConfiguration);
            _organisationIdCreated = "EPA0987";
            _ukprnCreated          = 123321;
            var org2IdCreated = "EPA0001";

            _organisationTypeId = 5;
            OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel {
                Id = _organisationTypeId, Status = "new", Type = "organisation type 1"
            });
            _id = Guid.NewGuid();

            _organisation = new EpaOrganisation
            {
                Id                 = _id,
                CreatedAt          = DateTime.Now,
                Name               = "name 2",
                OrganisationId     = _organisationIdCreated,
                Ukprn              = _ukprnCreated,
                PrimaryContact     = null,
                PrimaryContactName = null,
                Status             = OrganisationStatus.New,
                OrganisationTypeId = _organisationTypeId,
                OrganisationData   = new OrganisationData
                {
                    LegalName   = " legal name",
                    TradingName = "trading name",
                    Address1    = "address 1",
                    Address2    = "address 2",
                    Address3    = "address 3",
                    Address4    = "address 4",
                    Postcode    = "postcode"
                }
            };

            _organisation2 = new EpaOrganisation
            {
                Id                 = Guid.NewGuid(),
                Name               = "name 1",
                OrganisationId     = org2IdCreated,
                Status             = OrganisationStatus.New,
                OrganisationTypeId = null
            };
        }
示例#25
0
        public ActionResult EditEmployee(string id, string userposition, string email, string mobilephone, string workphone, bool isactive, string permissions)
        {
            string       ErrorMessage = new RegisterRepository().EditEmployee(id, userposition, email, mobilephone, workphone, isactive, permissions);
            ItemResponse result       = new ItemResponse();

            if (ErrorMessage == "")
            {
                result.IsError = false;
            }
            else
            {
                result.IsError = true;
            }

            result.ErrorMessage = ErrorMessage;
            return(Json(result));
        }
示例#26
0
        public ActionResult SignDoc(string datebidding, decimal startprice, decimal margin, string datedeadline, string goodsname, string composition, string lotssize, int lotscount, int?typedelivery, string datedelivery, string paymenttype, string xmlAuditForm)
        {
            int    docno        = 0;
            var    IsSuccess    = true;
            string ErrorMessage = new RegisterRepository().AddAnnouncements(datebidding, startprice, margin, datedeadline, goodsname, composition, lotssize, lotscount, typedelivery, datedelivery, paymenttype, xmlAuditForm, ref docno);

            if (ErrorMessage != "")
            {
                IsSuccess = false;
            }

            return(Json(new
            {
                docno,
                IsSuccess,
                ErrorMessage
            }, JsonRequestBehavior.AllowGet));
        }
示例#27
0
        public ActionResult SignApplyDoc(string buyername, string buyerbin, string announcementid, int sellerno, decimal sellerstartprice, string sellerdeliverytype, string bankaccountid, string bankwarranty, string xmlAuditForm)
        {
            bool   IsSuccess    = true;
            var    item         = new OrderViewModel();
            string ErrorMessage = new RegisterRepository().AddOrder(buyername, buyerbin, announcementid, sellerno, sellerstartprice, sellerdeliverytype, bankaccountid, bankwarranty, xmlAuditForm, ref item);

            if (ErrorMessage != "")
            {
                IsSuccess = false;
            }

            return(Json(new
            {
                IsSuccess,
                ErrorMessage,
                item
            }));
        }
        public UnitOfWork(ParkingManagementContext parkingManagementContext)
        {
            _parkingManagementContext = parkingManagementContext;
            Registers           = new RegisterRepository(_parkingManagementContext);
            UserRoles           = new RoleRepository(_parkingManagementContext);
            RequestDuationTypes = new RequestDuationTypeRepository(_parkingManagementContext);
            Tower             = new TowerRepository(_parkingManagementContext);
            ParkingSlot       = new ParkingSlotRepository(_parkingManagementContext);
            RequestDetails    = new RequestDetailsRepository(_parkingManagementContext);
            ParkingAllocation = new ParkingAllocationRepository(_parkingManagementContext);
            SurrenderHistory  = new SurrenderHistoryRepository(_parkingManagementContext);
            TowerParkingSlot  = new TowerParkingSlotRepository(_parkingManagementContext);



            TowerBlock         = new TowerBlockRepository(_parkingManagementContext);
            TowerBlockSlot     = new TowerBlockSlotRepository(_parkingManagementContext);
            slotRequestDetails = new SlotRequestDetailsRepository(_parkingManagementContext);
        }
示例#29
0
        public EditProfileModel PostEditUserMethod(EditProfileModel objRegisterModel, string id)
        {
            //string result = objRegisterModel.DOB.Substring(6);
            int birthyear   = Convert.ToDateTime(objRegisterModel.DOB).Year;
            int currentyear = DateTime.Now.Year;

            //int age = currentyear - Convert.ToInt32(result);
            int Yourage = currentyear - birthyear;

            using (var reg_repo = new RegisterRepository())
            {
                ApplicationUser _user = reg_repo.GetById(id);

                _user.UserName          = objRegisterModel.UserName;
                _user.Email             = objRegisterModel.Email;
                _user.FullName          = objRegisterModel.FullName;
                _user.Surname           = objRegisterModel.Surname;
                _user.Title             = objRegisterModel.Title;
                _user.Password          = objRegisterModel.Password;
                _user.MaritalStatus     = objRegisterModel.MaritalStatus;
                _user.DOB               = objRegisterModel.DOB;
                _user.Age               = Convert.ToString(Yourage);
                _user.Sex               = objRegisterModel.Sex;
                _user.Address1          = objRegisterModel.Address1;
                _user.Address2          = objRegisterModel.Address2;
                _user.Address3          = objRegisterModel.Address3;
                _user.PostalCode        = objRegisterModel.PostalCode;
                _user.Telephone         = objRegisterModel.Telephone;
                _user.Employer          = objRegisterModel.Employer;
                _user.EmployerTelephone = objRegisterModel.EmployerTelephone;
                _user.Occupation        = objRegisterModel.Occupation;
                _user.NationalId        = objRegisterModel.NationalId;
                _user.Status            = objRegisterModel.Status;
                _user.PatientAllergy    = objRegisterModel.PatientAllergy;
                _user.MedicalAidName    = objRegisterModel.MedicalAidName;
                _user.MedicalAidNo      = objRegisterModel.MedicalAidNo;

                reg_repo.Update(_user);

                return(objRegisterModel);
            }
        }
示例#30
0
        public ActionResult Index(RegisterRequest registerRequest)
        {
            if (registerRequest == null)
            {
                ViewBag.Message = "No puede ser nulo el registro"; return(View());
            }                                                                                                  //Devuelvo la vista.

            var StoreRegister = RegisterRepository.StoreRegister(registerRequest);

            if (StoreRegister.status)
            {
                CredentialsRepository.CreateSession(registerRequest.Username);

                return(RedirectToAction("Index", "Products"));
            }

            ViewBag.Message = StoreRegister.message;

            return(View());
        }
示例#31
0
        public void RemoveTest()
        {
            Cadastro item = new Cadastro()
            {
                Situacao = ActiveInactiveType.Inactive, Nome = "Nome04", CPF = "12345678904", RG = "70010013", Telefone = "4499778877", Celular = "4499778855", Fax = "4477884488", DataNascimento = DateTime.Parse("29/01/1970"), EMail = "[email protected]", CorrespCep = cep, Tipo = PersonType.Fisica
            };
            IRegisterRepository target = new RegisterRepository();

            target.Add(item);
            target.Remove(item);

            // use session to try to load the product
            using (ISession session = NHibernateHelper.OpenSession())
            {
                var fromDb = session.Get <Cadastro>(item.Id);

                Assert.IsNull(fromDb);
                Assert.AreNotSame(item, fromDb);
            }
        }
 public RegisterServiceEntity()
 {
     _registerRep = new RegisterRepository();
 }