예제 #1
0
        public JsonResult RegistrarTest(CAPACITACION_PERSONAL_EL parametros, List <DETALLE_CAPACITACION_PERSONAL_EL> Detalle_Capacitacion)
        {
            string postdata  = js.Serialize(parametros);
            int    respuesta = js.Deserialize <int>(Utilitario.Accion.ConectREST("ICAPACITACION_PERSONAL", "POST", postdata));

            foreach (DETALLE_CAPACITACION_PERSONAL_EL item in Detalle_Capacitacion)
            {
                string postdataP  = js.Serialize(item);
                int    respuestaP = js.Deserialize <int>(Utilitario.Accion.ConectREST("IDETALLE_CAPACITACION_PERSONAL", "POST", postdataP));
            }

            return(Json(new { respuesta = respuesta }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public int InsertCAPACITACION_PERSONAL(CAPACITACION_PERSONAL_EL CP)
        {
            using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
            {
                con.Open();
                using (SqlCommand com = new SqlCommand("spInsertCAPACITACION_PERSONAL", con))
                {
                    com.CommandType = CommandType.StoredProcedure;
                    com.Parameters.Add("@iIdPersonal", SqlDbType.Int).Value              = CP.iIdPersonal;
                    com.Parameters.Add("@iIdCapacitacion", SqlDbType.Int).Value          = CP.iIdCapacitacion;
                    com.Parameters.Add("@iPuntajePersonal", SqlDbType.Int).Value         = CP.iPuntajePersonal;
                    com.Parameters.Add("@vObservacionPersonal", SqlDbType.VarChar).Value = CP.vObservacionPersonal == null ? "" : CP.vObservacionPersonal;
                    com.Parameters.Add("@iAsistenciaPersonal", SqlDbType.Int).Value      = CP.iAsistenciaPersonal;
                    com.Parameters.Add("@iUsuarioCrea", SqlDbType.Int).Value             = CP.iUsuarioCrea;

                    return(com.ExecuteNonQuery());
                }
            }
        }
예제 #3
0
        public JsonResult RegistrarTest(CAPACITACION_PERSONAL_EL parametros, List <DETALLE_CAPACITACION_PERSONAL_EL> Detalle_Capacitacion)
        {
            parametros.iIdPersonal = SesionUsuario.Usuario.Id;
            string postdata = JsonConvert.SerializeObject(parametros);

            foreach (DETALLE_CAPACITACION_PERSONAL_EL item in Detalle_Capacitacion)
            {
                item.iIdDetalleCapacitacionPersonal = 1;
                item.iIdCapacitacionPersonal        = SesionUsuario.Usuario.Id;
            }

            string postdataDetalleCapacitacion = JsonConvert.SerializeObject(Detalle_Capacitacion);

            int respuesta = JsonConvert.DeserializeObject <int>(Utilitario.Accion.Conect_WEBAPI("CAPACITACION_PERSONAL", "POST", postdata));

            int respuestaP = JsonConvert.DeserializeObject <int>(Utilitario.Accion.Conect_WEBAPI("DETALLE_CAPACITACION_PERSONAL", "POST", postdataDetalleCapacitacion));


            return(Json(new { respuesta = respuesta }, JsonRequestBehavior.AllowGet));
        }
예제 #4
0
 public int UpdateCAPACITACION_PERSONAL(CAPACITACION_PERSONAL_EL CP)
 {
     return(CAPACITACION_PERSONAL_DA.Accion.UpdateCAPACITACION_PERSONAL(CP));
 }
예제 #5
0
 public int InsertCAPACITACION_PERSONAL(CAPACITACION_PERSONAL_EL CP)
 {
     return(CAPACITACION_PERSONAL_DA.Accion.InsertCAPACITACION_PERSONAL(CP));
 }
예제 #6
0
        //================================================================

        // CAPACITACION PERSONAL =========================================
        public List <CAPACITACION_PERSONAL_EL> GetAllCAPACITACION_PERSONAL(CAPACITACION_PERSONAL_EL CP)
        {
            return(CAPACITACION_PERSONAL_DA.Accion.GetAllCAPACITACION_PERSONAL(CP));
        }
예제 #7
0
        public List <CAPACITACION_PERSONAL_EL> GetAllCAPACITACION_PERSONAL(CAPACITACION_PERSONAL_EL CP)
        {
            using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
            {
                con.Open();
                using (SqlCommand com = new SqlCommand("spGet_CAPACITACION_PERSONAL", con))
                {
                    com.CommandType = CommandType.StoredProcedure;
                    com.Parameters.Add("@iIdCapacitacionPersonal", SqlDbType.Int).Value = CP.iIdCapacitacionPersonal;

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

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

                            if (dataReader["iIdCapacitacionPersonal"] != DBNull.Value)
                            {
                                obj.iIdCapacitacionPersonal = (int)dataReader["iIdCapacitacionPersonal"];
                            }
                            if (dataReader["iIdPersonal"] != DBNull.Value)
                            {
                                obj.iIdPersonal = (int)dataReader["iIdPersonal"];
                            }
                            if (dataReader["iIdCapacitacion"] != DBNull.Value)
                            {
                                obj.iIdCapacitacion = (int)dataReader["iIdCapacitacion"];
                            }
                            if (dataReader["iPuntajePersonal"] != DBNull.Value)
                            {
                                obj.iPuntajePersonal = (int)dataReader["iPuntajePersonal"];
                            }
                            if (dataReader["vObservacionPersonal"] != DBNull.Value)
                            {
                                obj.vObservacionPersonal = (string)dataReader["vObservacionPersonal"];
                            }
                            if (dataReader["iAsistenciaPersonal"] != DBNull.Value)
                            {
                                obj.iAsistenciaPersonal = (int)dataReader["iAsistenciaPersonal"];
                            }
                            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);
                }
            }
        }
 public int Put(int id, CAPACITACION_PERSONAL_EL value)
 {
     return(CAPACITACION_PERSONAL_DA.Accion.UpdateCAPACITACION_PERSONAL(value));
 }
 public int POST(CAPACITACION_PERSONAL_EL value)
 {
     return(CAPACITACION_PERSONAL_DA.Accion.InsertCAPACITACION_PERSONAL(value));
 }