Ejemplo n.º 1
0
        private void Get_Load()
        {
            var obrtm = new BRTypeReason();
            var oltm = obrtm.Get_PSGN_SPLS_SVMC_TIPO_MOTI();
            rilCOD_TIPO_MOTI.DataSource = oltm;
            rilCOD_TIPO_MOTI.Columns.Clear();
            var lkci = new LookUpColumnInfo("ALF_TIPO_MOTI", "Tipos de Motivo", 20);
            rilCOD_TIPO_MOTI.Columns.Add(lkci);
            rilCOD_TIPO_MOTI.DisplayMember = "ALF_TIPO_MOTI";
            rilCOD_TIPO_MOTI.ValueMember = "COD_TIPO_MOTI";

            var obr = new BRReason();
            var olst = obr.Get_PSGN_SPLS_SVMC_MOTI(xfMain.SgIns.SESSION_COMP);
            if (olst.Count == 0)
            {
                var obj = new BEReason() { IND_MNTN = 1, COD_USUA_CREA = xfMain.SgIns.SESSION_USER };
                olst.Add(obj);
            }
            gdcGeneric.DataSource = olst;

            BeginInvoke(new MethodInvoker(() =>
            {
                gdvGeneric.MoveLast();
                gdvGeneric.FocusedColumn = gdvGeneric.VisibleColumns[1];
                gdvGeneric.ShowEditor();
            }));
        }
Ejemplo n.º 2
0
        private void Get_Load()
        {
            var obral = new BRWarehouse();
            var obrmo = new BRReason();
            var olsal = obral.Get_PSGN_SPLS_SVMC_ALMA(xfMain.SgIns.SESSION_COMP);
            var olsmo = obrmo.Get_PSGN_SPLS_SVMC_MOTI(xfMain.SgIns.SESSION_COMP);

            lkeCOD_ALMA.Properties.DataSource = olsal;
            lkeCOD_ALMA.Properties.Columns.Clear();
            var lkci = new LookUpColumnInfo("ALF_ALMA", "Almacén", 20);
            lkeCOD_ALMA.Properties.Columns.Add(lkci);
            lkeCOD_ALMA.Properties.DisplayMember = "ALF_ALMA";
            lkeCOD_ALMA.Properties.ValueMember = "COD_ALMA";

            lkeCOD_MOTI.Properties.DataSource = olsmo;
            lkeCOD_MOTI.Properties.Columns.Clear();
            lkci = new LookUpColumnInfo("ALF_MOTI", "Motivo", 20);
            lkeCOD_MOTI.Properties.Columns.Add(lkci);
            lkeCOD_MOTI.Properties.DisplayMember = "ALF_MOTI";
            lkeCOD_MOTI.Properties.ValueMember = "COD_MOTI";
        }
