Beispiel #1
0
    private void SetInitialRowGRDOUTSTANDINGPO()
    {
        try
        {
            DataTable dt = new DataTable();
            DataRow   dr = null;

            dt.Columns.Add(new DataColumn("#", typeof(Int32)));
            dt.Columns.Add(new DataColumn("SuplierName", typeof(string)));
            dr = dt.NewRow();

            dr["#"]           = 0;
            dr["SuplierName"] = "";
            dt.Rows.Add(dr);
            ViewState["CurrentTable"]   = dt;
            GRDOUTSTANDINGPO.DataSource = dt;
            GRDOUTSTANDINGPO.DataBind();
            dt = null;
            dr = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Beispiel #2
0
 private void ReportGrid(string StrCondition)
 {
     try
     {
         if (rdoPOSTATUSWISE.SelectedValue == "0")
         {
             DsGrd = Obj_PO.GetPOForStatusReport(StrCondition, out StrError);
             if (DsGrd.Tables.Count > 0 && DsGrd.Tables[0].Rows.Count > 0)
             {
                 if (!FlagPrint)
                 {
                     ImgBtnPrint.Visible = true;
                 }
                 if (!FlagPrint)
                 {
                     ImgBtnExport.Visible = true;
                 }
                 GrdReport.DataSource = DsGrd.Tables[0];
                 GrdReport.DataBind();
                 lblCount.Text    = DsGrd.Tables[0].Rows.Count + " Records Found";
                 lblCount.Visible = true;
             }
             else
             {
                 GrdReport.DataSource = null;
                 GrdReport.DataBind();
                 lblCount.Text    = DsGrd.Tables[0].Rows.Count + " Records Found";
                 lblCount.Visible = true;
                 SetInitialRow();
             }
         }
         else
         {
             DsGrd = Obj_PO.GetPOForStatusReportOS(StrCondition, out StrError);
             if (DsGrd.Tables.Count > 0 && DsGrd.Tables[0].Rows.Count > 0)
             {
                 if (!FlagPrint)
                 {
                     ImgBtnPrint.Visible = true;
                 }
                 if (!FlagPrint)
                 {
                     ImgBtnExport.Visible = true;
                 }
                 GRDOUTSTANDINGPO.DataSource = DsGrd.Tables[0];
                 GRDOUTSTANDINGPO.DataBind();
                 lblCount.Text    = DsGrd.Tables[0].Rows.Count + " Records Found";
                 lblCount.Visible = true;
             }
             else
             {
                 GRDOUTSTANDINGPO.DataSource = null;
                 GRDOUTSTANDINGPO.DataBind();
                 lblCount.Text    = DsGrd.Tables[0].Rows.Count + " Records Found";
                 lblCount.Visible = true;
                 SetInitialRowGRDOUTSTANDINGPO();
             }
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }