示例#1
0
        public RespuestaSP SP_GrabarCompra(SG_COMPRAS comp, int ID_USR)
        {
            RespuestaSP result = new RespuestaSP();
            ExecuteManager(uow =>
            {
                //var manager = new SG_INGRESOSManager(uow);
                var context = (CityTruckContext)uow.Context;
                ObjectParameter p_res = new ObjectParameter("p_res", typeof(String));
                context.P_SG_GUARDAR_COMPRAS(comp.ID_COMPRA, comp.FECHA, comp.ID_COMBUSTIBLE, comp.ID_CAJA, comp.CANTIDAD,
                    comp.NRO_FACTURA, comp.TIPO, comp.PRECIO, comp.IMPORTE, comp.TOTAL, ID_USR, p_res);
                //if (p_res.Value.ToString() == "1")
                //{
                result.success = true;
                result.msg = p_res.Value.ToString();
                //}
                //else
                //{
                //    result.success = false;
                //    result.msg = p_res.Value.ToString();
                //}

            });
            return result;
        }
示例#2
0
 public JsonResult GuardarCompra(SG_COMPRAS comp, string detalles)
 {
     int id_usr = Convert.ToInt32(User.Identity.Name.Split('-')[3]);
     RespuestaSP respuestaSP = new RespuestaSP();
     respuestaSP = _serCmp.SP_GrabarCompra(comp, id_usr);
     int id_compra;
     bool esNumero = int.TryParse(respuestaSP.msg, out id_compra);
     if (esNumero)
     {
         if (detalles != "false")
         {
             dynamic det = JsonConvert.DeserializeObject(detalles);
             foreach (var item in det)
             {
                 SG_DETALLES_COMPRAS detalleCompra = new SG_DETALLES_COMPRAS()
                 {
                     ID_DETALLE = item.ID_DETALLE,
                     DETALLE = item.DETALLE,
                     ID_COMPRA = id_compra,
                     IMPORTE = item.SIMPORTE,
                 };
                 respuestaSP = _serCmp.SP_GrabarDetalleCompra(detalleCompra, id_usr);
             }
         }
         else {
             respuestaSP.msg = "Proceso Ejecutado Correctamente...";
         }
     }
     else
     {
         respuestaSP.success = false;
     }
     respuestaSP.id = id_compra;
     return Json(respuestaSP);
 }
示例#3
0
 /// <summary>
 /// Método desusado para agregar un nuevo objeto al EntitySet SG_COMPRAS. Considere la posibilidad de usar el método .Add de la propiedad ObjectSet&lt;T&gt; asociada.
 /// </summary>
 public void AddToSG_COMPRAS(SG_COMPRAS sG_COMPRAS)
 {
     base.AddObject("SG_COMPRAS", sG_COMPRAS);
 }
示例#4
0
 /// <summary>
 /// Crear un nuevo objeto SG_COMPRAS.
 /// </summary>
 /// <param name="iD_COMPRA">Valor inicial de la propiedad ID_COMPRA.</param>
 /// <param name="nRO_COMP">Valor inicial de la propiedad NRO_COMP.</param>
 /// <param name="fECHA">Valor inicial de la propiedad FECHA.</param>
 /// <param name="iD_COMBUSTIBLE">Valor inicial de la propiedad ID_COMBUSTIBLE.</param>
 /// <param name="iD_CAJA">Valor inicial de la propiedad ID_CAJA.</param>
 /// <param name="cANTIDAD">Valor inicial de la propiedad CANTIDAD.</param>
 /// <param name="nRO_FACTURA">Valor inicial de la propiedad NRO_FACTURA.</param>
 /// <param name="tIPO">Valor inicial de la propiedad TIPO.</param>
 /// <param name="pRECIO">Valor inicial de la propiedad PRECIO.</param>
 /// <param name="iMPORTE">Valor inicial de la propiedad IMPORTE.</param>
 /// <param name="fORMULARIO">Valor inicial de la propiedad FORMULARIO.</param>
 /// <param name="tOTAL">Valor inicial de la propiedad TOTAL.</param>
 /// <param name="iD_USUARIO">Valor inicial de la propiedad ID_USUARIO.</param>
 public static SG_COMPRAS CreateSG_COMPRAS(global::System.Int32 iD_COMPRA, global::System.Int32 nRO_COMP, global::System.DateTime fECHA, global::System.Int16 iD_COMBUSTIBLE, global::System.Int32 iD_CAJA, global::System.Decimal cANTIDAD, global::System.Int64 nRO_FACTURA, global::System.String tIPO, global::System.Decimal pRECIO, global::System.Decimal iMPORTE, global::System.Decimal fORMULARIO, global::System.Decimal tOTAL, global::System.Int16 iD_USUARIO)
 {
     SG_COMPRAS sG_COMPRAS = new SG_COMPRAS();
     sG_COMPRAS.ID_COMPRA = iD_COMPRA;
     sG_COMPRAS.NRO_COMP = nRO_COMP;
     sG_COMPRAS.FECHA = fECHA;
     sG_COMPRAS.ID_COMBUSTIBLE = iD_COMBUSTIBLE;
     sG_COMPRAS.ID_CAJA = iD_CAJA;
     sG_COMPRAS.CANTIDAD = cANTIDAD;
     sG_COMPRAS.NRO_FACTURA = nRO_FACTURA;
     sG_COMPRAS.TIPO = tIPO;
     sG_COMPRAS.PRECIO = pRECIO;
     sG_COMPRAS.IMPORTE = iMPORTE;
     sG_COMPRAS.FORMULARIO = fORMULARIO;
     sG_COMPRAS.TOTAL = tOTAL;
     sG_COMPRAS.ID_USUARIO = iD_USUARIO;
     return sG_COMPRAS;
 }