Esempio n. 1
0
        public ActionResult Edit(KeyProducto key)
        {
            ProductoServicesController oServices      = new ProductoServicesController();
            GrupoServicesController    oGrupoServices = new GrupoServicesController();

            EntityProducto oEntityProducto = oServices.SelectByKey(key);

            ProductoViewModel oProductoViewModel = new ProductoViewModel();

            oProductoViewModel.EntityProducto = oEntityProducto;

            oProductoViewModel.ListGrupo = oGrupoServices.Select
                                               (new EntityGrupo
            {
                IDGrupoPadre = Constantes.UnoNegativo,
                Key          = new KeyGrupo {
                    IDGrupo = Constantes.UnoNegativo
                }
            }
                                               );

            oProductoViewModel.EditableCantidadinventario = Constantes.Falso;

            return(PartialView(Constantes.ProductoEdit, oProductoViewModel));
        }
Esempio n. 2
0
        public JsonResult  GuardarProducto(ProductoViewModel oProductoViewModel)
        {
            List <String> resultado = new List <String>();

            resultado.Add("true");
            resultado.Add(Constantes.GuardadoExitoso);

            ProductoServicesController oServices = new ProductoServicesController();

            try
            {
                EntityProducto oEntityProductoExists = oServices.SelectByKey(oProductoViewModel.EntityProducto.Key);

                if (Constantes.Cero != oEntityProductoExists.Key.IDProducto)
                {
                    oServices.Update(oProductoViewModel.EntityProducto);
                }
                else
                {
                    oServices.AgregarProducto(oProductoViewModel.EntityProducto);
                }
            }
            catch (Exception)
            {
                resultado[0] = "false";
                resultado[1] = Constantes.GuardadoNoExitoso;
            }

            return(Json(resultado, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
 public EntityProducto Update(EntityProducto oEntityProducto)
 {
     try
     {
         return(ProductooApp.Update(oEntityProducto));
     }
     catch (Exception)
     {
         throw new FaultException("Error al actualizar Productos");
     }
 }
Esempio n. 4
0
 public IList <EntityProducto> Select(EntityProducto oEntityProducto)
 {
     try
     {
         return(ProductooApp.Select(oEntityProducto));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 5
0
 public EntityProducto Insert(EntityProducto oEntityProducto)
 {
     try
     {
         return(ProductooApp.Insert(oEntityProducto));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public IList <EntityProducto> Select(EntityProducto oEntityProducto)
 {
     try
     {
         CTransaction oCTransaction = CTransaction.Empty;
         return(Repo.Select(oEntityProducto, oCTransaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 7
0
 public EntityProducto Update(EntityProducto oEntityProducto, CTransaction transaction)
 {
     try
     {
         DataProductoRepository data = new DataProductoRepository(oEntityProducto, "producto");
         return(data.Update(transaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 8
0
 public IList <EntityProducto> Select(EntityProducto oEntityProducto, CTransaction oCTransaction)
 {
     try
     {
         DataProductoRepository data = new DataProductoRepository(oEntityProducto, "producto");
         return(data.Select(oCTransaction));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 9
0
 public EntityProducto Update(EntityProducto oEntityProducto)
 {
     try
     {
         using (ProductoServices.ProductoServicesClient oProducto = new ProductoServices.ProductoServicesClient())
         {
             return(oProducto.Update(oEntityProducto));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 10
0
 public EntityProducto AgregarProducto(EntityProducto oEntityEmploye)
 {
     try
     {
         using (ProductoServices.ProductoServicesClient client = new ProductoServices.ProductoServicesClient())
         {
             return(client.Insert(oEntityEmploye));
         }
     }
     catch (Exception)
     {
         throw new FaultException("Error al insertar Producto");
     }
 }
Esempio n. 11
0
        public EntityProducto Insert(EntityProducto entity, CTransaction transaction)
        {
            try
            {
                DataProductoRepository data = new DataProductoRepository(entity, "producto");

                entity = data.Insert(transaction);
                KeyProducto key = new KeyProducto(DataCreator.CreateInt32(data.CollectionParams.GetParameter("IDProducto").Value));
                entity.Key = key;
                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
 public EntityProducto Delete(EntityProducto oValue, CTransaction transaction)
 {
     throw new NotImplementedException();
 }