Пример #1
0
    private void BindSelectedPackage()
    {
        if ((clsPackage)Session["Package"] != null)
        {
            if ((dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"] != null)
            {
                dtSelectedPackage = (dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"];
            }

            package = (clsPackage)Session["Package"];
            int index = dtSelectedPackage.Rows.Count;
            index++;

            dtSelectedPackageRow                = dtSelectedPackage.NewdtSelectedPackageRow();
            dtSelectedPackageRow["Index"]       = index;
            dtSelectedPackageRow["UID"]         = package.UID;
            dtSelectedPackageRow["PackageCode"] = package.PackageCode;
            dtSelectedPackageRow["PackageName"] = package.PackageName;
            dtSelectedPackageRow["UnitPrice"]   = package.UnitPrice;
            dtSelectedPackageRow["Qty"]         = package.Qty;

            dtSelectedPackage.AdddtSelectedPackageRow(dtSelectedPackageRow);
            gvSelectedPackage.DataSource = dtSelectedPackage;
            gvSelectedPackage.DataBind();

            CalculatePackage();

            Session["Package"] = dtSelectedPackage;
            Session["Package"] = null;
        }
        if ((dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"] != null)
        {
            dtSelectedPackage = (dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"];
        }
    }
    private void BindSelectedPackage()
    {
        if ((clsPackage)Session["Package"] != null)
        {
            if ((dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"] != null)
            {
                dtSelectedPackage = (dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"];
            }

            package = (clsPackage)Session["Package"];
            int index = dtSelectedPackage.Rows.Count;
            index++;

            dtSelectedPackageRow = dtSelectedPackage.NewdtSelectedPackageRow();
            dtSelectedPackageRow["Index"] = index;
            dtSelectedPackageRow["UID"] = package.UID;
            dtSelectedPackageRow["PackageCode"] = package.PackageCode;
            dtSelectedPackageRow["PackageName"] = package.PackageName;
            dtSelectedPackageRow["UnitPrice"] = package.UnitPrice;
            dtSelectedPackageRow["Qty"] = package.Qty;

            dtSelectedPackage.AdddtSelectedPackageRow(dtSelectedPackageRow);
            gvSelectedPackage.DataSource = dtSelectedPackage;
            gvSelectedPackage.DataBind();

            CalculatePackage();

            Session["Package"] = dtSelectedPackage;
            Session["Package"] = null;
        }
        if ((dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"] != null)
        {
            dtSelectedPackage = (dsPackage.dtSelectedPackageDataTable)Session["selectedPackage"];
        }
    }