Ejemplo n.º 1
0
 protected void dlOrderList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView drv    = (DataRowView)(e.Item.DataItem);
         string      Status = drv.Row["OrderStatus"].ToString();
         if (Status == "NEW")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Orange;
         }
         if (Status == "INPROCESS")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.DarkSalmon;
         }
         if (Status == "COLLECTING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.BlueViolet;
         }
         if (Status == "BLENDING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.DarkGreen;
         }
         if (Status == "TESTING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Blue;
         }
         if (Status == "PACKING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.OrangeRed;
         }
         if (Status == "SAMPLE DISPATCH")
         {
             Label lbl = (Label)e.Item.FindControl("lblMSg");
             lbl.ForeColor = System.Drawing.Color.Red;
             Label lblOrderID = (Label)e.Item.FindControl("lbtnOrderID");
             dt = orderobj.GetAdminCommentDetails(lblOrderID.Text);
             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)
                     {
                         lbl.Visible = true;
                         lbl.Text    = po[1].ToString();
                     }
                 }
             }
         }
     }
 }
 protected void dlOrderHistory_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataTable   dt     = new DataTable();
         DataTable   dt1    = new DataTable();
         DataRowView drv    = (DataRowView)(e.Item.DataItem);
         string      Status = drv.Row["OrderStatus"].ToString();
         if (Status == "NEW")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Orange;
         }
         if (Status == "INPROCESS" || Status == "COLLECTING" || Status == "BLENDING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.DarkGreen;
         }
         if (Status == "PACKING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.OrangeRed;
         }
         if (Status == "SHIPPING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Brown;
         }
         if (Status == "DISPATCH")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.DarkBlue;
         }
         if (Status == "INTRANSIT")
         {
             Label      lblM  = (Label)e.Item.FindControl("lblMSg");
             LinkButton lbtnO = (LinkButton)e.Item.FindControl("lbtnOrderID");
             dt1 = orderObj.GetAdminCommentDetails(lbtnO.Text);
             string Msg1 = dt1.Rows[0]["Comments"].ToString();
             if (Msg1.Contains("$"))
             {
                 lblM.Visible = true;
                 string[] po = Msg1.Split('$');
                 lblM.Text      = po[1].ToString();
                 lblM.ForeColor = System.Drawing.Color.Red;
             }
         }
         if (Status == "CLOSE")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Violet;
         }
     }
 }
    protected void dlOrderList_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            BindSubGrid(e.Item);
            DataTable   dt     = new DataTable();
            DataTable   dt1    = new DataTable();
            DataRowView drv    = (DataRowView)(e.Item.DataItem);
            string      Status = drv.Row["OrderStatus"].ToString();
            string      Otype  = drv.Row["OrderType"].ToString();
            if (Otype == "order")
            {
                Label lblT = (Label)e.Item.FindControl("lblType");
                lblT.ForeColor = System.Drawing.Color.Green;
            }
            if (Otype == "LotSample")
            {
                Label lblT = (Label)e.Item.FindControl("lblType");
                lblT.ForeColor = System.Drawing.Color.Orange;
            }
            Label lbl = (Label)e.Item.FindControl("lblStatus");
            switch (Status)
            {
            case "NEW":
                lbl.ForeColor = System.Drawing.Color.Orange;
                Button btn            = (Button)e.Item.FindControl("btnAssign");
                Label  lblOrderAssign = e.Item.FindControl("lblOrderAssign") as Label;
                if (string.IsNullOrEmpty(lblOrderAssign.Text) || lblOrderAssign.Text.Equals("0"))
                {
                    btn.Visible = true;
                    var lblBranch = e.Item.FindControl("lblBranch") as Label;
                    lblBranch.Visible = false;
                    var lblorderid = e.Item.FindControl("lblorderid") as Label;
                    btn.OnClientClick = "return fnShowBranches('" + lblorderid.Text + "')";
                }
                break;

            case "INPROCESS":
                lbl.ForeColor = System.Drawing.Color.DarkSalmon;
                break;

            case "COLLECTING":
                lbl.ForeColor = System.Drawing.Color.BlueViolet;
                break;

            case "BLENDING":
                lbl.ForeColor = System.Drawing.Color.DarkGreen;
                break;

            case "PACKING":
                lbl.ForeColor = System.Drawing.Color.OrangeRed;
                break;

            case "SAMPLE DISPATCH":
                Label      lblMSg     = (Label)e.Item.FindControl("lblMSg");
                string     text       = string.Empty;
                LinkButton lbtnO      = (LinkButton)e.Item.FindControl("lbtnOrderID");
                Label      lblcourier = (Label)e.Item.FindControl("lblCourier");
                dt1 = orderobj.GetAdminCommentDetails(lbtnO.Text);
                string Msg1 = dt1.Rows[0]["Comments"].ToString();
                if (Msg1.Contains("#"))
                {
                    string[] po = Msg1.Split('#');
                    lblcourier.Text      = po[1].ToString();
                    lbl.Visible          = false;
                    lblcourier.Visible   = true;
                    lblcourier.ForeColor = System.Drawing.Color.Red;
                }
                else
                {
                    dt = orderobj.GetssampleQtyandMsgAdmin(lbtnO.Text);
                    if (dt.Rows.Count > 0)
                    {
                        lblMSg.Visible = true;
                        foreach (DataRow item in dt.Rows)
                        {
                            lblMSg.Text = lbl.Text + item["SampQty"].ToString() + "  " + item["SampDetails"].ToString() + "<br/>";
                        }
                        lblMSg.ForeColor = System.Drawing.Color.Red;
                    }
                }
                break;

            case "CLOSE":
                Label lblT = (Label)e.Item.FindControl("lblType");
                lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblB = (Label)e.Item.FindControl("lblBuyerName");
                lblB.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblD = (Label)e.Item.FindControl("lblDateOfOrder");
                lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblS = (Label)e.Item.FindControl("lblStatus");
                lblS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                HyperLink hl = (HyperLink)e.Item.FindControl("hlPDF");
                hl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                (e.Item.FindControl("gvNewOrder") as GridView).Visible = false;
                break;

            case "CANCEL":
                Label lblT1 = (Label)e.Item.FindControl("lblType");
                lblT1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblB1 = (Label)e.Item.FindControl("lblBuyerName");
                lblB1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblD1 = (Label)e.Item.FindControl("lblDateOfOrder");
                lblD1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblS1 = (Label)e.Item.FindControl("lblStatus");
                lblS1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                HyperLink hl1 = (HyperLink)e.Item.FindControl("hlPDF");
                hl1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                (e.Item.FindControl("gvNewOrder") as GridView).Visible = false;
                break;
            }
            //if (Status == "NEW")
            //{
            //    Label lbl = (Label)e.Item.FindControl("lblStatus");
            //    lbl.ForeColor = System.Drawing.Color.Orange;
            //    Button btn = (Button)e.Item.FindControl("btnAssign");
            //    btn.Visible = true;
            //}
            //if (Status == "INPROCESS")
            //{
            //    Label lbl = (Label)e.Item.FindControl("lblStatus");
            //    lbl.ForeColor = System.Drawing.Color.DarkSalmon;
            //}
            //if (Status == "COLLECTING")
            //{
            //    Label lbl = (Label)e.Item.FindControl("lblStatus");
            //    lbl.ForeColor = System.Drawing.Color.BlueViolet;
            //}
            //if (Status == "BLENDING")
            //{
            //    Label lbl = (Label)e.Item.FindControl("lblStatus");
            //    lbl.ForeColor = System.Drawing.Color.DarkGreen;
            //}
            //if (Status == "PACKING")
            //{
            //    Label lbl = (Label)e.Item.FindControl("lblStatus");
            //    lbl.ForeColor = System.Drawing.Color.OrangeRed;
            //}
            //if (Status == "SAMPLE DISPATCH")
            //{
            //    Label lbl = (Label)e.Item.FindControl("lblMSg");
            //    string text = string.Empty;
            //    LinkButton lbtnO = (LinkButton)e.Item.FindControl("lbtnOrderID");
            //    Label lblcourier = (Label)e.Item.FindControl("lblCourier");
            //    dt1 = orderobj.GetAdminCommentDetails(lbtnO.Text);
            //    string Msg1 = dt1.Rows[0]["Comments"].ToString();
            //    if (Msg1.Contains("#"))
            //    {
            //        string[] po = Msg1.Split('#');
            //        lblcourier.Text = po[1].ToString();
            //        lbl.Visible = false;
            //        lblcourier.Visible = true;
            //        lblcourier.ForeColor = System.Drawing.Color.Red;
            //    }
            //    else
            //    {
            //        dt = orderobj.GetssampleQtyandMsgAdmin(lbtnO.Text);
            //        if (dt.Rows.Count > 0)
            //        {
            //            lbl.Visible = true;
            //            foreach (DataRow item in dt.Rows)
            //            {
            //                lbl.Text = lbl.Text + item["SampQty"].ToString() + "  " + item["SampDetails"].ToString() + "<br/>";
            //            }
            //            lbl.ForeColor = System.Drawing.Color.Red;
            //        }
            //    }
            //}
            if (Status.Contains("ETA"))
            {
                string Date         = string.Empty;
                Label  lblETAStatus = (Label)e.Item.FindControl("lblStatus");
                lblETAStatus.ForeColor = System.Drawing.Color.Brown;
                if (Status.Contains("ETA"))
                {
                    string[] po = Status.Split(new string[] { "ETA<br/>" }, StringSplitOptions.None);
                    Date = po[1].ToString();
                    DateTime d = Convert.ToDateTime(Date);
                    if (d.AddDays(10) < DateTime.Now)
                    {
                        LinkButton lbtnO = (LinkButton)e.Item.FindControl("lbtnOrderID");
                        orderobj.UpdateOrderStatus("CLOSE", lbtnO.Text);
                    }
                }
            }
            if (Status.Contains("SAMP RECV"))
            {
                Label lblStatus = (Label)e.Item.FindControl("lblStatus");
                lblStatus.ForeColor = System.Drawing.Color.BurlyWood;
            }
            //if (Status == "CLOSE")
            //{
            //    Label lblT = (Label)e.Item.FindControl("lblType");
            //    lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    Label lblB = (Label)e.Item.FindControl("lblBuyerName");
            //    lblB.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    Label lblD = (Label)e.Item.FindControl("lblDateOfOrder");
            //    lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    Label lblS = (Label)e.Item.FindControl("lblStatus");
            //    lblS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    HyperLink hl = (HyperLink)e.Item.FindControl("hlPDF");
            //    hl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    (e.Item.FindControl("gvNewOrder") as GridView).Visible = false;
            //    //LinkButton lbtnD = (LinkButton)e.Item.FindControl("lbtnOrderpdfDownload");
            //    //lbtnD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //}
            //if (Status == "CANCEL")
            //{
            //    Label lblT = (Label)e.Item.FindControl("lblType");
            //    lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    Label lblB = (Label)e.Item.FindControl("lblBuyerName");
            //    lblB.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    Label lblD = (Label)e.Item.FindControl("lblDateOfOrder");
            //    lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    Label lblS = (Label)e.Item.FindControl("lblStatus");
            //    lblS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    HyperLink hl = (HyperLink)e.Item.FindControl("hlPDF");
            //    hl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //    (e.Item.FindControl("gvNewOrder") as GridView).Visible = false;
            //    //LinkButton lbtnD = (LinkButton)e.Item.FindControl("lbtnOrderpdfDownload");
            //    //lbtnD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            //}
        }
    }
