public Boolean ActualizarEstadoAprob(com_ListadoElementos_x_OT_Det_Info Info, ref string msg) { try { using (EntitiesCompras_Edehsa context = new EntitiesCompras_Edehsa()) { var contact = context.com_ListadoElementos_x_OT_Det.FirstOrDefault(obj => obj.IdEmpresa == Info.IdEmpresa && obj.IdListadoElementos_x_OT == Info.IdListadoElementos_x_OT && obj.IdDetalle == Info.IdDetalle); if (contact != null) { contact.IdEstadoAprob = Info.lm_IdEstadoAprobado; context.SaveChanges(); msg = "Se ha procedido actualizar elListado de Elementos #: " + Info.IdListadoElementos_x_OT.ToString() + " 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.InnerException + " " + ex.Message; msg = "Se ha producido el siguiente error: " + ex.Message; throw new Exception(ex.ToString()); } }
public List <com_ListadoElementos_x_OT_Det_Info> Get_List_ListadoElementos_x_OT_Det(int IdEmpresa, decimal idLstMater) { List <com_ListadoElementos_x_OT_Det_Info> Lst = new List <com_ListadoElementos_x_OT_Det_Info>(); EntitiesCompras_Edehsa oEnti = new EntitiesCompras_Edehsa(); try { var Query = from q in oEnti.vwcom_ListadoElementos_x_OT_Detalle where q.IdEmpresa == IdEmpresa && q.IdListadoElementos_x_OT == idLstMater select q; foreach (var item in Query) { com_ListadoElementos_x_OT_Det_Info Obj = new com_ListadoElementos_x_OT_Det_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdOrdenTaller = item.IdOrdenTaller; Obj.IdListadoElementos_x_OT = item.IdListadoElementos_x_OT; Obj.IdDetalle = item.IdDetalle; Obj.IdProducto = item.IdProducto; Obj.pr_largo = item.pr_largo; Obj.largo_total = item.largo_total; Obj.Unidades = item.Unidades; Obj.Det_Kg = item.Det_Kg; Obj.CodObra = item.CodObra; Obj.pr_codigo = item.pr_codigo; Obj.pr_descripcion = item.pr_descripcion; Obj.lm_IdEstadoAprobado = item.IdEstadoAprob; Obj.largo_pieza_entera = item.largo_pieza_entera; Obj.cantidad_pieza_entera = item.cantidad_pieza_entera; Obj.largo_pieza_complementaria = item.largo_pieza_complementaria; Obj.cantidad_pieza_complementaria = item.cantidad_pieza_complementaria; Obj.cantidad_total_pieza_complementaria = item.cantidad_total_pieza_complementaria; Obj.largo_despunte1 = item.largo_despunte1; Obj.cantidad_despunte1 = item.cantidad_despunte1; Obj.es_despunte_usable1 = item.es_despunte_usable1; Obj.largo_despunte2 = item.largo_despunte2; Obj.cantidad_despunte2 = item.cantidad_despunte2; Obj.es_despunte_usable2 = item.es_despunte_usable2; Lst.Add(Obj); } return(Lst); } 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(); throw new Exception(ex.ToString()); } }
public Boolean ActualizarEstadoAprob(com_ListadoElementos_x_OT_Det_Info Info, ref string msg) { try { return(Data.ActualizarEstadoAprob(Info, ref msg)); } catch (Exception ex) { Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message); throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ActualizarEstadoAprob", ex.Message), ex) { EntityType = typeof(com_ListadoElementos_x_OT_Det_Bus) }; } }
public List <com_ListadoElementos_x_OT_Det_Info> Get_List_ListadoDespunteMateriales_Det(int IdEmpresa, string CodObra) { List <com_ListadoElementos_x_OT_Det_Info> Lst = new List <com_ListadoElementos_x_OT_Det_Info>(); EntitiesCompras_Edehsa oEnti = new EntitiesCompras_Edehsa(); try { var Query = from q in oEnti.vwcom_AllListDetElementos_x_OT where q.IdEmpresa == IdEmpresa && q.CodObra == CodObra && q.largo_despunte1 != null select q; foreach (var item in Query) { com_ListadoElementos_x_OT_Det_Info Obj = new com_ListadoElementos_x_OT_Det_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdOrdenTaller = item.IdOrdenTaller; Obj.ot_IdSucursal = item.IdSucursal; Obj.IdListadoElementos_x_OT = item.IdListadoElementos_x_OT; Obj.IdDetalle = item.IdDetalle; Obj.IdProducto = item.IdProducto; Obj.Unidades = item.Unidades; Obj.Det_Kg = item.Det_Kg; Obj.CodObra = item.CodObra; Obj.pr_codigo = item.pr_codigo; Obj.pr_descripcion = item.pr_descripcion; Obj.lm_IdEstadoAprobado = item.IdEstadoAprob; Obj.ea_codigo = item.IdEstadoAprob; Obj.FechaRequer = item.FechaReg; Obj.mr_descripcion = item.mr_descripcion; Obj.Motivo = item.Motivo; Obj.ob_descripcion = item.ob_descripcion; Obj.ot_codigo = item.ot_descripcion; Obj.obra = item.ob_descripcion; Obj.largo_restante = item.largo_restante; Obj.producto = item.pr_descripcion + "[" + item.pr_codigo + "/" + item.IdProducto + "] "; Obj.solicitante = item.Usuario; Obj.largo_pieza_entera = item.largo_pieza_entera; Obj.cantidad_pieza_entera = item.cantidad_pieza_entera; Obj.largo_pieza_complementaria = item.largo_pieza_complementaria; Obj.cantidad_pieza_complementaria = item.cantidad_pieza_complementaria; Obj.cantidad_total_pieza_complementaria = item.cantidad_total_pieza_complementaria; Obj.largo_despunte1 = item.largo_despunte1; Obj.cantidad_despunte1 = item.cantidad_despunte1; Obj.es_despunte_usable1 = item.es_despunte_usable1; Obj.largo_despunte2 = item.largo_despunte2; Obj.cantidad_despunte2 = item.cantidad_despunte2; Obj.es_despunte_usable2 = item.es_despunte_usable2; Lst.Add(Obj); } return(Lst); } 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(); throw new Exception(ex.ToString()); } }