Beispiel #1
0
 /// <summary>
 /// REALIZAR OPERACIONES DE MANTENIMIENTO
 /// </summary>
 /// <param name="oBe"></param>
 public void Set_SVPR_SUCU(BESVMC_SUCU oBe)
 {
     try
     {
         oDa.Set_SVPR_SUCU(oBe);
         Dispose(false);
     }
     catch(Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
Beispiel #2
0
 /// <summary>
 /// OBTENER EL RESULTADO DE CUALQUIER CONSULTA
 /// </summary>
 /// <param name="oBe"></param>
 /// <returns></returns>
 public List<BESVMC_SUCU> Get_SVPR_SUCU_LIST(BESVMC_SUCU oBe)
 {
     try
     {
         using (IDataReader oDr = oDa.Get_SVPR_SUCU_LIST(oBe))
         {
             List<BESVMC_SUCU> oList = new List<BESVMC_SUCU>();
             IList iList = oList;
             ((IList)iList).LoadFromReader<BESVMC_SUCU>(oDr);
             Dispose(false);
             return (oList);
         }
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
Beispiel #3
0
 public void Set_SVPR_SUCU(BESVMC_SUCU oBe)
 {
     if (ocn.State == ConnectionState.Closed) ocn.Open();
     using (var obts = ocn.BeginTransaction())
     {
         try
         {
             using (var ocmd = odb.GetStoredProcCommand("SVPR_SUCU", oBe.COD_SUCU,
                                                                     oBe.COD_COMP,
                                                                         oBe.ALF_SUCU,
                                                                         oBe.ALF_DESC,
                                                                         oBe.COD_USUA_CREA,
                                                                         oBe.COD_USUA_MODI,
                                                                         oBe.NUM_ACCI))
             {
                 ocmd.CommandTimeout = 2000;
                 odb.ExecuteNonQuery(ocmd, obts);
                 oBe.COD_SUCU = Convert.ToInt32(odb.GetParameterValue(ocmd, "@COD_SUCU"));
                 obts.Commit();
             }
         }
         catch (Exception ex)
         {
             obts.Rollback();
             throw new ArgumentException(ex.Message);
         }
         finally
         {
             ocn.Close();
         }
     }
 }
Beispiel #4
0
 public IDataReader Get_SVPR_SUCU_LIST(BESVMC_SUCU oBe)
 {
     try
     {
         if (ocn.State == ConnectionState.Closed) ocn.Open();
         var ocmd = odb.GetStoredProcCommand("SVPR_SUCU_LIST",
                                             oBe.COD_SUCU,
                                             oBe.COD_COMP,
                                             oBe.ALF_SUCU,
                                             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();
     }
 }
Beispiel #5
0
        public void Save()
        {
            try
            {
                if (string.IsNullOrEmpty(txtALF_SUCU.Text))
                    throw new ArgumentException("Ingresar el nombre de la sucursal");

                var oBe = new BESVMC_SUCU();
                var oBr = new BRSVMC_SUCU();

                if (string.IsNullOrEmpty(txtCOD_SUCU.Text))
                {
                    oBe.NUM_ACCI = 1;
                }
                else
                {
                    oBe.NUM_ACCI = 2;
                    oBe.COD_SUCU = Convert.ToInt32(txtCOD_SUCU.Text);
                }

                oBe.ALF_SUCU = txtALF_SUCU.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_SUCU(oBe);
                txtCOD_SUCU.Text = oBe.COD_SUCU.ToString();
                var oBeC = new BESVMC_SUCU();
                var oBrC = new BRSVMC_SUCU();

                oBeC.NUM_ACCI = 4;
                oBeC.COD_COMP = SESSION_COMP;

                var oListC = oBrC.Get_SVPR_SUCU_LIST(oBeC);
                gdcBranch.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);
            }
        }
Beispiel #6
0
        private void xfBranch_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_SUCU();
            var oBrC = new BRSVMC_SUCU();

            oBeC.NUM_ACCI = 4;
            oBeC.COD_COMP = SESSION_COMP;

            var oListC = oBrC.Get_SVPR_SUCU_LIST(oBeC);
            gdcBranch.DataSource = oListC;
        }