示例#1
0
        public JsonResult RegistrarCapacitacion(GESTION_CAPACITACION_EL GestionCapacitacion, List <PREGUNTA_EL> _Preguntas, List <CAPACITACION_PERSONAL_EL> _CapacitacionPersonal, List <ExpositorExterno_EL> _ExpositorExterno)
        {
            var xmlPreguntas            = Utilitario.Serialize(_Preguntas).Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", "").Replace("<? xml version = \"1.0\" encoding = \"UTF-8\" ?>", "");
            var xmlCapacitacionPersonal = Utilitario.Serialize(_CapacitacionPersonal).Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", "").Replace("<? xml version = \"1.0\" encoding = \"UTF-8\" ?>", "");
            var xmlExpositorExterno     = Utilitario.Serialize(_ExpositorExterno).Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", "").Replace("<? xml version = \"1.0\" encoding = \"UTF-8\" ?>", "");

            GestionCapacitacion.XMLPreguntas            = xmlPreguntas;
            GestionCapacitacion.XMLCapacitacionPersonal = xmlCapacitacionPersonal;
            GestionCapacitacion.xmlExpositorExterno     = xmlExpositorExterno;

            string    postdata  = JsonConvert.SerializeObject(GestionCapacitacion);
            Respuesta respuesta = JsonConvert.DeserializeObject <Respuesta>(Utilitario.Accion.Conect_WEBAPI("GESTION_CAPACITACION", "POST", postdata));

            var CorreoOperarios = JsonConvert.DeserializeObject <string>(Utilitario.Accion.Conect_WEBAPI("CAPACITACION_PERSONAL/GETOPERADORCORREO", "GET", "", GestionCapacitacion.iIdCapacitacion.ToString()));
            var res             = Utilitario.Accion.EnvioCorreo(CorreoOperarios, "Capacitación " + GestionCapacitacion.dFechaRealizacionCapacitacion.ToString().Substring(0, 10), "Estimado Colaborador: <br /><br />Se comunica que usted ha sido invitado a participar de una capacitación el día " + GestionCapacitacion.dFechaRealizacionCapacitacion.ToString().Substring(0, 10) + ", que iniciara a las " + GestionCapacitacion.tHoraInicio.ToString() + " hasta " + GestionCapacitacion.tHoraFin.ToString() + " <br /><br />Esperando su asistencia.<br /><br />Saludos");

            return(Json(new { respuesta = respuesta, JsonRequestBehavior.AllowGet }));
        }
示例#2
0
        public int UpdateGESTION_CAPACITACION(GESTION_CAPACITACION_EL GC)
        {
            using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
            {
                con.Open();
                using (SqlCommand com = new SqlCommand("spUpdateGESTION_CAPACITACION", con))
                {
                    com.CommandType = CommandType.StoredProcedure;
                    com.Parameters.Add("@iIdGestionCapacitacion", SqlDbType.Int).Value         = GC.iIdGestionCapacitacion;
                    com.Parameters.Add("@iIdCapacitacion", SqlDbType.Int).Value                = GC.iIdCapacitacion;
                    com.Parameters.Add("@iIdRepresentante", SqlDbType.Int).Value               = GC.iIdRepresentante;
                    com.Parameters.Add("@dFechaRealizacionCapacitacion", SqlDbType.Date).Value = GC.dFechaRealizacionCapacitacion;
                    com.Parameters.Add("@tHoraInicio", SqlDbType.Time).Value = GC.tHoraInicio;
                    com.Parameters.Add("@tHoraFin", SqlDbType.Time).Value    = GC.tHoraFin;
                    com.Parameters.Add("@iTiempoTest", SqlDbType.Int).Value  = GC.iTiempoTest;
                    com.Parameters.Add("@iUsuarioMod", SqlDbType.Int).Value  = GC.iUsuarioCrea;

                    return(com.ExecuteNonQuery());
                }
            }
        }
