/// <summary> /// REALIZAR OPERACIONES DE MANTENIMIENTO /// </summary> /// <param name="oBe"></param> public void Set_SVPR_MODE_ARTI(BESVMC_MODE_ARTI oBe) { try { oDa.Set_SVPR_MODE_ARTI(oBe); Dispose(false); } catch(Exception ex) { throw new ArgumentException(ex.Message); } }
/// <summary> /// OBTENER EL RESULTADO DE CUALQUIER CONSULTA /// </summary> /// <param name="oBe"></param> /// <returns></returns> public List<BESVMC_MODE_ARTI> Get_SVPR_MODE_ARTI_LIST(BESVMC_MODE_ARTI oBe) { try { using (IDataReader oDr = oDa.Get_SVPR_MODE_ARTI_LIST(oBe)) { List<BESVMC_MODE_ARTI> oList = new List<BESVMC_MODE_ARTI>(); IList iList = oList; ((IList)iList).LoadFromReader<BESVMC_MODE_ARTI>(oDr); Dispose(false); return (oList); } } catch (Exception ex) { throw new ArgumentException(ex.Message); } }
public IDataReader Get_SVPR_MODE_ARTI_LIST(BESVMC_MODE_ARTI oBe) { try { if (ocn.State == ConnectionState.Closed) ocn.Open(); var ocmd = odb.GetStoredProcCommand("SVPR_MODE_ARTI_LIST", oBe.COD_MODE_ARTI, oBe.COD_COMP, oBe.ALF_MODE_ARTI, oBe.ALF_DESC, oBe.COD_USUA_CREA, oBe.COD_USUA_MODI, oBe.NUM_ACCI ); ocmd.CommandTimeout = 2000; var odr = odb.ExecuteReader(ocmd); Dispose(false); return (odr); } finally { ocn.Close(); } }
public void Save() { try { if (string.IsNullOrEmpty(txtALF_MODE_ARTI.Text)) throw new ArgumentException("Ingresar modelo de artículo"); var oBe = new BESVMC_MODE_ARTI(); var oBr = new BRSVMC_MODE_ARTI(); if (string.IsNullOrEmpty(txtCOD_MODE_ARTI.Text)) { oBe.NUM_ACCI = 1; } else { oBe.NUM_ACCI = 2; oBe.COD_MODE_ARTI = Convert.ToInt32(txtCOD_MODE_ARTI.Text); } oBe.ALF_MODE_ARTI = txtALF_MODE_ARTI.Text; oBe.ALF_DESC = meALF_DESC.Text; oBe.COD_USUA_CREA = SESSION_USER; oBe.COD_USUA_MODI = SESSION_USER; oBe.COD_COMP = SESSION_COMP; oBr.Set_SVPR_MODE_ARTI(oBe); txtCOD_MODE_ARTI.Text = oBe.COD_MODE_ARTI.ToString(); var oBeC = new BESVMC_MODE_ARTI(); var oBrC = new BRSVMC_MODE_ARTI(); oBeC.NUM_ACCI = 4; oBeC.COD_COMP = SESSION_COMP; var oListC = oBrC.Get_SVPR_MODE_ARTI_LIST(oBeC); gdcModelArticle.DataSource = oListC; StateControl(true); XtraMessageBox.Show("Operación realizada con exito!!!", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void xfModelArticle_Load(object sender, EventArgs e) { SESSION_USER = ((xfMain)MdiParent).SESSION_USER; SESSION_PERF = ((xfMain)MdiParent).SESSION_PERF; SESSION_COMP = ((xfMain)MdiParent).SESSION_COMP; StateControl(true); var oBeC = new BESVMC_MODE_ARTI(); var oBrC = new BRSVMC_MODE_ARTI(); oBeC.NUM_ACCI = 4; oBeC.COD_COMP = SESSION_COMP; var oListC = oBrC.Get_SVPR_MODE_ARTI_LIST(oBeC); gdcModelArticle.DataSource = oListC; }
public void Set_SVPR_MODE_ARTI(BESVMC_MODE_ARTI oBe) { if (ocn.State == ConnectionState.Closed) ocn.Open(); using (var obts = ocn.BeginTransaction()) { try { using (var ocmd = odb.GetStoredProcCommand("SVPR_MODE_ARTI", oBe.COD_MODE_ARTI, oBe.COD_COMP, oBe.ALF_MODE_ARTI, oBe.ALF_DESC, oBe.COD_USUA_CREA, oBe.COD_USUA_MODI, oBe.NUM_ACCI)) { ocmd.CommandTimeout = 2000; odb.ExecuteNonQuery(ocmd, obts); oBe.COD_MODE_ARTI = Convert.ToInt32(odb.GetParameterValue(ocmd, "@COD_MODE_ARTI")); obts.Commit(); } } catch (Exception ex) { obts.Rollback(); throw new ArgumentException(ex.Message); } finally { ocn.Close(); } } }