public void setCab(com_ListadoMaterialesDisponibles_Info InfoLisMat) { prd_OrdenTaller_Info InfoOT = new prd_OrdenTaller_Info(); try { // LLENAR LOS COMBOS DE LOS DATOS DE LA ORDEN InfoLMat = InfoLisMat; ucGe_Sucursal_combo1.set_SucursalInfo(InfoLisMat.IdSucursal); Obra.set_item(InfoLisMat.CodObra); dtpFechareg.Value = InfoLisMat.FechaReg; txtIdLMat.Text = Convert.ToString(InfoLisMat.IdListadoMaterialesDisponibles); //dTPFecRegOT.Value = InfoOT.FechaReg; txtUsuario.Text = InfoLisMat.Usuario; txtObservacion.Text = InfoLisMat.lm_Observacion; //txtIdOT.Text =Convert.ToString( InfoOT.IdOrdenTaller); if (InfoLisMat.Estado == "I") { lblAnulado.Visible = true; set_Accion(Cl_Enumeradores.eTipo_action.consultar); } cargagrid(InfoLisMat); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.Message); } }
public Boolean AnularDB(com_ListadoMaterialesDisponibles_Info Info, ref string msg) { try { using (EntitiesCompras_Edehsa context = new EntitiesCompras_Edehsa()) { var address = context.com_ListadoMaterialesDisponibles.First (A => A.IdEmpresa == Info.IdEmpresa && A.IdListadoMaterialesDisponibles == Info.IdListadoMaterialesDisponibles ); address.Estado = "I"; address.Usuario = Info.Usuario; address.lm_Observacion = Info.lm_Observacion; //contact = address; context.SaveChanges(); } msg = "Guardado con exito"; 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 = "Error no se guardó " + ex.Message + " "; throw new Exception(ex.ToString()); } }
private void gridViewListMaterialesDisponibles_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { InfoListMat = (com_ListadoMaterialesDisponibles_Info)gridViewListMaterialesDisponibles.GetFocusedRow(); } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.Message); } }
public Boolean ModificarDB(com_ListadoMaterialesDisponibles_Info info, ref string msg) { try { return(Data.ModificarDB(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("", "ModificarDB", ex.Message), ex) { EntityType = typeof(com_ListadoMaterialesDisponibles_Bus) }; } }
void cargagrid(com_ListadoMaterialesDisponibles_Info InfoLMat) { try { LstInfoLMat = BusDetLMat.Get_List_ListadoMaterialesDisponibles_Det(InfoLMat.IdEmpresa, InfoLMat.IdListadoMaterialesDisponibles); //gridCtrlDetListMaterialesDisponibles.DataSource = LstInfoLMat; ListaBind = new BindingList <com_ListadoMaterialesDisponibles_Det_Info>(LstInfoLMat); gridCtrlDetListMaterialesDisponibles.DataSource = ListaBind; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); } }
public com_ListadoMaterialesDisponibles_Info Get_Info_ListadoMaterialesDisponibles(int idempresa, decimal idLstMater) { com_ListadoMaterialesDisponibles_Info info = new com_ListadoMaterialesDisponibles_Info(); EntitiesCompras_Edehsa oEnti = new EntitiesCompras_Edehsa(); try { var select = from A in oEnti.vwcom_ListadoMaterialesDisponibles where A.IdEmpresa == idempresa && A.IdListadoMaterialesDisponibles == idLstMater select A; foreach (var item in select) { info.IdEmpresa = item.IdEmpresa; info.IdSucursal = item.IdSucursal; info.IdListadoMaterialesDisponibles = item.IdListadoMaterialesDisponibles; info.FechaReg = item.FechaReg; info.Estado = item.Estado; info.ob_descripcion = item.ob_descripcion; info.lm_Observacion = item.lm_Observacion; info.su_descripcion = item.Su_Descripcion; info.CodObra = item.CodObra; info.Motivo = item.Motivo; info.Usuario = item.Usuario; } return(info); } 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; throw new Exception(ex.ToString()); } }
public List <com_ListadoMaterialesDisponibles_Info> Get_List_ListadoMaterialesDisponibles(int idempresa) { List <com_ListadoMaterialesDisponibles_Info> Lst = new List <com_ListadoMaterialesDisponibles_Info>(); EntitiesCompras_Edehsa oEnti = new EntitiesCompras_Edehsa(); try { var Query = from q in oEnti.vwcom_ListadoMaterialesDisponibles where q.IdEmpresa == idempresa select q; foreach (var item in Query) { com_ListadoMaterialesDisponibles_Info Obj = new com_ListadoMaterialesDisponibles_Info(); Obj.IdEmpresa = item.IdEmpresa; Obj.IdListadoMaterialesDisponibles = item.IdListadoMaterialesDisponibles; Obj.IdSucursal = item.IdSucursal; Obj.FechaReg = item.FechaReg; Obj.Estado = item.Estado; Obj.ob_descripcion = "[" + item.CodObra + "] " + item.ob_descripcion; Obj.lm_Observacion = item.lm_Observacion; Obj.CodObra = item.CodObra; Obj.Usuario = item.Usuario; Obj.Motivo = item.Motivo; Obj.su_descripcion = item.Su_Descripcion; 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.InnerException + " " + ex.Message; throw new Exception(ex.ToString()); } }
public Boolean GrabarDB(com_ListadoMaterialesDisponibles_Info info, ref int id, ref string msg) { try { using (EntitiesCompras_Edehsa context = new EntitiesCompras_Edehsa()) { var address = new com_ListadoMaterialesDisponibles(); int idEmp = GetId(info.IdEmpresa, ref mensaje); id = idEmp; address.IdListadoMaterialesDisponibles = id; address.IdEmpresa = info.IdEmpresa; address.ot_IdSucursal = info.IdSucursal; address.CodObra = info.CodObra; address.FechaReg = info.FechaReg; address.Estado = info.Estado; address.Usuario = info.Usuario; address.Motivo = info.Motivo.Trim(); address.lm_Observacion = info.lm_Observacion; context.com_ListadoMaterialesDisponibles.Add(address); context.SaveChanges(); msg = "Se ha procedido a grabar el Listado de Materiales #: " + id.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 Boolean ModificarDB(com_ListadoMaterialesDisponibles_Info info, ref string msg) { try { using (EntitiesCompras_Edehsa context = new EntitiesCompras_Edehsa()) { var contact = context.com_ListadoMaterialesDisponibles.FirstOrDefault(obj => obj.IdEmpresa == info.IdEmpresa && obj.IdListadoMaterialesDisponibles == info.IdListadoMaterialesDisponibles); if (contact != null) { contact.FechaReg = info.FechaReg; contact.Motivo = info.Motivo; contact.Usuario = info.Usuario; contact.lm_Observacion = info.lm_Observacion; contact.Estado = info.Estado; context.SaveChanges(); msg = "Se ha procedido actualizar elListado de Materiales #: " + info.IdListadoMaterialesDisponibles.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()); } }