示例#3
0
 public Respuesta InsertGESTION_CAPACITACION(GESTION_CAPACITACION_EL GC)
 {
     using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
     {
         con.Open();
         using (SqlCommand com = new SqlCommand("spInsertGESTION_CAPACITACION", con))
         {
             Respuesta error = new Respuesta();
             try
             {
                 int respuesta = 0;
                 com.CommandType = CommandType.StoredProcedure;
                 com.Parameters.Add("@iIdCapacitacion", SqlDbType.Int).Value  = GC.iIdCapacitacion;
                 com.Parameters.Add("@iIdRepresentante", SqlDbType.Int).Value = GC.iIdRepresentante;
                 com.Parameters.Add("@dFechaRealizacionCapacitacion", SqlDbType.Date).Value = GC.dFechaRealizacionCapacitacion;
                 com.Parameters.Add("@tHoraInicio", SqlDbType.Time).Value            = GC.tHoraInicio;
                 com.Parameters.Add("@tHoraFin", SqlDbType.Time).Value               = GC.tHoraFin;
                 com.Parameters.Add("@iTiempoTest", SqlDbType.Int).Value             = GC.iTiempoTest;
                 com.Parameters.Add("@iUsuarioCrea", SqlDbType.Int).Value            = GC.iUsuarioCrea;
                 com.Parameters.Add("@nLatitud", SqlDbType.Float).Value              = GC.nLatitud;
                 com.Parameters.Add("@nLongitud", SqlDbType.Float).Value             = GC.nLongitud;
                 com.Parameters.Add("@iTipoExpositor", SqlDbType.Int).Value          = GC.iTipoExpositor;
                 com.Parameters.Add("@XMLPreguntas", SqlDbType.Xml).Value            = GC.XMLPreguntas;
                 com.Parameters.Add("@XMLCapacitacionPersonal", SqlDbType.Xml).Value = GC.XMLCapacitacionPersonal;
                 com.Parameters.Add("@xmlExpositorExterno", SqlDbType.Xml).Value     = GC.xmlExpositorExterno;
                 respuesta    = com.ExecuteNonQuery();
                 error.codigo = respuesta;
             }
             catch (Exception e)
             {
                 error.codigo  = -1;
                 error.Mensaje = e.Message;
             }
             return(error);
         }
     }
 }
示例#4
0
        public JsonResult RegistrarCapacitacion(GESTION_CAPACITACION_EL GestionCapacitacion, List <PREGUNTA_EL> _Preguntas, List <OPCION_PREGUNTA_EL> _Respuestas)
        {
            string perosnalizaicon = "1";
            string postdata        = js.Serialize(GestionCapacitacion);
            int    respuesta       = js.Deserialize <int>(Utilitario.Accion.ConectREST("ICAPACITACION", "POST", postdata));

            foreach (PREGUNTA_EL item in _Preguntas)
            {
                string postdataP  = js.Serialize(item);
                int    respuestaP = js.Deserialize <int>(Utilitario.Accion.ConectREST("IPREGUNTA", "POST", postdataP));
                foreach (OPCION_PREGUNTA_EL itemR in _Respuestas)
                {
                    if (item.iIdPregunta == itemR.iIdPregunta)
                    {
                        string postdataR  = js.Serialize(itemR);
                        int    respuestaR = js.Deserialize <int>(Utilitario.Accion.ConectREST("IOPCION_PREGUNTA", "POST", postdataR));
                    }
                }
            }



            return(Json(new { perosnalizaicon = perosnalizaicon, JsonRequestBehavior.AllowGet }));
        }
