예제 #1
0
    protected void BtnLogin_Click(object sender, EventArgs e)
    {
        SuperConn scnn = new SuperConn("User.accdb");

        scnn.Open();
        string _sql = "SELECT * FROM T_user WHERE (U_name = '" + TbName.Text + "' AND U_password = '******' AND U_valid = True)";
        //Response.Write(_sql);
        OleDbDataReader dr = scnn.GetDataReader(_sql);

        if (dr.Read())
        {
            //Response.Write(_sql);
            Session["user"] = TbName.Text;

            Boolean i = Boolean.Parse(dr["U_admin"].ToString());
            if (i)
            {
                Session["admin"] = i;
            }
            LabelState.Text = "登陆成功!";
        }
        else
        {
            LabelState.Text = "登录失败!";
        }
        scnn.Close();
        LabelState.Visible = true;
        TbName.Text        = TbPassword.Text = "";
    }
예제 #2
0
    protected void BtnRegister_Click(object sender, EventArgs e)
    {
        if (TbPassword1.Text == TbPassword2.Text)
        {
            SuperConn scnn = new SuperConn("User.accdb");
            scnn.Open();
            string _sql = "INSERT INTO T_user (U_name, U_password, U_truename) VALUES ('" + TbName.Text + "', '" + TbPassword1.Text + "', '" + TbTrueName.Text + "')";
            //Response.Write(_sql);
            OleDbCommand cmd = new OleDbCommand(_sql, scnn.cnn);
            int          i   = cmd.ExecuteNonQuery();
            if (i > 0)
            {
                LabelState.Text = "注册成功,等待确认!";
            }
            else
            {
                LabelState.Text = "注册失败!请通知管理员!";
            }

            scnn.Close();
        }
        else
        {
            LabelState.Text = "注册失败,两次输入密码不一致!";
        }
        LabelState.Visible = true;
    }
예제 #3
0
    protected void BtnInsertMsg_Click(object sender, EventArgs e)
    {
        SuperConn scnn = new SuperConn("Message.accdb");

        scnn.Open();
        string _sql = "INSERT INTO T_message (M_name, M_time, M_message, M_visible) VALUES ('" + LabelNameMsg.Text + "', '" + DateTime.Now.ToString() + "', '" + TBTextMsg.Text + "', " + CBvisible.Checked.ToString() + ")";
        //Response.Write(_sql);
        OleDbCommand cmd = new OleDbCommand(_sql, scnn.cnn);

        cmd.ExecuteNonQuery();
        scnn.Close();
        LVmsg.DataBind();
    }
예제 #4
0
    protected void MarkDelete(Object s, CommandEventArgs e)
    {
        //Response.Write(e.CommandArgument.ToString());
        SuperConn scnn = new SuperConn("OrderData.accdb");

        scnn.Open();
        string       _sql = "UPDATE T_order SET O_delete=True WHERE O_id=" + e.CommandArgument.ToString();
        OleDbCommand cmd  = new OleDbCommand(_sql, scnn.cnn);

        cmd.ExecuteNonQuery();
        scnn.Close();
        lvorder.DataBind();
    }
예제 #5
0
 protected void BtnConfirm_Click(object sender, EventArgs e)
 {
     if (tbname.Text.Length > 0)
     {
         SuperConn scnn = new SuperConn("OrderData.accdb");
         scnn.Open();
         string       _sql = "INSERT INTO T_order (O_ordertime, O_orderer, O_name, O_brand, O_item, O_number, O_note, O_edit) VALUES ('" + DateTime.Now.ToShortDateString() + "', '" + Session["user"] + "', '" + tbname.Text + "', '" + tbbrand.Text + "', '" + tbitem.Text + "', '" + tbnumber.Text + "', '" + tbnote.Text + "', True)";
         OleDbCommand cmd  = new OleDbCommand(_sql, scnn.cnn);
         int          i    = cmd.ExecuteNonQuery();
         scnn.Close();
         tbname.Text = "";
         if (i > 0)
         {
             lvorder.DataBind();
             MultiView1.ActiveViewIndex = 1;
         }
     }
 }
예제 #6
0
 protected void BtnConfirm_Click(object sender, EventArgs e)
 {
     if (tbname.Text.Length > 0)
     {
         SuperConn scnn = new SuperConn("Antibody.accdb");
         scnn.Open();
         string       _sql = "INSERT INTO T_Antibody (A_no, A_name, A_background) VALUES ('" + tbitem.Text + "', '" + tbname.Text + "', '" + tbbackground.Text + "')";
         OleDbCommand cmd  = new OleDbCommand(_sql, scnn.cnn);
         int          i    = cmd.ExecuteNonQuery();
         scnn.Close();
         tbname.Text = "";
         if (i > 0)
         {
             SqlDataSourceantibody.DataBind();
             MVantibody.ActiveViewIndex = 0;
         }
     }
 }
예제 #7
0
 protected void BtnConfirm_Click(object sender, EventArgs e)
 {
     if (tbname.Text.Length > 0)
     {
         SuperConn scnn = new SuperConn("Primer.accdb");
         scnn.Open();
         string _sql = "INSERT INTO T_primer (Pr_date, Pr_orderer, Pr_name, Pr_use, Pr_sequence) VALUES ('" + DateTime.Now.ToShortDateString() +
                       "', '" + Session["user"] + "', '" + tbname.Text + "', '" + tbuse.Text + "', '" + tbsequence.Text + "')";
         OleDbCommand cmd = new OleDbCommand(_sql, scnn.cnn);
         int          i   = cmd.ExecuteNonQuery();
         scnn.Close();
         tbname.Text = "";
         if (i > 0)
         {
             SqlDataSourceprimer.DataBind();
             MVprimer.ActiveViewIndex = 0;
         }
     }
 }
예제 #8
0
    protected void ReOrder(object s, CommandEventArgs e)
    {
        SuperConn scnn = new SuperConn("OrderData.accdb");

        scnn.Open();
        string          _sql = "SELECT * FROM T_order WHERE O_id=" + e.CommandArgument.ToString();
        OleDbDataReader dr   = scnn.GetDataReader(_sql);

        dr.Read();
        try
        {
            tbname.Text   = dr["O_name"].ToString();
            tbbrand.Text  = dr["O_brand"].ToString();
            tbitem.Text   = dr["O_item"].ToString();
            tbnumber.Text = dr["O_number"].ToString();
        }
        catch { }
        scnn.Close();
        MultiView1.ActiveViewIndex = 0;
    }
예제 #9
0
 protected void BtnConfirm_Click(object sender, EventArgs e)
 {
     if (tbprimer.Text.Length > 0)
     {
         SuperConn scnn = new SuperConn("Sequencing.accdb");
         scnn.Open();
         string _sql = "INSERT INTO T_sequencing (S_date, S_orderer, S_vector, S_tag, S_slice, S_length, S_primer, S_type, S_full) VALUES ('" +
                       DateTime.Now.ToShortDateString() + "', '" + Session["user"] + "', '" + tbvector.Text + "', '" + tbtag.Text + "', '" + tbslice.Text +
                       "', '" + tblength.Text + "', '" + tbprimer.Text + "', '" + tbtype.Text + "', " + cbfull.Checked + ")";
         OleDbCommand cmd = new OleDbCommand(_sql, scnn.cnn);
         Response.Write(_sql);
         int i = cmd.ExecuteNonQuery();
         scnn.Close();
         tbprimer.Text = "";
         if (i > 0)
         {
             SqlDataSourcesequencing.DataBind();
             MVsequencing.ActiveViewIndex = 0;
         }
     }
 }