コード例 #1
0
        public static Response <TareaMPResponse> IdTareaMP()
        {
            try
            {
                Response <TareaMPResponse> response;
                List <TareaMPEntity>       List;

                List = TareaMPData.IdTareaMP();

                response = new Response <TareaMPResponse>
                {
                    EsCorrecto = true,
                    Valor      = new TareaMPResponse {
                        List = List
                    },
                    Mensaje = "OK",
                    Estado  = true,
                };

                return(response);
            }
            catch (Exception ex)
            {
                return(new Response <TareaMPResponse>(false, null, Functions.MessageError(ex), false));
            }
        }
コード例 #2
0
        public static async Task <Response <TareaMPResponse> > InsertTareaMP(short IdTipMan,
                                                                             string Descripcion, short UsuarioRegistro, string FechaRegistro, int Flg_Revision,
                                                                             int ID_tb_Sistema_Mant, string ID_tb_SubSistema_Mant)
        {
            Response <TareaMPResponse> response;
            TareaMPEntity objTareaMP;

            try
            {
                short idTarea = (short)TareaMPData.IdTareaMP()[0].IdTarea;
                objTareaMP = await TareaMPData.InsertTareaMP(idTarea, IdTipMan, Descripcion, UsuarioRegistro,
                                                             Convert.ToDateTime(FechaRegistro), Flg_Revision, ID_tb_Sistema_Mant, ID_tb_SubSistema_Mant);

                response = new Response <TareaMPResponse>
                {
                    EsCorrecto = true,
                    Valor      = new TareaMPResponse
                    {
                        TareaMP = objTareaMP
                    },
                    Mensaje = "OK",
                    Estado  = true,
                };

                return(response);
            }
            catch (FaultException <ServiceError> )
            {
                throw;
            }
            catch (Exception ex)
            {
                return(new Response <TareaMPResponse>(false, null, Functions.MessageError(ex), false));
            }
        }