示例#5
0
        public List <GESTION_CAPACITACION_EL> GetAllGESTION_CAPACITACION(GESTION_CAPACITACION_EL GC)
        {
            using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
            {
                con.Open();
                using (SqlCommand com = new SqlCommand("spGet_GESTION_CAPACITACION", con))
                {
                    com.CommandType = CommandType.StoredProcedure;
                    com.Parameters.Add("@iIdGestionCapacitacion", SqlDbType.Int).Value = GC.iIdGestionCapacitacion;


                    List <GESTION_CAPACITACION_EL> list = new List <GESTION_CAPACITACION_EL>();

                    using (IDataReader dataReader = com.ExecuteReader())
                    {
                        while (dataReader.Read())
                        {
                            GESTION_CAPACITACION_EL obj = new GESTION_CAPACITACION_EL();

                            if (dataReader["iIdGestionCapacitacion"] != DBNull.Value)
                            {
                                obj.iIdGestionCapacitacion = (int)dataReader["iIdGestionCapacitacion"];
                            }
                            if (dataReader["iIdCapacitacion"] != DBNull.Value)
                            {
                                obj.iIdCapacitacion = (int)dataReader["iIdCapacitacion"];
                            }
                            if (dataReader["iIdRepresentante"] != DBNull.Value)
                            {
                                obj.iIdRepresentante = (int)dataReader["iIdRepresentante"];
                            }
                            if (dataReader["dFechaRealizacionCapacitacion"] != DBNull.Value)
                            {
                                obj.dFechaRealizacionCapacitacion = (DateTime)dataReader["dFechaRealizacionCapacitacion"];
                            }
                            if (dataReader["tHoraInicio"] != DBNull.Value)
                            {
                                obj.tHoraInicio = (string)dataReader["tHoraInicio"];
                            }
                            if (dataReader["tHoraFin"] != DBNull.Value)
                            {
                                obj.tHoraFin = (string)dataReader["tHoraFin"];
                            }
                            if (dataReader["iTiempoTest"] != DBNull.Value)
                            {
                                obj.iTiempoTest = (int)dataReader["iTiempoTest"];
                            }
                            if (dataReader["iUsuarioCrea"] != DBNull.Value)
                            {
                                obj.iUsuarioCrea = (int)dataReader["iUsuarioCrea"];
                            }
                            if (dataReader["dFechaCrea"] != DBNull.Value)
                            {
                                obj.dFechaCrea = (DateTime)dataReader["dFechaCrea"];
                            }
                            if (dataReader["iUsuarioMod"] != DBNull.Value)
                            {
                                obj.iUsuarioMod = (int)dataReader["iUsuarioMod"];
                            }
                            if (dataReader["dFechaMod"] != DBNull.Value)
                            {
                                obj.dFechaMod = (DateTime)dataReader["dFechaMod"];
                            }

                            list.Add(obj);
                        }
                    }

                    return(list);
                }
            }
        }
示例#6
0
 public int UpdateGESTION_CAPACITACION(GESTION_CAPACITACION_EL GC)
 {
     return(GESTION_CAPACITACION_DA.Accion.UpdateGESTION_CAPACITACION(GC));
 }
示例#7
0
 public int InsertGESTION_CAPACITACION(GESTION_CAPACITACION_EL GC)
 {
     return(GESTION_CAPACITACION_DA.Accion.InsertGESTION_CAPACITACION(GC));
 }
示例#8
0
        //================================================================

        // GESTION CAPACITACION ==================================================
        public List <GESTION_CAPACITACION_EL> GetAllGESTION_CAPACITACION(GESTION_CAPACITACION_EL GC)
        {
            return(GESTION_CAPACITACION_DA.Accion.GetAllGESTION_CAPACITACION(GC));
        }
示例#9
0
 public int Put(int id, GESTION_CAPACITACION_EL value)
 {
     return(GESTION_CAPACITACION_DA.Accion.UpdateGESTION_CAPACITACION(value));
 }
示例#10
0
 public Respuesta POST(GESTION_CAPACITACION_EL value)
 {
     return(GESTION_CAPACITACION_DA.Accion.InsertGESTION_CAPACITACION(value));
 }