예제 #1
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DropDownList1.SelectedItem.Value == "1")
     {
         SqlCommand cmd = new SqlCommand("Profit_CalcProc", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@UserID", Session["UserID"]);
         cmd.Parameters.AddWithValue("@mode", 5);
         SqlDataAdapter adp = new SqlDataAdapter(cmd);
         DataSet        ds  = new DataSet();
         adp.Fill(ds);
         GridViewtop10.DataSource = ds;
         GridViewtop10.DataBind();
     }
     else
     {
         if (DropDownList1.SelectedItem.Value == "2")
         {
             SqlCommand cmd = new SqlCommand("Profit_CalcProc", conn);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@UserID", Session["UserID"]);
             cmd.Parameters.AddWithValue("@mode", 4);
             SqlDataAdapter adp = new SqlDataAdapter(cmd);
             DataSet        ds  = new DataSet();
             adp.Fill(ds);
             GridViewtop10.DataSource = ds;
             GridViewtop10.DataBind();
         }
     }
 }
예제 #2
0
        public void default_profit()
        {
            SqlCommand cmd = new SqlCommand("Profit_CalcProc", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@UserID", Session["UserID"]);
            cmd.Parameters.AddWithValue("@mode", 5);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet        ds  = new DataSet();

            adp.Fill(ds);
            GridViewtop10.DataSource = ds;
            GridViewtop10.DataBind();
        }