public Boolean CrearCredencial(CredencialDto credencial)
        {
            CredencialesEntities db = new CredencialesEntities();
            CREDENCIAL           credencialEntity = this.mapper.Map <CredencialDto, CREDENCIAL>(credencial);

            db.CREDENCIAL.Add(credencialEntity);
            db.SaveChanges();
            return(true);
        }
Example #2
0
        //Metodo para agregar profesional
        public bool AgregarProfesional()
        {
            try
            {
                PROFESIONAL pro = new PROFESIONAL();
                CREDENCIAL  cre = new CREDENCIAL();

                /*pro.RUT_PROFESIONAL = this.Rut_profesional;
                 * pro.NOMBRE = this.Nombre;
                 * pro.AP_PAT = this.Ap_pat;
                 * pro.AP_MAT = this.Ap_mat;
                 * pro.FEC_NACIMIENTO = this.Fec_nacimiento;
                 * string result;
                 * result = Convert.ToString(pro.FEC_NACIMIENTO);
                 *
                 * pro.TELEFONO = this.Telefono;
                 * pro.DIRECCION = this.Direccion;
                 * pro.CORREO = this.Correo;
                 * pro.ID_GENERO = this.Id_genero;
                 * pro.ID_COMUNA = this.Id_comuna;*/

                //pro.FEC_NACIMIENTO = Convert.ToDateTime(pro.FEC_NACIMIENTO.ToString("MM/dd/yyyy"));


                //pro.FEC_NACIMIENTO = DateTime.Parse(this._fec_nacimiento);

                var o_result = new System.Data.Objects.ObjectParameter("O_RESULT", typeof(string));
                //conexion.Entidades.SP_INSERT_PROFESIONAL("12096458-81", "Juanpi", "Adame", "Rivas", "21-09-2020", 123344, "adasd", "adasdas", 1, 13114, "adasd1asdaaaa", "adaasd",o_result);
                conexion.Entidades.SP_INSERT_PROFESIONAL(pro.RUT_PROFESIONAL, pro.NOMBRE, pro.AP_PAT, pro.AP_MAT, pro.FEC_NACIMIENTO.ToString(), pro.TELEFONO, pro.DIRECCION, pro.CORREO, pro.ID_GENERO, pro.ID_COMUNA, cre.USER_CRED, cre.PASSWORD, o_result);

                conexion.Entidades.SaveChanges();
                o_result.ToString();

                return(true);
            }
            catch (Exception es)
            {
                return(false);
            }
        }