Example #1
0
    protected void ddlSelectId_SelectedIndexChanged(object sender, EventArgs e)
    {
        int sum = 0;
        BuyerDSTableAdapters.View_ChartDetailTableAdapter chartDA = new BuyerDSTableAdapters.View_ChartDetailTableAdapter();
        DataTable chartDT = chartDA.GetDataByPid(System.Guid.Parse(Session["BuyerId"].ToString()), long.Parse(ddlSelectId.SelectedValue.ToString()), "是");
        if (chartDT.Rows.Count != 0)
        {
            dlOrder.DataSource = chartDT;
            dlOrder.DataBind();
            for (int i = 0; i < chartDT.Rows.Count; i++)
            {
                Label lblProperity = (Label)dlOrder.Items[i].FindControl("lblProperity");
                Label lblPrice = (Label)dlOrder.Items[i].FindControl("lblAllPrice");

                BuyerDSTableAdapters.DM_colorTableAdapter colorDA = new BuyerDSTableAdapters.DM_colorTableAdapter();
                DataTable colorDT = colorDA.GetDataByColorId(chartDT.Rows[i][14].ToString());

                BuyerDSTableAdapters.DM_osTableAdapter osDA = new BuyerDSTableAdapters.DM_osTableAdapter();
                DataTable osDT = osDA.GetDataByOsId(chartDT.Rows[i][16].ToString());

                BuyerDSTableAdapters.DM_CPUTableAdapter cpuDA = new BuyerDSTableAdapters.DM_CPUTableAdapter();
                DataTable cpuDT = cpuDA.GetDataByCpuId(chartDT.Rows[i][17].ToString());

                if (colorDT.Rows.Count != 0 && osDT.Rows.Count != 0 && colorDT.Rows.Count != 0)
                {
                    lblProperity.Text = "颜色:" + colorDT.Rows[0][1].ToString()
                                      + " OS:" + osDT.Rows[0][1].ToString()
                                      + " CPU:" + cpuDT.Rows[0][1].ToString();
                }
                sum = int.Parse(lblPrice.Text.Substring(1));

            }
        }
        lblTotal.Text = "¥" + sum.ToString();
    }
Example #2
0
    void Show()
    {
        int sum = 0;

        BuyerDSTableAdapters.View_ChartDetailTableAdapter chartDA = new BuyerDSTableAdapters.View_ChartDetailTableAdapter();
        DataTable chartDT = chartDA.GetDataByUid(System.Guid.Parse(Session["BuyerId"].ToString()), "是");

        if (chartDT.Rows.Count != 0)
        {
            dlOrder.DataSource = chartDT;
            dlOrder.DataBind();
            for (int i = 0; i < chartDT.Rows.Count; i++)
            {
                Label lblProperity = (Label)dlOrder.Items[i].FindControl("lblProperity");
                Label lblPrice     = (Label)dlOrder.Items[i].FindControl("lblAllPrice");

                BuyerDSTableAdapters.DM_colorTableAdapter colorDA = new BuyerDSTableAdapters.DM_colorTableAdapter();
                DataTable colorDT = colorDA.GetDataByColorId(chartDT.Rows[i][14].ToString());

                BuyerDSTableAdapters.DM_osTableAdapter osDA = new BuyerDSTableAdapters.DM_osTableAdapter();
                DataTable osDT = osDA.GetDataByOsId(chartDT.Rows[i][16].ToString());

                BuyerDSTableAdapters.DM_CPUTableAdapter cpuDA = new BuyerDSTableAdapters.DM_CPUTableAdapter();
                DataTable cpuDT = cpuDA.GetDataByCpuId(chartDT.Rows[i][17].ToString());

                if (colorDT.Rows.Count != 0 && osDT.Rows.Count != 0 && colorDT.Rows.Count != 0)
                {
                    lblProperity.Text = "颜色:" + colorDT.Rows[0][1].ToString()
                                        + " OS:" + osDT.Rows[0][1].ToString()
                                        + " CPU:" + cpuDT.Rows[0][1].ToString();
                }
                int total = int.Parse(lblPrice.Text.Substring(1));
                sum = sum + total;
            }
        }
        lblTotal.Text = "¥" + sum.ToString();
    }
