Esempio n. 1
0
 /// <summary>
 /// REALIZAR OPERACIONES DE MANTENIMIENTO
 /// </summary>
 /// <param name="oBe"></param>
 public void Set_SVPR_PERF(BESVMC_PERF oBe)
 {
     try
     {
         oDa.Set_SVPR_PERF(oBe);
         Dispose(false);
     }
     catch(Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// OBTENER EL RESULTADO DE CUALQUIER CONSULTA
 /// </summary>
 /// <param name="oBe"></param>
 /// <returns></returns>
 public List<BESVMC_PERF> Get_SVPR_PERF_LIST(BESVMC_PERF oBe)
 {
     try
     {
         using (IDataReader oDr = oDa.Get_SVPR_PERF_LIST(oBe))
         {
             List<BESVMC_PERF> oList = new List<BESVMC_PERF>();
             IList iList = oList;
             ((IList)iList).LoadFromReader<BESVMC_PERF>(oDr);
             Dispose(false);
             return (oList);
         }
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// REALIZAR OPERACIONES DE MANTENIMIENTO
        /// </summary>
        /// <param name="oBe"></param>
        public void Set_SVPR_PERF(BESVMC_PERF oBe)
        {
            if (ocn.State == ConnectionState.Closed) ocn.Open();
            using (var obts = ocn.BeginTransaction())
            {
                try
                {
                    using (var ocmd = odb.GetStoredProcCommand("SVPR_PERF", oBe.COD_PERF,
                                                                            oBe.COD_COMP,
                                                                            oBe.ALF_PERF,
                                                                            oBe.ALF_DESC,
                                                                            oBe.COD_USUA_CREA,
                                                                            oBe.COD_USUA_MODI,
                                                                            oBe.NUM_ACCI))
                    {
                        ocmd.CommandTimeout = 2000;
                        odb.ExecuteNonQuery(ocmd, obts);
                        oBe.COD_PERF = Convert.ToInt32(odb.GetParameterValue(ocmd, "@COD_PERF"));
                        DbCommand cmdo;

                        oBe.OBJ_ACCE.LST_OPCI.ForEach(item =>
                        {
                            cmdo = odb.GetStoredProcCommand("SVPR_ACCE", 0,
                                                                            oBe.COD_PERF,
                                                                            null,
                                                                            item.COD_OPCI,
                                                                            item.IND_MARC,
                                                                            oBe.COD_USUA_CREA,
                                                                            oBe.COD_USUA_MODI,
                                                                            1);
                            cmdo.CommandTimeout = 2000;
                            odb.ExecuteNonQuery(cmdo, obts);
                        });

                        oBe.OBJ_ACCE.LST_OPCI_BUTT.ForEach(item =>
                        {
                            cmdo = odb.GetStoredProcCommand("SVPR_ACCE", 0,
                                                                            oBe.COD_PERF,
                                                                            item.COD_BUTT,
                                                                            item.COD_OPCI,
                                                                            item.IND_MARC,
                                                                            oBe.COD_USUA_CREA,
                                                                            oBe.COD_USUA_MODI,
                                                                            1);
                            cmdo.CommandTimeout = 2000;
                            odb.ExecuteNonQuery(cmdo, obts);
                        });

                        obts.Commit();
                    }
                }
                catch (Exception ex)
                {
                    obts.Rollback();
                    throw new ArgumentException(ex.Message);
                }
                finally
                {
                    ocn.Close();
                }
            }
        }
Esempio n. 4
0
 public IDataReader Get_SVPR_PERF_LIST(BESVMC_PERF oBe)
 {
     try
     {
         if (ocn.State == ConnectionState.Closed) ocn.Open();
         var ocmd = odb.GetStoredProcCommand("SVPR_PERF_LIST",
                                             oBe.COD_PERF,
                                             oBe.COD_COMP,
                                             oBe.ALF_PERF,
                                             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();
     }
 }
Esempio n. 5
0
        private void xfProfiles_Load(object sender, EventArgs e)
        {
            SESSION_USER = ((xfMain)MdiParent).SESSION_USER;
            SESSION_PERF = ((xfMain)MdiParent).SESSION_PERF;
            SESSION_COMP = ((xfMain)MdiParent).SESSION_COMP;

            ControlState(true);

            var oBe = new BESVMC_PERF();
            var oBr = new BRSVMC_PERF();

            var oBeMm = new BESVMC_MAIN_MENU();
            var oBrMm = new BRSVMC_MAIN();

            oBe.NUM_ACCI = 4;
            oBe.COD_COMP = SESSION_COMP;
            var oList = oBr.Get_SVPR_PERF_LIST(oBe);
            gdcProfile.DataSource = oList;

            oBeMm.NUM_ACCI = 4;
            var oListMm = oBrMm.Get_SVPR_MAIN_LIST(oBeMm);
            gdcMain.DataSource = oListMm;
        }
Esempio n. 6
0
        public void Undo()
        {
            ClearControls();
            var oBeProf = new BESVMC_PERF();
            var oBrProf = new BRSVMC_PERF();

            oBeProf.NUM_ACCI = 4;
            oBeProf.COD_COMP = SESSION_COMP;
            var oList = oBrProf.Get_SVPR_PERF_LIST(oBeProf);
            gdcProfile.DataSource = oList;
            ControlState(true);
        }
Esempio n. 7
0
        public void Save()
        {
            try
            {
                gdvOptions.CloseEditor();
                gdvOptions.RefreshData();

                gdvButtons.CloseEditor();
                gdvButtons.RefreshData();

                var oBe = new BESVMC_PERF();
                var oBr = new BRSVMC_PERF();

                if (string.IsNullOrEmpty(txtCOD_PERF.Text))
                {
                    oBe.NUM_ACCI = 1;
                }
                else
                {
                    oBe.NUM_ACCI = 2;
                    oBe.COD_PERF = int.Parse(txtCOD_PERF.Text);
                }

                oBe.ALF_PERF = txtALF_PERF.Text;
                oBe.ALF_DESC = meALF_DESC.Text;

                oBe.OBJ_ACCE.LST_OPCI = oListOpci;
                oBe.OBJ_ACCE.LST_OPCI_BUTT = oListButt;

                oBe.COD_COMP = SESSION_COMP;
                oBe.COD_USUA_CREA = SESSION_USER;
                oBe.COD_USUA_MODI = SESSION_USER;

                if (XtraMessageBox.Show("Esta seguro de que desea guardar los datos del perfil?", "Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    oBr.Set_SVPR_PERF(oBe);

                    txtCOD_PERF.Text = oBe.COD_PERF.ToString();

                    var oBeOpci = new BESVMC_OPCI();
                    var oBrOpci = new BRSVMC_OPCI();

                    var oBeButt = new BESVMC_BUTT();
                    var oBrButt = new BRSVMC_BUTT();

                    oBeOpci.NUM_ACCI = 4;
                    oBeOpci.COD_PERF = oBe.COD_PERF;

                    oListOpci = oBrOpci.Get_SVPR_OPCI_LIST(oBeOpci);
                    gdcOptions.DataSource = oListOpci;
                    gdvOptions.ActiveFilter.Add(gdvOptions.Columns["COD_MAIN"],
                        new ColumnFilterInfo(String.Format("[COD_MAIN] = {0} ", 0), ""));

                    oBeButt.NUM_ACCI = 4;
                    oBeButt.COD_PERF = oBe.COD_PERF;

                    oListButt = oBrButt.Get_SVPR_BUTT_LIST(oBeButt);
                    gdcButtons.DataSource = oListButt;
                    gdvButtons.ActiveFilter.Add(gdvButtons.Columns["COD_OPCI"],
                        new ColumnFilterInfo(String.Format("[COD_OPCI] = {0}", 0), ""));

                    var oBeProf = new BESVMC_PERF();
                    var oBrProf = new BRSVMC_PERF();

                    oBeProf.NUM_ACCI = 4;
                    oBeProf.COD_COMP = SESSION_COMP;
                    var oList = oBrProf.Get_SVPR_PERF_LIST(oBeProf);
                    gdcProfile.DataSource = oList;
                    ControlState(true);
                    XtraMessageBox.Show("Operacion realizada con exito", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
Esempio n. 8
0
        private void xfUsuario_Load(object sender, EventArgs e)
        {
            SESSION_USER = ((xfMain)MdiParent).SESSION_USER;
            SESSION_PERF = ((xfMain)MdiParent).SESSION_PERF;
            SESSION_COMP = ((xfMain)MdiParent).SESSION_COMP;

            var oBe = new BESVMC_PERF();
            var oBr = new BRSVMC_PERF();

            oBe.NUM_ACCI = 4;
            oBe.COD_COMP = SESSION_COMP;
            var oList = oBr.Get_SVPR_PERF_LIST(oBe);

            lueCOD_PERF.Properties.DataSource = oList;
            lueCOD_PERF.Properties.Columns.Clear();
            lueCOD_PERF.Properties.Columns.Add(new LookUpColumnInfo("ALF_PERF", 100, "Perfiles"));
            lueCOD_PERF.Properties.DisplayMember = "ALF_PERF";
            lueCOD_PERF.Properties.ValueMember = "COD_PERF";

            var oBeU = new BESVMC_USUA();
            var oBrU = new BRSVMC_USUA();

            oBeU.COD_COMP = SESSION_COMP;
            oBeU.NUM_ACCI = 4;

            var oListUser = oBrU.Get_SVPR_USUA_LIST(oBeU);

            gdcUsuarios.DataSource = oListUser;

            StateControl(true);
        }