コード例 #1
0
        public DataTable Listar()
        {
            int numMaxDigitos = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["NroMaxDigitos"]);

            System.Data.DataTable dt = new System.Data.DataTable();
            dt = null;

            try
            {
                DA.SCE_CARTEL_DA DA = new DA.SCE_CARTEL_DA(usrLogin);
                if (DA.Listar().Count > 0)
                {
                    return(PivotDtCartelXModelo(ListToDataTable(DA.Listar()), "NOM_MODELO", numMaxDigitos));
                }
                else
                {
                    return(dt);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public string IsValid(int Id, string nombre, bool operacion)
        {
            string mensaje = "";

            try
            {
                if ((nombre == null) || (nombre.Length == 0))
                {
                    return(mensaje = System.Configuration.ConfigurationManager.AppSettings["MC_CN"]);
                }

                DA.SCE_CARTEL_DA     DA     = new DA.SCE_CARTEL_DA(usrLogin);
                List <SCE_CARTEL_BE> plista = DA.Listar();

                if (operacion == false)
                {
                    for (int i = 0; i < plista.Count; i++)
                    {
                        if ((plista[i].ID_CARTEL != Id) && (plista[i].CARTEL == nombre))
                        {
                            return(mensaje = System.Configuration.ConfigurationManager.AppSettings["MC_ND"]);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < plista.Count; i++)
                    {
                        if (plista[i].CARTEL == nombre)
                        {
                            return(mensaje = System.Configuration.ConfigurationManager.AppSettings["MC_ND"]);
                        }
                    }
                }

                return(mensaje);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }