Exemple #1
0
        public string uInsertUser(CUser vUser)
        {
            if (cValidatePass(vUser) == true)
            {
                using (TransactionScope transaction = new TransactionScope())
                {
                    CCompanyRepo tmpCompanyRep = new CCompanyRepo();
                    tmpCompanyRep.uInsert(vUser.Person.Company);

                    objPers.uInsert(vUser.Person);
                    uChangePass(vUser.UserId, vUser.Email, vUser.Auth.AuthId);

                    tUser.Person_ID     = vUser.Person.PersonId;
                    tUser.Name          = vUser.Email;
                    tUser.Access_ID     = 8;
                    tUser.UserStatus_ID = vUser.UserStatusId;
                    tUser.CreatedBy_ID  = vUser.Auth.AuthId;
                    tUser.CreatedDate   = DateTime.Now;

                    dbSGPP.Users.Add(tUser);
                    dbSGPP.SaveChanges();
                    transaction.Complete();
                }
                return(message);
            }
            else
            {
                message = "La contraseña no coincide";
                return(message);
            }
        }
Exemple #2
0
 public void uInsert(CCompany vCompany)
 {
     tComp.DisplayName  = vCompany.DisplayName;
     tComp.Local        = vCompany.Local;
     tComp.CreatedBy_ID = vCompany.Auth.AuthId;
     tComp.CreatedDate  = DateTime.Now;
     dbSGPP.Companies.Add(tComp);
     dbSGPP.SaveChanges();
 }
Exemple #3
0
        public void uInsert(CPerson vPerson)
        {
            tPers.Company_ID   = vPerson.Company.CompanyId;
            tPers.FirstName    = vPerson.FirstName;
            tPers.LastName     = vPerson.LastName;
            tPers.IDType_ID    = vPerson.DocumentTypeId;
            tPers.ID           = vPerson.DocumenTypeDesc;
            tPers.CreatedBy_ID = vPerson.Auth.AuthId;
            tPers.Sex_ID       = vPerson.Sex_ID;
            tPers.CreatedDate  = DateTime.Now;

            dbSGPP.People.Add(tPers);
            dbSGPP.SaveChanges();
        }