Exemple #1
0
        private void bbiQuote_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                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);

                if (oListTC.Count == 0)
                    throw new ArgumentException("El tipo de cambio del dia no esta registrado");

                Sales.xfQuote.SgIns.MdiParent = this;
                Sales.xfQuote.SgIns.Activate();
                Sales.xfQuote.SgIns.FORM_SUBO = "bbiQuote";
                Sales.xfQuote.SgIns.Show();
                Sales.xfQuote.SgIns.BringToFront();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
        private void xfExchangeRate_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_TIPO_CAMB();
            var oBrC = new BRSVMC_TIPO_CAMB();

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

            var oListC = oBrC.Get_SVPR_TIPO_CAMB_LIST(oBeC);
            gdcExchangeRate.DataSource = oListC;
        }
Exemple #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();
            }
        }
        public void Save()
        {
            try
            {
                if (string.IsNullOrEmpty(deFEC_TIPO_CAMB.Text))
                    throw new ArgumentException("Ingresar la fecha del tipo de cambio");

                var oBe = new BESVMC_TIPO_CAMB();
                var oBr = new BRSVMC_TIPO_CAMB();

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

                oBe.FEC_TIPO_CAMB = deFEC_TIPO_CAMB.DateTime;
                oBe.NUM_TIPO_CAMB_COMP = Convert.ToDecimal(txtNUM_TIPO_CAMB_COMP.Text);
                oBe.NUM_TIPO_CAMB_VENT = Convert.ToDecimal(txtNUM_TIPO_CAMB_VENT.Text);
                oBe.COD_USUA_CREA = SESSION_USER;
                oBe.COD_USUA_MODI = SESSION_USER;
                oBe.COD_COMP = SESSION_COMP;

                oBr.Set_SVPR_TIPO_CAMB(oBe);
                txtCOD_TIPO_CAMB.Text = oBe.COD_TIPO_CAMB.ToString();
                var oBeC = new BESVMC_TIPO_CAMB();
                var oBrC = new BRSVMC_TIPO_CAMB();

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

                var oListC = oBrC.Get_SVPR_TIPO_CAMB_LIST(oBeC);
                gdcExchangeRate.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);
            }
        }