Esempio n. 1
0
        /// <summary>
        /// AL ACTIVAR EL FORMULARIO
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void xfSalesCreditNote_Activated(object sender, EventArgs e)
        {
            ((xfMain)MdiParent).fra = this;

            var oBeAcce = new BESVMD_ACCE();
            var oBrAcce = new BRSVMD_ACCE();
            oBeAcce.NUM_ACCI = 5;
            oBeAcce.ALF_NOMB = FORM_SUBO;
            oBeAcce.COD_PERF = SESSION_PERF;
            var oListBotones = oBrAcce.Get_SVPR_ACCE_LIST(oBeAcce);

            foreach (BarButtonItemLink itemLink in ((xfMain)MdiParent).barTool.ItemLinks)
            {
                if (oListBotones.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                    itemLink.Item.Visibility = BarItemVisibility.Always;
                else
                    itemLink.Item.Visibility = BarItemVisibility.Never;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// AL DESACTIVAR EL FORMULARIO
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void xfSalesCreditNote_Deactivate(object sender, EventArgs e)
        {
            var oBeAcce = new BESVMD_ACCE();
            var oBrAcce = new BRSVMD_ACCE();
            oBeAcce.NUM_ACCI = 5;
            oBeAcce.ALF_NOMB = FORM_SUBO;
            oBeAcce.COD_PERF = SESSION_PERF;
            var oListBotones = oBrAcce.Get_SVPR_ACCE_LIST(oBeAcce);

            foreach (BarButtonItemLink itemLink in ((xfMain)MdiParent).barTool.ItemLinks)
            {
                itemLink.Item.Visibility = BarItemVisibility.Never;
            }
        }
Esempio n. 3
0
        private void xfMain_Load(object sender, EventArgs e)
        {
            barMenu.Visible = false;
            barTool.Visible = false;
            barStatus.Visible = false;

            var oForm = new xfLogin();

            DialogResult oResult = oForm.ShowDialog();

            if (oResult == DialogResult.OK)
            {
                barTool.Visible = true;
                barMenu.Visible = true;
                barStatus.Visible = true;

                beiUser.Caption = oForm.oBe.ALF_NOMB;
                SESSION_USER = oForm.oBe.COD_USUA;
                SESSION_PERF = oForm.oBe.COD_PERF;
                SESSION_COMP = oForm.oBe.COD_COMP;
                SESSION_IMPU = oForm.oBe.ALF_IMPU;
                SESSION_PORC_IMPU = oForm.oBe.NUM_PORC_IMPU;

                SgIns.SESSION_USER = oForm.oBe.COD_USUA;
                SgIns.SESSION_PERF = oForm.oBe.COD_PERF;
                SgIns.SESSION_COMP = oForm.oBe.COD_COMP;
                SgIns.SESSION_IMPU = oForm.oBe.ALF_IMPU;
                SgIns.SESSION_PORC_IMPU = oForm.oBe.NUM_PORC_IMPU;

                var oBeTC = new BESVMC_TIPO_CAMB();
                var oBrTC = new BRSVMC_TIPO_CAMB();

                oBeTC.COD_COMP = SESSION_COMP;
                oBeTC.NUM_ACCI = 5;
                var oListTC = oBrTC.Get_SVPR_TIPO_CAMB_LIST(oBeTC);
                SESSION_NUM_TIPO_CAMB_COMP = (oListTC.Count == 0) ? 1 : oListTC[0].NUM_TIPO_CAMB_COMP;

                var oBe = new BESVMD_ACCE();
                var oBr = new BRSVMD_ACCE();

                oBe.NUM_ACCI = 4;
                oBe.COD_PERF = SESSION_PERF;

                var oListOpti = oBr.Get_SVPR_ACCE_LIST(oBe);

                foreach (BarItemLink itemLink in bsiManagement.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarItemLink itemLink in bsiSales.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarItemLink itemLink in bsiShopping.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarItemLink itemLink in bsiWarehouse.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarItemLink itemLink in bsiQueryReports.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarItemLink itemLink in bsiGenerics.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarItemLink itemLink in bsiSecurity.ItemLinks)
                {
                    if (oListOpti.Count(obj => obj.ALF_NOMB.Equals(itemLink.Item.Name)) > 0)
                        itemLink.Item.Enabled = true;
                    else
                        itemLink.Item.Enabled = false;
                }
                foreach (BarButtonItemLink itemLink in barTool.ItemLinks)
                {
                    itemLink.Item.Visibility = BarItemVisibility.Never;
                }
            }
            else
            {
                Application.ExitThread();
                Application.Exit();
            }
        }