string querya = "SELECT * FROM projects WHERE project_Id = " + P_ID + " and Estimation_Date = '" + C_DATE + "'";
string queryb = "SELECT t.project_Id, t.Type, t.Name, t.Description, t.Quantity FROM type t inner join projects p on t.project_Id = p.project_Id WHERE t.project_Id = " + P_ID + "";
string queryc = "SELECT m.type_Id, m.project_Id, m.Metal_Reinforcement, m.Quantity, m.Price_Bar FROM metal_reinforcement m inner join type t on m.type_Id = t.type_Id WHERE m.project_Id = " + P_ID +"";
string queryd = "SELECT tw.type_Id, tw.project_Id, tw.Tie_Wire_Kilogram, tw.Price_Kilogram FROM tie_wire tw inner join type t on tw.type_Id = t.type_Id WHERE tw.project_Id = " + P_ID + "";
string querye = "SELECT c.type_Id, c.project_Id, c.Cement_Bag, c.Price_Bag FROM cement c inner join type t on c.type_Id = t.type_Id WHERE c.project_Id = " + P_ID + "";
string queryf = "SELECT g.type_Id, g.project_Id, g.Gravel_CubicMeter, g.Price_Gravel FROM gravel g inner join type t on g.type_Id = t.type_Id WHERE g.project_Id = " + P_ID + "";
string queryg = "SELECT s.type_Id, s.project_Id, s.Sand_CubicMeter, s.Price_Sand FROM sand s inner join type t on s.type_Id = t.type_Id WHERE s.project_Id = " + P_ID + "";
string queryh = "SELECT hb.type_Id, hb.project_Id, hb.CHB_Size, hb.Quantity, hb.Price_Chb FROM hollow_blocks hb inner join type t on hb.type_Id = t.type_Id WHERE hb.project_Id = " + P_ID + "";
SqlConnection conn = new SqlConnection(PROJECTS_CONN_DB);
EstimationSummary ds = new EstimationSummary();
conn.Open();
SqlDataAdapter dscmd = new SqlDataAdapter(querya, conn);
dscmd.Fill(ds.projects);
dscmd.SelectCommand.CommandText = queryb;
dscmd.Fill(ds.type);
dscmd.SelectCommand.CommandText = queryc;
dscmd.Fill(ds.metal_reinforcement);
dscmd.SelectCommand.CommandText = queryd;
dscmd.Fill(ds.tie_wire);
dscmd.SelectCommand.CommandText = querye;
dscmd.Fill(ds.cement);
dscmd.SelectCommand.CommandText = queryf;
dscmd.Fill(ds.gravel);
dscmd.SelectCommand.CommandText = queryg;
dscmd.Fill(ds.sand);
dscmd.SelectCommand.CommandText = queryh;
dscmd.Fill(ds.hollow_blocks);
EstimationReport objRpt = new EstimationReport();
objRpt.SetDataSource(ds);
conn.Close();
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Refresh();
string queryb = "SELECT t.project_Id, t.Type, t.Name, t.Description, t.Quantity FROM type t inner join projects p on t.project_Id = p.project_Id WHERE t.project_Id = " + P_ID + "";
string queryc = "SELECT m.type_Id, m.project_Id, m.Metal_Reinforcement, m.Quantity, m.Price_Bar FROM metal_reinforcement m inner join type t on m.type_Id = t.type_Id WHERE m.project_Id = " + P_ID +"";
string queryd = "SELECT tw.type_Id, tw.project_Id, tw.Tie_Wire_Kilogram, tw.Price_Kilogram FROM tie_wire tw inner join type t on tw.type_Id = t.type_Id WHERE tw.project_Id = " + P_ID + "";
string querye = "SELECT c.type_Id, c.project_Id, c.Cement_Bag, c.Price_Bag FROM cement c inner join type t on c.type_Id = t.type_Id WHERE c.project_Id = " + P_ID + "";
string queryf = "SELECT g.type_Id, g.project_Id, g.Gravel_CubicMeter, g.Price_Gravel FROM gravel g inner join type t on g.type_Id = t.type_Id WHERE g.project_Id = " + P_ID + "";
string queryg = "SELECT s.type_Id, s.project_Id, s.Sand_CubicMeter, s.Price_Sand FROM sand s inner join type t on s.type_Id = t.type_Id WHERE s.project_Id = " + P_ID + "";
string queryh = "SELECT hb.type_Id, hb.project_Id, hb.CHB_Size, hb.Quantity, hb.Price_Chb FROM hollow_blocks hb inner join type t on hb.type_Id = t.type_Id WHERE hb.project_Id = " + P_ID + "";
SqlConnection conn = new SqlConnection(PROJECTS_CONN_DB);
EstimationSummary ds = new EstimationSummary();
conn.Open();
SqlDataAdapter dscmd = new SqlDataAdapter(querya, conn);
dscmd.Fill(ds.projects);
dscmd.SelectCommand.CommandText = queryb;
dscmd.Fill(ds.type);
dscmd.SelectCommand.CommandText = queryc;
dscmd.Fill(ds.metal_reinforcement);
dscmd.SelectCommand.CommandText = queryd;
dscmd.Fill(ds.tie_wire);
dscmd.SelectCommand.CommandText = querye;
dscmd.Fill(ds.cement);
dscmd.SelectCommand.CommandText = queryf;
dscmd.Fill(ds.gravel);
dscmd.SelectCommand.CommandText = queryg;
dscmd.Fill(ds.sand);
dscmd.SelectCommand.CommandText = queryh;
dscmd.Fill(ds.hollow_blocks);
EstimationReport objRpt = new EstimationReport();
objRpt.SetDataSource(ds);
conn.Close();
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Refresh();