Example #3
0
    protected void ddlSelectId_SelectedIndexChanged(object sender, EventArgs e)
    {
        int sum = 0;

        BuyerDSTableAdapters.View_ChartDetailTableAdapter chartDA = new BuyerDSTableAdapters.View_ChartDetailTableAdapter();
        DataTable chartDT = chartDA.GetDataByPid(System.Guid.Parse(Session["BuyerId"].ToString()), long.Parse(ddlSelectId.SelectedValue.ToString()), "是");

        if (chartDT.Rows.Count != 0)
        {
            dlOrder.DataSource = chartDT;
            dlOrder.DataBind();
            for (int i = 0; i < chartDT.Rows.Count; i++)
            {
                Label lblProperity = (Label)dlOrder.Items[i].FindControl("lblProperity");
                Label lblPrice     = (Label)dlOrder.Items[i].FindControl("lblAllPrice");

                BuyerDSTableAdapters.DM_colorTableAdapter colorDA = new BuyerDSTableAdapters.DM_colorTableAdapter();
                DataTable colorDT = colorDA.GetDataByColorId(chartDT.Rows[i][14].ToString());

                BuyerDSTableAdapters.DM_osTableAdapter osDA = new BuyerDSTableAdapters.DM_osTableAdapter();
                DataTable osDT = osDA.GetDataByOsId(chartDT.Rows[i][16].ToString());

                BuyerDSTableAdapters.DM_CPUTableAdapter cpuDA = new BuyerDSTableAdapters.DM_CPUTableAdapter();
                DataTable cpuDT = cpuDA.GetDataByCpuId(chartDT.Rows[i][17].ToString());

                if (colorDT.Rows.Count != 0 && osDT.Rows.Count != 0 && colorDT.Rows.Count != 0)
                {
                    lblProperity.Text = "颜色:" + colorDT.Rows[0][1].ToString()
                                        + " OS:" + osDT.Rows[0][1].ToString()
                                        + " CPU:" + cpuDT.Rows[0][1].ToString();
                }
                sum = int.Parse(lblPrice.Text.Substring(1));
            }
        }
        lblTotal.Text = "¥" + sum.ToString();
    }
Example #4
0
    void Show()
    {
        int sum = 0;
        BuyerDSTableAdapters.View_ChartDetailTableAdapter chartDA = new BuyerDSTableAdapters.View_ChartDetailTableAdapter();
        DataTable chartDT = chartDA.GetDataByUid(System.Guid.Parse(Session["BuyerId"].ToString()), "是");
        if (chartDT.Rows.Count != 0)
        {
            dlOrder.DataSource = chartDT;
            dlOrder.DataBind();
            for (int i = 0; i < chartDT.Rows.Count; i++)
            {
                Label lblProperity = (Label)dlOrder.Items[i].FindControl("lblProperity");
                Label lblPrice = (Label)dlOrder.Items[i].FindControl("lblAllPrice");

                BuyerDSTableAdapters.DM_colorTableAdapter colorDA = new BuyerDSTableAdapters.DM_colorTableAdapter();
                DataTable colorDT = colorDA.GetDataByColorId(chartDT.Rows[i][14].ToString());

                BuyerDSTableAdapters.DM_osTableAdapter osDA = new BuyerDSTableAdapters.DM_osTableAdapter();
                DataTable osDT = osDA.GetDataByOsId(chartDT.Rows[i][16].ToString());

                BuyerDSTableAdapters.DM_CPUTableAdapter cpuDA = new BuyerDSTableAdapters.DM_CPUTableAdapter();
                DataTable cpuDT = cpuDA.GetDataByCpuId(chartDT.Rows[i][17].ToString());

                if (colorDT.Rows.Count != 0 && osDT.Rows.Count != 0 && colorDT.Rows.Count != 0)
                {
                    lblProperity.Text = "颜色:" + colorDT.Rows[0][1].ToString()
                                      + " OS:" + osDT.Rows[0][1].ToString()
                                      + " CPU:" + cpuDT.Rows[0][1].ToString();
                }
                int total = int.Parse(lblPrice.Text.Substring(1));
                sum = sum + total;
            }
        }
        lblTotal.Text = "¥" + sum.ToString();
    }