Ejemplo n.º 3
0
        private void Get_Load()
        {
            SESSION_USER = ((xfMain)MdiParent).SESSION_USER;
            SESSION_PERF = ((xfMain)MdiParent).SESSION_PERF;
            SESSION_COMP = ((xfMain)MdiParent).SESSION_COMP;

            var obral = new BRWarehouse();
            var obrmo = new BRReason();
            var olsal = obral.Get_PSGN_SPLS_SVMC_ALMA(SESSION_COMP);
            var olsre = obral.Get_PSGN_SPLS_SVMC_SOCI_NEGO(SESSION_COMP);
            var olsmo = obrmo.Get_PSGN_SPLS_SVMC_MOTI(SESSION_COMP);

            lkeCOD_ALMA.Properties.DataSource = olsal;
            lkeCOD_ALMA.Properties.Columns.Clear();
            var lkci = new LookUpColumnInfo("ALF_ALMA", "Almacén Origen", 20);
            lkeCOD_ALMA.Properties.Columns.Add(lkci);
            lkeCOD_ALMA.Properties.DisplayMember = "ALF_ALMA";
            lkeCOD_ALMA.Properties.ValueMember = "COD_ALMA";

            lkeCOD_SOCI_NEGO_RESP.Properties.DataSource = olsre;
            lkeCOD_SOCI_NEGO_RESP.Properties.Columns.Clear();
            lkci = new LookUpColumnInfo("ALF_NOMB", "Responsable", 20);
            lkeCOD_SOCI_NEGO_RESP.Properties.Columns.Add(lkci);
            lkeCOD_SOCI_NEGO_RESP.Properties.DisplayMember = "ALF_NOMB";
            lkeCOD_SOCI_NEGO_RESP.Properties.ValueMember = "COD_SOCI_NEGO";

            lkeCOD_ALMA_DEST.Properties.DataSource = olsal;
            lkeCOD_ALMA_DEST.Properties.Columns.Clear();
            lkci = new LookUpColumnInfo("ALF_ALMA", "Almacén Destino", 20);
            lkeCOD_ALMA_DEST.Properties.Columns.Add(lkci);
            lkeCOD_ALMA_DEST.Properties.DisplayMember = "ALF_ALMA";
            lkeCOD_ALMA_DEST.Properties.ValueMember = "COD_ALMA";

            lkeCOD_SOCI_NEGO_RESP_DEST.Properties.DataSource = olsre;
            lkeCOD_SOCI_NEGO_RESP_DEST.Properties.Columns.Clear();
            lkci = new LookUpColumnInfo("ALF_NOMB", "Responsable", 20);
            lkeCOD_SOCI_NEGO_RESP_DEST.Properties.Columns.Add(lkci);
            lkeCOD_SOCI_NEGO_RESP_DEST.Properties.DisplayMember = "ALF_NOMB";
            lkeCOD_SOCI_NEGO_RESP_DEST.Properties.ValueMember = "COD_SOCI_NEGO";

            lkeCOD_MOTI.Properties.DataSource = olsmo;
            lkeCOD_MOTI.Properties.Columns.Clear();
            lkci = new LookUpColumnInfo("ALF_MOTI", "Motivo", 20);
            lkeCOD_MOTI.Properties.Columns.Add(lkci);
            lkeCOD_MOTI.Properties.DisplayMember = "ALF_MOTI";
            lkeCOD_MOTI.Properties.ValueMember = "COD_MOTI";

            var obj = new BETransferGoodsDetail() { COD_USUA_CREA = SESSION_USER };
            var olst = new List<BETransferGoodsDetail>();
            olst.Add(obj);
            gdcDetail.DataSource = olst;
        }
Ejemplo n.º 4
0
        private void Set_Save()
        {
            MessageBoxIcon msgIcon = MessageBoxIcon.Warning;
            try
            {
                gdvGeneric.CloseEditor();
                gdvGeneric.RefreshData();
                var olst = (List<BEReason>)gdvGeneric.DataSource;
                var i = 1;
                olst.ForEach(item =>
                {
                    var context = new ValidationContext(item, null, null);
                    var errors = new List<ValidationResult>();
                    if (!Validator.TryValidateObject(item, context, errors, true))
                    {
                        foreach (ValidationResult result in errors)
                        {
                            msgIcon = MessageBoxIcon.Warning;
                            throw new ArgumentException(string.Format("{0}\nFila: {1}", result.ErrorMessage, i));
                        }
                    }
                    i++;
                });

                var obr = new BRReason();
                var obej = new BEReason();
                olst.ForEach(item => item.COD_COMP = xfMain.SgIns.SESSION_COMP);
                obr.Set_PSGN_SPMT_SVMC_MOTI(obej, olst);
                if (!string.IsNullOrWhiteSpace(obej.MSG_MNTN))
                {
                    msgIcon = MessageBoxIcon.Error;
                    throw new ArgumentException(obej.MSG_MNTN);
                }

                olst.RemoveAll(item => item.IND_MNTN == 3);
                olst.ForEach(item => item.IND_MNTN = 0);
                gdvGeneric.RefreshData();
                XtraMessageBox.Show(WhMessage.MsgSuccessfully, WhMessage.MsgInsCaption,
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    WhMessage.MsgInsCaption,
                                    MessageBoxButtons.OK,
                                    msgIcon);
            }
        }