Esempio n. 1
0
 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
 {
     if (BLAutot.authenticateUser(
             BLAutot.regexString(Login1.UserName.ToString(), "userName"),
             BLAutot.regexString(Login1.Password.ToString(), "password")))
     {
         e.Authenticated = true;
     }
     else
     {
         e.Authenticated = false;
     }
 }
Esempio n. 2
0
    protected void autoNakyma_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridViewRow row = autoNakyma.Rows[e.RowIndex];

        autoLista[e.RowIndex].Merkki      = BLAutot.regexString(((TextBox)(row.Cells[1].Controls[0])).Text, "Merkki");
        autoLista[e.RowIndex].Aid         = BLAutot.regexString((((TextBox)(row.Cells[2].Controls[0])).Text), "Aid");
        autoLista[e.RowIndex].Rekkari     = BLAutot.regexString((((TextBox)(row.Cells[3].Controls[0])).Text), "Rekkari");
        autoLista[e.RowIndex].Malli       = BLAutot.regexString((((TextBox)(row.Cells[4].Controls[0])).Text), "Malli");
        autoLista[e.RowIndex].Vm          = int.Parse(BLAutot.regexString((((TextBox)(row.Cells[5].Controls[0])).Text), "Vm"));
        autoLista[e.RowIndex].MyyntiHinta = int.Parse(BLAutot.regexString((((TextBox)(row.Cells[6].Controls[0])).Text), "MyyntiHinta"));
        autoLista[e.RowIndex].SOstoHinta  = int.Parse(BLAutot.regexString((((TextBox)(row.Cells[6].Controls[0])).Text), "SOstoHinta"));

        autoNakyma.EditIndex = -1;
        toGridView(autoLista);
    }
    protected void gvAutot_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridViewRow row = gvAutot.Rows[e.RowIndex];

        Regex reg = new Regex(@"^[a-zA-Z'.\s]{7,7}$");

        autoLista[e.RowIndex].Merkki      = BLAutot.regexString(((TextBox)(row.Cells[1].Controls[0])).Text, "Merkki");
        autoLista[e.RowIndex].Aid         = BLAutot.regexString((((TextBox)(row.Cells[2].Controls[0])).Text), "Aid");
        autoLista[e.RowIndex].Rekkari     = BLAutot.regexString((((TextBox)(row.Cells[3].Controls[0])).Text), "Rekkari");
        autoLista[e.RowIndex].Malli       = BLAutot.regexString((((TextBox)(row.Cells[4].Controls[0])).Text), "Malli");
        autoLista[e.RowIndex].Vm          = int.Parse(BLAutot.regexString((((TextBox)(row.Cells[5].Controls[0])).Text), "Vm"));
        autoLista[e.RowIndex].MyyntiHinta = int.Parse(BLAutot.regexString((((TextBox)(row.Cells[6].Controls[0])).Text), "MyyntiHinta"));
        autoLista[e.RowIndex].OstoHinta   = int.Parse(BLAutot.regexString((((TextBox)(row.Cells[6].Controls[0])).Text), "OstoHinta"));

        gvAutot.EditIndex = -1;
        toGridView(autoLista);
    }