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)); }
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)); }
public EntityProducto Update(EntityProducto oEntityProducto) { try { return(ProductooApp.Update(oEntityProducto)); } catch (Exception) { throw new FaultException("Error al actualizar Productos"); } }
public IList <EntityProducto> Select(EntityProducto oEntityProducto) { try { return(ProductooApp.Select(oEntityProducto)); } catch (Exception ex) { throw ex; } }
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; } }
public EntityProducto Update(EntityProducto oEntityProducto, CTransaction transaction) { try { DataProductoRepository data = new DataProductoRepository(oEntityProducto, "producto"); return(data.Update(transaction)); } catch (Exception ex) { throw ex; } }
public IList <EntityProducto> Select(EntityProducto oEntityProducto, CTransaction oCTransaction) { try { DataProductoRepository data = new DataProductoRepository(oEntityProducto, "producto"); return(data.Select(oCTransaction)); } catch (Exception ex) { throw ex; } }
public EntityProducto Update(EntityProducto oEntityProducto) { try { using (ProductoServices.ProductoServicesClient oProducto = new ProductoServices.ProductoServicesClient()) { return(oProducto.Update(oEntityProducto)); } } catch (Exception ex) { throw ex; } }
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"); } }
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; } }
public EntityProducto Delete(EntityProducto oValue, CTransaction transaction) { throw new NotImplementedException(); }