/// <summary> /// Fetch all Preorder Data on Page load or when user do not select anyvalue from dropdown /// </summary> private void GetData() { objWorkFlow = new WorkFlow(); objWorkFlow.WFID = Convert.ToInt32(Request.QueryString["WFID"]); DataTable dt = objWorkFlow.GetReceiptNo(); if (dt.Rows.Count > 0) { if (dt.Rows[0]["ReceiptNo"].ToString() != "") { DataTable dtAllReceiptDetails = new DataTable(); foreach (DataRow dr in dt.Rows) { //loop thru receipt to get single row at a time and add that to a datatable i.e merge // at last bind the merged datatable to gvData string sReceiptNumber = dr["ReceiptNo"].ToString(); // string sPMDLDocNumber = dr["PMDLDocNo"].ToString(); //DataTable dtReceipt = objWorkFlow.GetReceiptDetails(sReceiptNumber, sPMDLDocNumber); DataTable dtReceipt = objWorkFlow.GetReceiptDetails(sReceiptNumber); dtAllReceiptDetails.Merge(dtReceipt); } if (dtAllReceiptDetails.Rows.Count > 0) { gvData.Visible = true; lblNoRecord.Visible = false; gvData.DataSource = dtAllReceiptDetails; // gvData.RowDataBound += new GridViewRowEventHandler(gvData_RowDataBound); gvData.DataBind(); } else { gvData.Visible = false; lblNoRecord.Visible = true; lblNoRecord.Text = "No Record Found for WFID -" + objWorkFlow.WFID + "!"; } } } else { gvData.Visible = false; lblNoRecord.Visible = true; lblNoRecord.Text = "No Record Found for WFID -" + objWorkFlow.WFID + "!"; } }