public in_movi_inve_detalle_x_com_ordencompra_local_det_Info Get_Info_in_movi_inve_detalle_x_com_ordencompra_local_det(in_movi_inve_detalle_Info MovInv) { try { in_movi_inve_detalle_x_com_ordencompra_local_det_Info Obj = new in_movi_inve_detalle_x_com_ordencompra_local_det_Info(); EntitiesInventario oEnti = new EntitiesInventario(); var Query = from q in oEnti.in_movi_inve_detalle_x_com_ordencompra_local_det where q.mi_IdEmpresa == MovInv.IdEmpresa && q.mi_IdSucursal == MovInv.IdSucursal && q.mi_IdBodega == MovInv.IdBodega && q.mi_IdMovi_inven_tipo == MovInv.IdMovi_inven_tipo && q.mi_IdNumMovi == MovInv.IdNumMovi && q.mi_Secuencia == MovInv.Secuencia select q; foreach (var item in Query) { Obj.mi_IdEmpresa = item.mi_IdEmpresa; Obj.mi_IdSucursal = item.mi_IdSucursal; Obj.mi_IdBodega = item.mi_IdBodega; Obj.mi_IdMovi_inven_tipo = item.mi_IdMovi_inven_tipo; Obj.mi_IdNumMovi = item.mi_IdNumMovi; Obj.mi_Secuencia = item.mi_Secuencia; Obj.ocd_IdEmpresa = item.ocd_IdEmpresa; Obj.ocd_IdSucursal = item.ocd_IdSucursal; Obj.ocd_IdOrdenCompra = item.ocd_IdOrdenCompra; Obj.ocd_Secuencia = item.ocd_Secuencia; } return(Obj); } 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); mensaje = ex.ToString() + " " + ex.Message; oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje); throw new Exception(ex.ToString()); } }
public void setcab(in_movi_inve_Info Info) { try { InfoCabMovInv = Info; txtID.Text = Convert.ToString(Info.IdNumMovi); infobodega.IdSucursal = Info.IdSucursal; infobodega.IdBodega = infobodega.IdBodega; ucCp_Proveedor.set_ProveedorInfo(Convert.ToDecimal(Info.IdProvedor)); UCSuc_Bod.cmb_sucursal.EditValue = Info.IdSucursal; // UCSuc_Bod.cmb_sucursal.SelectedItem = Info.IdSucursal; UCSuc_Bod.cmb_bodega.EditValue = Info.IdBodega; // UCSuc_Bod.cmb_bodega.SelectedItem = Info.IdBodega; dtPfecha.Value = Convert.ToDateTime(Info.Fecha_Transac); txtGuiaDesp.Text = Info.NumDocumentoRelacionado; txtFact.Text = Info.NumFactura; txtObservacion.Text = Info.cm_observacion; if (Info.Estado == "I") { lblAnulado.Visible = true; } else { lblAnulado.Visible = false; } LStDet = new List <in_movi_inve_detalle_Info>(); LStDet = BusDetMOvINv.Get_list_Movi_inven_det(Info.IdEmpresa, Info.IdSucursal, Info.IdBodega, Info.IdMovi_inven_tipo, Info.IdNumMovi); int sec = 1; com_ordencompra_local_Bus busOC = new com_ordencompra_local_Bus(); LstDetOC = new List <com_ordencompra_local_det_Info>(); foreach (var item in LStDet) { com_ordencompra_local_det_Info DetOC = new com_ordencompra_local_det_Info(); in_movi_inve_detalle_x_com_ordencompra_local_det_Info InfoTabInt = new in_movi_inve_detalle_x_com_ordencompra_local_det_Info(); InfoTabInt = BusTAbInt.Get_Info_in_movi_inve_detalle_x_com_ordencompra_local_det(item); DetOC = BusDetOC.Get_Info_ordencompra_local_det(InfoTabInt.ocd_IdEmpresa, InfoTabInt.ocd_IdSucursal, InfoTabInt.ocd_IdOrdenCompra, InfoTabInt.ocd_Secuencia); var OC = busOC.Get_Info_ordencompra_local(InfoTabInt.ocd_IdEmpresa, InfoTabInt.ocd_IdSucursal, InfoTabInt.ocd_IdOrdenCompra); if (OC != null) { DetOC.oc_observacion = OC.oc_observacion; DetOC.oc_NumDocumento = OC.oc_NumDocumento; DetOC.UsuarioAprueba = OC.IdUsuario_Aprueba; DetOC.FechaAprob = Convert.ToDateTime(OC.co_fecha_aprobacion); } DetOC.do_CantidadOC = DetOC.do_Cantidad; DetOC.dm_cantidad_Inv = item.dm_cantidad; DetOC.mv_observacion = item.dm_observacion; DetOC.producto = Busprod.Get_DescripcionTot_Producto(DetOC.IdEmpresa, DetOC.IdProducto); DetOC.oc_NumDocumento = "[" + DetOC.IdOrdenCompra + "/" + DetOC.oc_NumDocumento + "]"; DetOC.mv_sec = sec++; LstDetOC.Add(DetOC); } gridCtrlMoviInvDet.DataSource = LstDetOC; LstDetMovi = BusDetxProd.ConsultaxMovInvTipo(Info.IdEmpresa, Info.IdSucursal, Info.IdBodega, Info.IdNumMovi, Info.IdMovi_inven_tipo); List <vwIn_Movi_Inven_CusCider_Cab_Info> LstMov = new List <vwIn_Movi_Inven_CusCider_Cab_Info>(); LstMov = BusDetxProd.ConsultaMovimientos(InfoCabMovInv.IdEmpresa, InfoCabMovInv.IdSucursal, InfoCabMovInv.IdBodega, InfoCabMovInv.IdNumMovi, InfoCabMovInv.IdMovi_inven_tipo); gridCtrlMov.DataSource = LstMov; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }