Пример #1
0
 /// <summary>
 /// AGREGAR VISITA
 /// </summary>
 /// <param name="oBe"></param>
 public void P0008SHPR_VISI(BESHMC_VISI oBe)
 {
     try
     {
         oDa.P0008SHPR_VISI(oBe);
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
Пример #2
0
        public HttpResponseMessage P0005SHPR_USUA(BESHMC_VISI oBe)
        {
            var oBr = new BRSHMC_VISI();

            try
            {
                oBr.P0008SHPR_VISI(oBe);
                return(Request.CreateResponse(HttpStatusCode.OK, oBe));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Пример #3
0
 /// <summary>
 /// GENERAR VISITA
 /// </summary>
 /// <param name="oBe"></param>
 public void P0008SHPR_VISI(BESHMC_VISI oBe)
 {
     try
     {
         oDb  = oDg.getDataBase();
         oCon = oDg.getConnection();
         if (oCon.State == ConnectionState.Closed)
         {
             oCon.Open();
         }
         using (var obts = oCon.BeginTransaction())
         {
             try
             {
                 using (var ocmd = oDb.GetStoredProcCommand("P0008SHPR_VISI", oBe.COD_VISI,
                                                            oBe.COD_AGEN,
                                                            oBe.COD_MORO,
                                                            oBe.FEC_VISI,
                                                            oBe.ALF_GPSS_PART,
                                                            oBe.ALF_GPSS_LLEG,
                                                            oBe.COD_USUA_CREA,
                                                            oBe.NUM_ACCI))
                 {
                     ocmd.CommandTimeout = 2000;
                     oDb.ExecuteNonQuery(ocmd, obts);
                     oBe.COD_VISI = Convert.ToInt32(oDb.GetParameterValue(ocmd, "@P0008COD_VISI"));
                     obts.Commit();
                 }
             }
             catch (Exception ex)
             {
                 obts.Rollback();
                 throw new ArgumentException(ex.Message);
             }
         }
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
     finally
     {
         oCon.Close();
     }
 }