private void BindOrderDetails(int OrderID)
    {
        //string Bcommet = string.Empty;
        DataTable dtOrder = orderObj.OrderList(OrderID);

        if (dtOrder.Rows.Count > 0)
        {
            DataRow dr = dtOrder.Rows[0];
            lblOrderId.Text            = dr["OrderID"].ToString();
            lblPOID.Text               = dr["PurchaseOrderID"].ToString();
            Session["PurchaseOrderID"] = lblPOID.Text;
            Session["PODate"]          = dtOrder.Rows[0]["OrderDate"].ToString();
            if (!string.IsNullOrEmpty(dr["PurchaseOrderPath"].ToString()))
            {
                hfPdf.NavigateUrl = dr["PurchaseOrderPath"].ToString();
            }
            else
            {
                hfPdf.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            }
            if (!string.IsNullOrEmpty(dr["LSpath"].ToString()))
            {
                hfLS.NavigateUrl = dr["LSpath"].ToString();
            }
            else
            {
                hfLS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            }
            lblOtype.Text = dr["OrderType"].ToString();
            if (dr["OrderType"].ToString() == "order")
            {
                lblLotsample.Text = dr["LotSampleID"].ToString();
            }
            if (!string.IsNullOrEmpty(lblLotsample.Text))
            {
                lblLotsample.Visible = true;
            }
            else
            {
                lblLotsample.Visible = false;
            }
            if (dr["AdminOrderStatus"].ToString() == "NEW" || !string.IsNullOrEmpty(lblLotsample.Text))
            {
                btnPlaceBrnchOrder.Visible = true;
                btnDisable.Visible         = false;
            }
            else if (!string.IsNullOrEmpty(dr["BranchOrderId"].ToString()))
            {
                btnPlaceBrnchOrder.Visible = false;
                btnDisable.Enabled         = false;;
                btnDisable.Visible         = true;
                btnDisable.ForeColor       = System.Drawing.ColorTranslator.FromHtml("Gray");
                DataTable dtBOPlist = orderObj.GetBranchPathDetails(OrderID.ToString());
                string    strLS     = dtBOPlist.Rows[0]["BLSpath"].ToString();
                string    str       = dtBOPlist.Rows[0]["BranchOrderPath"].ToString();
                if (dtBOPlist.Rows.Count > 0)
                {
                    if (!string.IsNullOrEmpty(strLS))
                    {
                        hfBrLS.NavigateUrl = strLS;
                    }
                    else
                    {
                        hfBrLS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        hfBrPO.NavigateUrl = str;
                    }
                    else
                    {
                        hfBrPO.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                    }
                }
            }
            else
            {
                btnPlaceBrnchOrder.Visible = false;
                btnDisable.Visible         = true;
            }
            if (dr["AdminOrderStatus"].ToString() == "DISPATCH" || dr["AdminOrderStatus"].ToString() == "SAMPLE DISPATCH")
            {
                Enablecontrols();
                if (dr["OrderType"].ToString() == "LotSample")
                {
                    divLSMsg.Visible = true;
                    DataTable dt = new DataTable();
                    dt = orderObj.GetAdminCommentDetails(OrderID.ToString());
                    if (dt.Rows.Count > 0)
                    {
                        string Msg = dt.Rows[0]["Comments"].ToString();
                        if (Msg.Contains("#"))
                        {
                            string[] po = dt.Rows[0]["Comments"].ToString().Split('#');
                            if (po[1].ToString() != string.Empty)
                            {
                                txtLSmsg.Text          = po[1].ToString();
                                btnDisableSend.Visible = true;
                                btnSend.Visible        = false;
                            }
                        }
                    }
                }
            }
            if (dr["AdminOrderStatus"].ToString() == "BLENDING")
            {
                //if (dr["OrderType"].ToString() == "LotSample")
                //{
                //    Enacontrols();
                //    divLSMsg.Visible = true;
                //}
            }
            if (dr["AdminOrderStatus"].ToString() == "INPROCESS")
            {
                btnPlaceBrnchOrder.Visible = false;
                btnDisable.Enabled         = false;
                btnDisable.Visible         = true;
            }
            Session["AdminOrderStatus"] = dr["AdminOrderStatus"].ToString().ToUpper();
            //ddlOrderStatus.Items.FindByValue(dr["OrderStatus"].ToString().ToUpper()).Selected = true;
            //Session["BuyerId"] = dr["BuyerID"].ToString();
            //hlBuyer.Text = dr["BuyerCompanyName"].ToString();
            //lblBranchOrderID.Text = dr["BranchOrderId"].ToString();
            //lblBOtype.Text = dr["BOrderType"].ToString();
            //lblBPOID.Text = dr["BranchPOID"].ToString();
            //lbtnBranchName.Text = dr["Bname"].ToString();
            //hlBranchPDF.NavigateUrl = dr["BranchOrderPath"].ToString();
            //txtComments.Text = dr["O_Comments"].ToString().Replace("<br/>", System.Environment.NewLine);
            //txtBComments.Text = dr["B_Comments"].ToString().Replace("<br/>", System.Environment.NewLine);
            //ddlBStatus.ClearSelection();
            //if (!string.IsNullOrEmpty(dr["bOrderStatus"].ToString()))
            //    ddlBStatus.Items.FindByValue(dr["bOrderStatus"].ToString().ToUpper()).Selected = true;
        }
    }