public void StatisticData()
    {
        try
        {
            // Called SalesOrderStatistic function Codeunit Function.
            SalesOrderStatistics so             = new SalesOrderStatistics();
            NetworkCredential    NetCredentials = new NetworkCredential();
            NetCredentials.UserName = ConfigurationManager.AppSettings["UserName"];
            NetCredentials.Password = ConfigurationManager.AppSettings["Password"];

            Web_Order_Mail objser1 = new Web_Order_Mail();
            objser1.UseDefaultCredentials = true;
            objser1.Credentials           = NetCredentials;
            objser1.SalesOrderStatistics(Convert.ToString(Request.QueryString["SalesOrder"]));
            objser1 = null;

            // Filter with Sales Order No and Fetched Statistic Data
            SalesOrderStatistics_Service objso = new SalesOrderStatistics_Service();
            objso.UseDefaultCredentials = true;
            objso.Credentials           = NetCredentials;
            List <SalesOrderStatistics_Filter> filterArray = new List <SalesOrderStatistics_Filter>();
            SalesOrderStatistics_Filter        Filter      = new SalesOrderStatistics_Filter();
            Filter.Field    = SalesOrderStatistics_Fields.No;
            Filter.Criteria = Convert.ToString(Request.QueryString["SalesOrder"]);
            filterArray.Add(Filter);
            SalesOrderStatistics[] ListData = objso.ReadMultiple(filterArray.ToArray(), null, 1);

            if (ListData.Length > 0)
            {
                lbl_Amt_Excl_VAT.Text   = (ListData[0].TotalSalesLine1_Line_Amount).ToString("0.00");
                lbl_Total_Excl_VAT.Text = (ListData[0].TotalAmount11).ToString("0.00");
                lbl_Charges_Amt.Text    = (ListData[0].TotalSalesLine1_Charges_To_Customer).ToString("0.00");
                lbl_Tax_Amt.Text        = (ListData[0].TotalSalesLine1_Tax_Amount).ToString("0.00");
                lbl_Net_total.Text      = (ListData[0].TotalSalesLine1_Amount_To_Customer).ToString("0.00");
                lbl_Excise_Amt.Text     = (ListData[0].TotalSalesLine1_Excise_Amount).ToString("0.00");
            }
            objso = null;
            so    = null;
        }
        catch (Exception ex)
        {
            var message = new JavaScriptSerializer().Serialize(ex.Message.ToString());
            var script  = string.Format("alert({0});", message);
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true);
        }
    }
    protected void btn_delete_Command(object sender, CommandEventArgs e)
    {
        try
        {
            LinkButton   btn_Delete         = (LinkButton)sender;
            RepeaterItem item               = (RepeaterItem)btn_Delete.NamingContainer;
            HiddenField  ItemNo             = (HiddenField)item.FindControl("hf_ItemNo");
            HiddenField  LineNo             = (HiddenField)item.FindControl("hf_LineNo");
            HiddenField  hf_QuantityShipped = (HiddenField)item.FindControl("hf_QuantityShipped");

            if (Convert.ToDecimal(hf_QuantityShipped.Value) > 0)
            {
                var message2 = new JavaScriptSerializer().Serialize("Shipped product could not be deleted.");
                var script2  = string.Format("alert({0});", message2);
                ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script2, true);
                BindCartData();
            }
            else
            {
                NetworkCredential NetCredentialsOrder = new NetworkCredential();
                NetCredentialsOrder.UserName = ConfigurationManager.AppSettings["UserName"];
                NetCredentialsOrder.Password = ConfigurationManager.AppSettings["Password"];

                //delete For Sales Order Line
                Web_Order_Mail objserSalesOrder = new Web_Order_Mail();
                objserSalesOrder.UseDefaultCredentials = true;
                objserSalesOrder.Credentials           = NetCredentialsOrder;
                objserSalesOrder.DeleteSalesLine(Convert.ToInt16(ConfigurationManager.AppSettings["SalesOrderDocumentType"]), Convert.ToString(Request["OrderNo"]), Convert.ToInt32(LineNo.Value), ItemNo.Value, true);
                objserSalesOrder = null;

                //delete For Blanket Order Line
                Web_Order_Mail objserBlkOrder = new Web_Order_Mail();
                objserBlkOrder.UseDefaultCredentials = true;
                objserBlkOrder.Credentials           = NetCredentialsOrder;
                objserBlkOrder.DeleteSalesLine(Convert.ToInt16(ConfigurationManager.AppSettings["DocumentType"]), Convert.ToString(Request.QueryString["BlanketOrderNo"]), Convert.ToInt32(LineNo.Value), ItemNo.Value, true);
                objserBlkOrder = null;

                //list = Qtm.Lib.OrderModifiCustomerInfo.ListDeleteItemLine(Request["OrderNo"].ToString(), ItemNo.Value, LineNo.Value, Convert.ToString(Request.QueryString["BlanketOrderNo"]));

                SalesOrderStatistics so             = new SalesOrderStatistics();
                NetworkCredential    NetCredentials = new NetworkCredential();
                NetCredentials.UserName = ConfigurationManager.AppSettings["UserName"];
                NetCredentials.Password = ConfigurationManager.AppSettings["Password"];

                Web_Order_Mail objser1 = new Web_Order_Mail();
                objser1.UseDefaultCredentials = true;
                objser1.Credentials           = NetCredentials;
                objser1.SalesOrderStatistics(Convert.ToString(Request.QueryString["OrderNo"]));
                objser1 = null;

                if (list != null && list.Count > 0)
                {
                    rpt_FinalCart.DataSource = list;
                    rpt_FinalCart.DataBind();
                }
                else
                {
                    rpt_FinalCart.DataSource = null;
                    rpt_FinalCart.DataBind();
                    l_Error.Visible = true;
                }
                BindCartData();
            }
        }
        catch (Exception ex)
        {
            var message = new JavaScriptSerializer().Serialize(ex.Message.ToString());
            var script  = string.Format("alert({0});", message);
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", script, true);
        }
    }