public Login(BDS B, XmlElementoSer C, Globales V) { try { InitializeComponent(); label1.BackColor = Color.Transparent; label2.BackColor = Color.Transparent; pictureBox1.BackColor = Color.Transparent; label1.Parent = pictureBox2; label2.Parent = pictureBox2; pictureBox1.Parent = pictureBox2; BD = B; XmlConfig = C; Cr = V; BS = new BindingSource(); BS.DataSource = BD.Tabla("Usuarios"); BS.Filter = "Administrador=true AND VIP='" + V.VVIP + "'"; CUsuarios.DataSource = BS; CUsuarios.ValueMember = "Usuario"; CUsuarios.DisplayMember = "Usuario"; } catch (Exception ex) { Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11)); } }
public PPal() { try { aux = false; Pulsado = false; InitializeComponent(); Botones.BackColor = Color.Transparent; pictureBox1.BackColor = Color.Transparent; pictureBox2.BackColor = Color.Transparent; pictureBox3.BackColor = Color.Transparent; pictureBox4.BackColor = Color.Transparent; Botones.Parent = pictureBox5; pictureBox1.Parent = pictureBox5; pictureBox2.Parent = pictureBox5; pictureBox3.Parent = pictureBox5; pictureBox4.Parent = pictureBox5; xml = new XmlElementoSer(); BD = new BDS(); Variables = new Globales(); xml.Open(true, ref aux); Variables.VVIP = aux; BD.Open(xml.VConex, true, xml.VTablas); BD.BD("DELETE FROM Noticias WHERE Fecha<'" + string.Format("{0:yyyy/MM/dd HH:mm}", FechNY2()) + "'"); System.Threading.Thread.Sleep(200); BD.Open(xml.VConex, true, xml.VTablas); BS = new BindingSource(); BS.DataSource = BD.Tabla("Usuarios"); BS.Filter = "VIP='" + Variables.VVIP + "'"; Clientes = new CUsuarios(); SP = new System.Media.SoundPlayer("Sonido.wav"); pictureBox2.Visible = false; DGNot.DataSource = BD.Tabla("Noticias"); DGNot.Columns[0].Visible = false; DGNot.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; DGNot.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; DocConf.Load("Config.xml"); n = DocConf.SelectSingleNode("Config"); if (n != null) { version = Convert.ToInt16(n.ChildNodes.Item(3).InnerText); } } catch (Exception ex) { Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11)); } }
public static int Login(CUsuarios Us, BDS Base, string txt, ref string Nom, ref string cl) { string[] res; res = Captura(txt); if (res.Length == 2) { Nom = res[0]; cl = res[1]; } else { return(0); } DataRow[] DRC; try { if (Us.Exist(Nom)) { return(4); } DRC = Base.Tabla("Usuarios").Select("Usuario='" + Nom + "' AND VIP='false'"); if (DRC.Length > 0) { TimeSpan duracion = DateTime.Parse(DRC[0].ItemArray[8].ToString()) - DateTime.Today; if (duracion.Days < 0) { return(1); } if (DRC[0].ItemArray[2].ToString() == Encriptar(cl)) { return(2); } } else { return(0); } return(0); } catch (Exception ex) { return(0); } }
public Usuarios(BDS B, bool VVIP, XmlElementoSer X) { try { InitializeComponent(); toolStrip1.BackColor = Color.Transparent; groupBox2.BackColor = Color.Transparent; groupBox1.BackColor = Color.Transparent; groupBox2.Location = new Point(13, 155); toolStrip1.Parent = pictureBox1; groupBox2.Parent = pictureBox1; groupBox1.Parent = pictureBox1; Xl = X; Vp = VVIP; BD = B; BS = new BindingSource(); BS.DataSource = BD.Tabla("Usuarios"); BS.Filter = "VIP='" + VVIP + "'"; DG.DataSource = BS; DG.Columns[0].Visible = DG.Columns[2].Visible = DG.Columns[4].Visible = DG.Columns[5].Visible = DG.Columns[7].Visible = false; TUsuario.DataBindings.Add(new Binding("Text", BS, "Usuario")); TUsuario.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.Never; TMail.DataBindings.Add(new Binding("Text", BS, "Correo")); TMail.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.Never; CHAdmin.DataBindings.Add(new Binding("Checked", BS, "Administrador")); CHAdmin.DataBindings[0].DataSourceUpdateMode = DataSourceUpdateMode.Never; } catch (Exception ex) { Funciones.Log(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase), ex.Message + ex.StackTrace.Substring(ex.StackTrace.Length - 11)); } }