コード例 #1
0
    private void BindPODetails()
    {
        DataTable dtPO = orderObj.OrderList(Convert.ToInt32(Encrypt_Decrypt.Decrypt(Session["sOrderID"].ToString().Trim(), true)));

        if (dtPO.Rows.Count > 0)
        {
            lblPO.Text     = dtPO.Rows[0]["PurchaseOrderID"].ToString();
            lblPODate.Text = string.Format("{0: dd MMM yyyy}", dtPO.Rows[0]["OrderDate"]);
            DataTable dtPOProductList = orderObj.OrderProductList(Convert.ToInt32(Encrypt_Decrypt.Decrypt(Session["sOrderID"].ToString().Trim(), true)));
            decimal   Total_Amount = 0, Total_Durm = 0;
            lblbranchorderID.Text = dtPO.Rows[0]["BranchOrderId"].ToString();

            if (dtPOProductList.Rows.Count > 0)
            {
                for (int count = 0; count < dtPOProductList.Rows.Count; count++)
                {
                    Total_Amount += Convert.ToDecimal(dtPOProductList.Rows[count]["TotalPrice"].ToString());
                    Total_Durm   += Convert.ToDecimal(dtPOProductList.Rows[count]["Packing25"].ToString()) + Convert.ToDecimal(dtPOProductList.Rows[count]["Packing180"].ToString());
                    if (Convert.ToInt32(dtPOProductList.Rows[count]["25dfrom"]) != 0)
                    {
                        dtPOProductList.Rows[count]["DrumF"] = dtPOProductList.Rows[count]["25dfrom"].ToString();
                        dtPOProductList.Rows[count]["DrumT"] = dtPOProductList.Rows[count]["25dto"].ToString();
                    }
                    if (Convert.ToInt32(dtPOProductList.Rows[count]["180dfrom"]) != 0)
                    {
                        dtPOProductList.Rows[count]["DrumF"] = dtPOProductList.Rows[count]["180dfrom"].ToString();
                        dtPOProductList.Rows[count]["DrumT"] = dtPOProductList.Rows[count]["180dto"].ToString();
                    }
                }
                lblTotalAmout.Text = string.Format("{0:n0}", Total_Amount);
                lblTotalDrum.Text  = Total_Durm.ToString();
                DataTable test = orderObj.Convert_NumberToWord(Total_Amount);
                lblAmount_word.Text        = test.Rows[0][0].ToString() + " Only";
                gvPurchaseOrder.DataSource = dtPOProductList;
                gvPurchaseOrder.DataBind();
            }
            lblPriceTerms.Text = dtPO.Rows[0]["FreightTerms"].ToString();
            lblTransport.Text  = dtPO.Rows[0]["Transport"].ToString();
            lblPayment.Text    = dtPO.Rows[0]["PaymentTerms"].ToString();
            if (dtPO.Rows[0]["FreightTerms"].ToString() == "FOB INDIA")
            {
                lblFreight.Text = "Collect";
            }
            else
            {
                lblFreight.Text = "Pre-Paid";
            }
            lblDCountry.Text = dtPO.Rows[0]["DestinationCountry"].ToString();
            lblDPort.Text    = dtPO.Rows[0]["DestinationPort"].ToString();
            lblLport.Text    = "";
        }
    }