public in_Producto_Dimensiones Get_Info_Producto_Dimensiones(int IdProducto, int IdEmpresa) { try { in_Producto_Dimensiones producto_dimensiones = new in_Producto_Dimensiones(); EntitiesInventarioEdehsa OEt = new EntitiesInventarioEdehsa(); var productodimensiones = OEt.in_Producto_Dimensiones.First(var => var.IdProducto == IdProducto && var.IdEmpresa == IdEmpresa); //producto_dimensiones.Secuencia = productodimensiones.Secuencia; producto_dimensiones.longitud = productodimensiones.longitud; producto_dimensiones.espesor = productodimensiones.espesor; producto_dimensiones.ancho = productodimensiones.ancho; producto_dimensiones.alto = productodimensiones.alto; producto_dimensiones.ceja = productodimensiones.ceja; producto_dimensiones.diametro = productodimensiones.diametro; producto_dimensiones.estado = productodimensiones.estado; return(producto_dimensiones); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GrabarDB(in_Producto_Dimensiones_Info info, ref decimal IdProducto, ref string mensaje) { try { using (EntitiesInventarioEdehsa context = new EntitiesInventarioEdehsa()) { var address = new in_Producto_Dimensiones(); //int idpv = GetSecuencia(info.IdEmpresa,); // id = idpv; address.IdEmpresa = info.IdEmpresa; //address.Secuencia = GetSecuencia(info.IdEmpresa,1); address.IdProducto = IdProducto; address.longitud = info.longitud; address.espesor = info.espesor; address.ancho = info.ancho; address.alto = info.alto; address.ceja = info.ceja; address.diametro = info.diametro; address.estado = info.estado; context.in_Producto_Dimensiones.Add(address); context.SaveChanges(); mensaje = "Se ha procedido a grabar el registro de las Dimensiones del Producto" //+ info.tp_descripcion + " exitosamente."; } return(true); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; mensaje = "Se ha producido el siguiente error: " + ex.Message; throw new Exception(mensaje); } }
public List <in_Producto_Dimensiones> Get_ListProducto_Dimensiones() { try { List <in_Producto_Dimensiones> lM = new List <in_Producto_Dimensiones>(); EntitiesInventarioEdehsa OEUser = new EntitiesInventarioEdehsa(); //Core.Erp.Data.Inventario_Edehsa. var select_ = from TI in OEUser.in_Producto_Dimensiones select TI; foreach (var item in select_) { in_Producto_Dimensiones dat_ = new in_Producto_Dimensiones(); dat_.IdEmpresa = item.IdEmpresa; dat_.IdProducto = item.IdProducto; //dat_.Secuencia = item.Secuencia; dat_.longitud = item.longitud; dat_.espesor = item.espesor; dat_.ancho = item.ancho; dat_.alto = item.alto; dat_.ceja = item.ceja; dat_.diametro = item.diametro; dat_.estado = item.estado; lM.Add(dat_); } return(lM); } catch (Exception ex) { string arreglo = ToString(); tb_sis_Log_Error_Vzen_Data oDataLog = new tb_sis_Log_Error_Vzen_Data(); tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now); oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); mensaje = ex.ToString() + " " + ex.Message; throw new Exception(ex.ToString()); } }