private void btnNuevoAlmacen_Click(object sender, EventArgs e) { FrmSelectedEntity FrmSeleccionarPanel = new FrmSelectedEntity(); String filtro = "id not in ("; String ids = ""; foreach (ExistenciaAlmacen Item in Existencia.Almacenes) { ids = ids + "'" + Item.Almacen.ID + "',"; } if (ids.Length > 0) { filtro = filtro + ids.Substring(0, ids.Length - 1) + ")"; } else { filtro = ""; } Almacen almacen = (Almacen)FrmSeleccionarPanel.GetSelectedEntity(typeof(Almacen), "Almacen", filtro); if (almacen != null) { UltraGridRow Row = grillaAlmacenes.DisplayLayout.Bands[0].AddNew(); Row.Tag = this.Existencia.AddItemAlmacen(); ExistenciaAlmacen item = (ExistenciaAlmacen)Row.Tag; item.Almacen = almacen; MostrarAlmacen(Row); } }
public void MostrarAlmacen(UltraGridRow Row) { ExistenciaAlmacen item = (ExistenciaAlmacen)Row.Tag; Row.Cells[colAlmacen].Value = item.Almacen.Nombre; Row.Cells[colStockFisico].Value = item.StockFisico; Row.Cells[colStockComprometido].Value = item.StockComprometido; }
public ActionResult Edit(ExistenciaAlmacen existenciaAlmacen) { try { var exist = _db.Set <ExistenciaAlmacen>().Find(existenciaAlmacen.Id); exist.ExistenciaEnAlmacen = existenciaAlmacen.ExistenciaEnAlmacen; _db.Entry(exist).State = EntityState.Modified; _db.SaveChanges(); TempData["exito"] = "Existencia modificada correctamente"; return(RedirectToAction("Index")); } catch { return(View()); } }