private void BindSubGrid(RepeaterItem itm)
    {
        var grd        = itm.FindControl("gvNewOrder") as GridView;
        var trSubTable = itm.FindControl("trSubTable") as HtmlTableRow;
        int OrderID    = Convert.ToInt32((itm.FindControl("lblorderid") as Label).Text);

        ((ImageButton)itm.FindControl("ibtnNOExpColap")).ImageUrl = "~/images/collapse.JPG";
        DataTable dtAOPlist = orderobj.BindAdminOrderProductList(OrderID);
        string    str       = ((HiddenField)itm.FindControl("hfOrderPdf")).Value.ToString();

        if (dtAOPlist.Rows.Count > 0)
        {
            for (int i = 0; i < dtAOPlist.Rows.Count; i++)
            {
                if (dtAOPlist.Rows[i]["Country"].ToString() == "INDIA")
                {
                    dtAOPlist.Rows[i]["Country"] = "INR";
                }
                else
                {
                    dtAOPlist.Rows[i]["Country"] = "USD";
                }
            }
            if (!string.IsNullOrEmpty(str))
            {
                (itm.FindControl("hlPDF") as HyperLink).Visible = true;
                (itm.FindControl("lbtnOrderpdfDownload") as LinkButton).Visible = true;
            }
            else
            {
                (itm.FindControl("hlPDF") as HyperLink).ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            }
            grd.DataSource = dtAOPlist;
            grd.DataBind();
            trSubTable.Style.Add(HtmlTextWriterStyle.Display, "''");
        }
        else
        {
            trSubTable.Style.Add(HtmlTextWriterStyle.Display, "none");
        }
    }
Exemple #2
0
 private void BinddlOrderList()
 {
     dlOrderList.DataSource = orderobj.OrderList(ddlOrderStatus.Text, MudarLogin.GetBranchId());
     dlOrderList.DataBind();
     foreach (DataListItem dli in dlOrderList.Items)
     {
         int OrderID = Convert.ToInt32(dlOrderList.DataKeys[dli.ItemIndex]);
         ((ImageButton)dlOrderList.Items[dli.ItemIndex].FindControl("ibtnNOExpColap")).ImageUrl = "~/images/collapse.JPG";
         DataTable dtAOPlist = orderobj.BindAdminOrderProductList(OrderID);
         string    str       = ((HiddenField)dlOrderList.Items[dli.ItemIndex].FindControl("hfOrderPdf")).Value.ToString();
         if (dtAOPlist.Rows.Count > 0)
         {
             for (int i = 0; i < dtAOPlist.Rows.Count; i++)
             {
                 if (dtAOPlist.Rows[i]["Country"].ToString() == "INDIA")
                 {
                     dtAOPlist.Rows[i]["Country"] = "INR";
                 }
                 else
                 {
                     dtAOPlist.Rows[i]["Country"] = "USD";
                 }
             }
             if (!string.IsNullOrEmpty(str))
             {
                 (dli.FindControl("hlPDF") as HyperLink).Visible = true;
                 (dli.FindControl("lbtnOrderpdfDownload") as LinkButton).Visible = true;
             }
             else
             {
                 (dli.FindControl("hlPDF") as HyperLink).ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             }
             (dli.FindControl("gvNewOrder") as GridView).DataSource = dtAOPlist;
             (dli.FindControl("gvNewOrder") as GridView).DataBind();
         }
     }
 }