protected void but_reaction_Click(object sender, System.EventArgs e)
        {
            Datagrid4.Visible = false;
            Datagrid3.Visible = true;
            string s = "select a.individual_name,b.drug_trial_id,c.reaction_agent_id ,d.reaction_short_name from individual_master a,drug_trial_master b,Individual_reaction_master c,reaction_agent_master d where b.individual_id=" + Convert.ToInt32(Session["reg_id"]) + "and a.individual_id=" + Convert.ToInt32(Session["reg_id"]) + " and b.drug_trial_id=" + Session["i"] + " and c.drug_trial_id=" + Session["i"] + " and c.reaction_agent_id=d.reaction_agent_id";

            da = new SqlDataAdapter(s, cn);
            ds = new DataSet();
            da.Fill(ds, "reaction");
            Datagrid3.DataSource = ds;
            Datagrid3.DataBind();
        }
Ejemplo n.º 2
0
        //This is used to show the data in report.
        public void show()
        {
            grdLeg.Visible = true;
            int    x  = 0;
            object op = null;

            System.Data.SqlClient.SqlDataReader rdr = null;
            string sql = "select distinct productid from stock_master";

            // Calls the sp_stockmovement for each product and create one stkmv temp. table.
            dbobj.SelectQuery(sql, ref rdr);
            while (rdr.Read())
            {
                dbobj.ExecProc(OprType.Insert, "sp_stockmovement", ref op, "@id", Int32.Parse(rdr["productid"].ToString()), "@strfromdate", getdate(txtDateFrom.Text, true).Date.ToShortDateString(), "@strtodate", getdate(txtDateTo.Text, true).Date.ToShortDateString());
            }
            rdr.Close();
            dbobj.SelectQuery("select * from stkmv", ref rdr);
            if (rdr.HasRows)
            {
                grdLeg.DataSource = rdr;
                grdLeg.DataBind();
                grdLeg.Visible = false;
            }
            //***********************
            rdr.Close();

            dbobj.SelectQuery("select * from stkmv where category='Ibp grade'", ref rdr);
            if (rdr.HasRows)
            {
                Datagrid1.DataSource = rdr;
                Datagrid1.DataBind();
                Datagrid1.Visible = false;
            }
            rdr.Close();
            dbobj.SelectQuery("select * from stkmv where category='Eicher grade'", ref rdr);
            if (rdr.HasRows)
            {
                Datagrid2.DataSource = rdr;
                Datagrid2.DataBind();
                Datagrid2.Visible = false;
            }
            rdr.Close();
            dbobj.SelectQuery("select * from stkmv where category='Force grade'", ref rdr);
            if (rdr.HasRows)
            {
                Datagrid3.DataSource = rdr;
                Datagrid3.DataBind();
                Datagrid3.Visible = false;
            }
            if (eicher != 0)
            {
                eicher1 = "-" + eicher;
            }
            if (force != 0)
            {
                force1 = "-" + force;
            }
            if (sales1 != 0)
            {
                ibp1 = "-" + sales1;
            }
            grandtotal = sales - sales1 - eicher - force;
            //***********************
            // truncate table after use.
            dbobj.Insert_or_Update("truncate table stkmv", ref x);
        }