Example #1
0
        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);
            }
        }
Example #2
0
        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;
        }