Ejemplo n.º 4
0
    protected void dlOrderList_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            var lblorderid = e.Item.FindControl("lblorderid") as Label;
            if (Convert.ToInt32(lblorderid.Text) < 100000)
            {
                e.Item.Visible = false;
            }
            BindSubGrid(e.Item);
            DataTable   dt     = new DataTable();
            DataTable   dt1    = new DataTable();
            DataRowView drv    = (DataRowView)(e.Item.DataItem);
            string      Status = drv.Row["OrderStatus"].ToString();
            if (Status == "NEW")
            {
                Label lbl = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl.ForeColor = System.Drawing.Color.Orange;
            }
            if (Status == "COLLECTING")
            {
                Label lbl = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl.ForeColor = System.Drawing.Color.BlueViolet;
            }
            if (Status == "BLENDING")
            {
                Label lbl = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl.ForeColor = System.Drawing.Color.DarkGreen;
            }
            if (Status == "PACKING")
            {
                Label lbl = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl.ForeColor = System.Drawing.Color.OrangeRed;
            }
            if (Status == "DISPATCH")
            {
                Label lbl1 = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblT = (Label)e.Item.FindControl("lblType");
                lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblD = (Label)e.Item.FindControl("lblBranchOrderDate");
                lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");

                Label lbl   = (Label)e.Item.FindControl("lblMSg");
                Label lbtnO = (Label)e.Item.FindControl("lbtnOrderID");
                dt1 = orderObj.GetInvandDispatchDetails(lbtnO.Text);
                if (dt1.Rows.Count > 0)
                {
                    lbl.Visible   = true;
                    lbl.Text      = " Inv :" + dt1.Rows[0]["BOinv"].ToString() + " / " + dt1.Rows[0]["DispatchDate"].ToString();
                    lbl.ForeColor = System.Drawing.Color.Red;
                }
                (e.Item.FindControl("gvOrder") as GridView).Visible = false;
            }
            if (Status == "CANCEL")
            {
                Label lbl1 = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl1.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblT = (Label)e.Item.FindControl("lblType");
                lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
                Label lblD = (Label)e.Item.FindControl("lblBranchOrderDate");
                lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            }
            if (Status == "SAMPLE DISPATCH")
            {
                Label lbl1 = (Label)e.Item.FindControl("lblBranchOrderStatus");
                lbl1.ForeColor = System.Drawing.Color.Gray;
                Label lblT = (Label)e.Item.FindControl("lblType");
                lblT.ForeColor = System.Drawing.Color.Gray;
                Label lblD = (Label)e.Item.FindControl("lblBranchOrderDate");
                lblD.ForeColor = System.Drawing.Color.Gray;
                Label  lbl        = (Label)e.Item.FindControl("lblMSg");
                string text       = string.Empty;
                Label  lbtnO      = (Label)e.Item.FindControl("lbtnOrderID");
                Label  lblcourier = (Label)e.Item.FindControl("lblCourier");
                dt1 = orderObj.GetAdminCommentDetails(lbtnO.Text);
                string Msg1 = dt1.Rows[0]["Comments"].ToString();
                if (dt1.Rows[0]["OrderType"].ToString() == "LotSample")
                {
                    if (Msg1.Contains("#"))
                    {
                        lbl.Visible = false;
                    }
                    else
                    {
                        dt = orderObj.GetssampleQtyandMsgAdmin(lbtnO.Text);
                        if (dt.Rows.Count > 0)
                        {
                            lbl.Visible = true;
                            foreach (DataRow item in dt.Rows)
                            {
                                lbl.Text = lbl.Text + item["SampQty"].ToString() + "  " + item["SampDetails"].ToString() + "<br/>";
                            }
                            lbl.ForeColor = System.Drawing.Color.Red;
                        }
                    }
                }
            }
        }
    }
 protected void dlOrderList_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         BindSubGrid(e.Item);
         DataTable   dt     = new DataTable();
         DataTable   dt1    = new DataTable();
         DataRowView drv    = (DataRowView)(e.Item.DataItem);
         string      Status = drv.Row["OrderStatus"].ToString();
         string      Otype  = drv.Row["OrderType"].ToString();
         if (Otype == "order")
         {
             Label lblT = (Label)e.Item.FindControl("lblType");
             lblT.ForeColor = System.Drawing.Color.Green;
         }
         if (Otype == "LotSample")
         {
             Label lblT = (Label)e.Item.FindControl("lblType");
             lblT.ForeColor = System.Drawing.Color.Orange;
         }
         if (Status == "NEW")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Orange;
         }
         if (Status == "INPROCESS")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.DarkSalmon;
         }
         if (Status == "COLLECTING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.BlueViolet;
         }
         if (Status == "BLENDING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.DarkGreen;
         }
         if (Status == "PACKING")
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.OrangeRed;
         }
         if (Status == "SAMPLE DISPATCH")
         {
             Label      lbl        = (Label)e.Item.FindControl("lblMSg");
             string     text       = string.Empty;
             LinkButton lbtnO      = (LinkButton)e.Item.FindControl("lbtnOrderID");
             Label      lblcourier = (Label)e.Item.FindControl("lblCourier");
             dt1 = orderobj.GetAdminCommentDetails(lbtnO.Text);
             string Msg1 = dt1.Rows[0]["Comments"].ToString();
             if (Msg1.Contains("#"))
             {
                 string[] po = Msg1.Split('#');
                 lblcourier.Text      = po[1].ToString();
                 lbl.Visible          = false;
                 lblcourier.Visible   = true;
                 lblcourier.ForeColor = System.Drawing.Color.Red;
             }
             else
             {
                 dt = orderobj.GetssampleQtyandMsgAdmin(lbtnO.Text);
                 if (dt.Rows.Count > 0)
                 {
                     lbl.Visible = true;
                     foreach (DataRow item in dt.Rows)
                     {
                         lbl.Text = lbl.Text + item["SampQty"].ToString() + "  " + item["SampDetails"].ToString() + "<br/>";
                     }
                     lbl.ForeColor = System.Drawing.Color.Red;
                 }
             }
         }
         if (Status.Contains("ETA"))
         {
             string Date = string.Empty;
             Label  lbl  = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.Brown;
             if (Status.Contains("ETA"))
             {
                 //string[] po = Status.Split(new string[] { "ETA<br/>" }, StringSplitOptions.None);
                 //Date = po[1].ToString();
                 //DateTime d = Convert.ToDateTime(Date);
                 //if (d.AddDays(10) < DateTime.Now)
                 //{
                 //    LinkButton lbtnO = (LinkButton)e.Item.FindControl("lbtnOrderID");
                 //    orderobj.UpdateOrderStatus("CLOSE", lbtnO.Text);
                 //}
             }
         }
         if (Status.Contains("SAMP RECV"))
         {
             Label lbl = (Label)e.Item.FindControl("lblStatus");
             lbl.ForeColor = System.Drawing.Color.BurlyWood;
         }
         if (Status == "CLOSE")
         {
             Label lblT = (Label)e.Item.FindControl("lblType");
             lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             Label lblB = (Label)e.Item.FindControl("lblBuyerName");
             lblB.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             Label lblD = (Label)e.Item.FindControl("lblDateOfOrder");
             lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             Label lblS = (Label)e.Item.FindControl("lblStatus");
             lblS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             HyperLink hl = (HyperLink)e.Item.FindControl("hlPDF");
             hl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             (e.Item.FindControl("gvNewOrder") as GridView).Visible = false;
             //LinkButton lbtnD = (LinkButton)e.Item.FindControl("lbtnOrderpdfDownload");
             //lbtnD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
         }
         if (Status == "CANCEL")
         {
             Label lblT = (Label)e.Item.FindControl("lblType");
             lblT.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             Label lblB = (Label)e.Item.FindControl("lblBuyerName");
             lblB.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             Label lblD = (Label)e.Item.FindControl("lblDateOfOrder");
             lblD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             Label lblS = (Label)e.Item.FindControl("lblStatus");
             lblS.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             HyperLink hl = (HyperLink)e.Item.FindControl("hlPDF");
             hl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
             (e.Item.FindControl("gvNewOrder") as GridView).Visible = false;
             //LinkButton lbtnD = (LinkButton)e.Item.FindControl("lbtnOrderpdfDownload");
             //lbtnD.ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
         }
     }
 }
    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;
        }
    }