Пример #1
0
    protected void ibtnConfirmEvaluation_Click(object sender, ImageClickEventArgs e)
    {
        long id = new long();

        id = Convert.ToInt64(Session["orderID"].ToString());
        // id = Convert.ToInt64("1100001");

        Guid buyer = new Guid(lblBuyerID.Text);
        long phone = new long();

        phone = Convert.ToInt64(lblPhoneID.Text);
        if (txtContent.Text != "")
        {
            EstimateInfoTableAdapter evaluate = new EstimateInfoTableAdapter();
            int EvaCount = evaluate.CreateEstimate(id, buyer, phone, txtContent.Text, DateTime.Now);
            if (EvaCount == 1)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('恭喜您!\\n\\n评价成功!');", true);
                // Response.Write("<script language=javascript>alert('恭喜您!\\n\\n评价成功!');</script>");
                txtContent.Text = "";
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('抱歉!\\n\\n评价失败,请重新评价!');", true);
                //Response.Write("<script language=javascript>alert('抱歉!\\n\\n评价失败,请重新评价!');</script>");
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('请填写评价内容!');", true);
            // Response.Write("<script language=javascript>alert('请填写评价内容!');</script>");
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            imgTubiao.Visible = false;
            lblShowMassage.Visible = false;

            BuyerDSTableAdapters.aspnet_UsersTableAdapter userDA = new BuyerDSTableAdapters.aspnet_UsersTableAdapter();
            DataTable userdDT = userDA.GetDataByUName(Session["name"].ToString());
            if (userdDT.Rows.Count != 0)
            {
                Session["buyerID"] = userdDT.Rows[0][1].ToString();
            }

          SqlConnection Conn = new SqlConnection(ConnSql);
            Conn.Open();
            string SelectSql = "select * from View1 where goodsbuyer = '" +System.Guid.Parse( Session["buyerID"].ToString()) + "' order by orderId desc";
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand(SelectSql, Conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            gvOrderInfo.DataSource = ds.Tables[0];
            gvOrderInfo.DataBind();
            int waitpay = 0, waitConfirm = 0;
            if (gvOrderInfo.Rows.Count > 0)
            {
                int i ;
                for (i = 0;i< gvOrderInfo.Rows.Count ; i++)
                {
                    CheckBox chbSelect = (CheckBox)gvOrderInfo.Rows[i].FindControl("chbSelect");
                    Label lblPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblPrice");
                    Label lblQuantity = (Label)gvOrderInfo.Rows[i].FindControl("lblQuantity");
                    Label lblTotalPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblTotalPrice");
                    int price = int.Parse(lblPrice.Text);
                    int quantity = int.Parse(lblQuantity.Text);
                    lblTotalPrice.Text = (price * quantity).ToString();
                    Label lblOrderID = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderID");
                    Label lblOrderState = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderState");
                    LinkButton lbtnPay = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnPay");
                    LinkButton lbtnCancel = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnCancel");
                    LinkButton lbtnConfirm = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnConfirm");
                    LinkButton lbtnAddEvaluation = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnAddEvaluation");
                    Label lblEvaluated = (Label)gvOrderInfo.Rows[i].FindControl("lblEvaluated");
                    LinkButton lbtnGoToEvaluate = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnGoToEvaluate");
                    //lbtnAddEvaluation
                    if (lblOrderState.Text == "待付款")
                    {
                        waitpay++;
                        lbtnConfirm.Enabled = false;
                        lbtnConfirm.Visible = false;
                        lbtnAddEvaluation.Enabled = false;
                        lbtnAddEvaluation.Visible = false;
                        lblEvaluated.Enabled = false;
                        lblEvaluated.Visible = false;
                        lbtnGoToEvaluate.Enabled = false;
                        lbtnGoToEvaluate.Visible = false;

                    }
                    else
                    {
                        if (lblOrderState.Text == "买家已付款")
                        {
                            waitConfirm++;
                            lbtnPay.Enabled = false;
                            lbtnPay.Visible = false;
                            chbSelect.Enabled = false;
                            lbtnAddEvaluation.Enabled = false;
                            lbtnAddEvaluation.Visible = false;
                            lblEvaluated.Enabled = false;
                            lblEvaluated.Visible = false;
                            lbtnGoToEvaluate.Enabled = false;
                            lbtnGoToEvaluate.Visible = false;
                            lbtnConfirm.Enabled = false;
                            lbtnConfirm.Visible = false;

                        }
                        else
                        {
                            if (lblOrderState.Text == "卖家已发货")
                            {
                                waitConfirm++;
                                lbtnPay.Enabled = false;
                                lbtnPay.Visible = false;
                                chbSelect.Enabled = false;
                                lbtnAddEvaluation.Enabled = false;
                                lbtnAddEvaluation.Visible = false;
                                lblEvaluated.Enabled = false;
                                lblEvaluated.Visible = false;
                                lbtnGoToEvaluate.Enabled = false;
                                lbtnGoToEvaluate.Visible = false;
                                lbtnCancel.Enabled = false;
                                lbtnCancel.Visible = false;
                            }
                            else
                            {
                                if (lblOrderState.Text == "交易成功")
                                {
                                    lbtnPay.Enabled = false;
                                    lbtnPay.Visible = false;
                                    lbtnCancel.Enabled = false;
                                    lbtnCancel.Visible = false;
                                    lbtnConfirm.Enabled = false;
                                    lbtnConfirm.Visible = false;
                                    chbSelect.Enabled = false;
                                    EstimateInfoTableAdapter estimateDA = new EstimateInfoTableAdapter();
                                    DataTable estimateDT = estimateDA.GetEvaluationByOrderId(long.Parse(lblOrderID.Text));
                                    if (estimateDT.Rows.Count > 0)
                                    {

                                        lbtnGoToEvaluate.Enabled = false;
                                        lbtnGoToEvaluate.Visible = false;
                                    }
                                    else
                                    {
                                        lblEvaluated.Enabled = false;
                                        lblEvaluated.Visible = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                    }

                                }
                                else
                                {
                                    if (lblOrderState.Text == "退款中的订单")
                                    {
                                        lbtnPay.Enabled = false;
                                        lbtnPay.Visible = false;
                                        lbtnCancel.Enabled = false;
                                        lbtnCancel.Visible = false;
                                        lbtnConfirm.Enabled = false;
                                        lbtnConfirm.Visible = false;
                                        chbSelect.Enabled = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                        lblEvaluated.Enabled = false;
                                        lblEvaluated.Visible = false;
                                        lbtnGoToEvaluate.Enabled = false;
                                        lbtnGoToEvaluate.Visible = false;
                                    }
                                    else
                                    {
                                        if (lblOrderState.Text == "交易关闭")
                                        {
                                            lbtnPay.Enabled = false;
                                            lbtnPay.Visible = false;
                                            lbtnCancel.Enabled = false;
                                            lbtnCancel.Visible = false;
                                            lbtnConfirm.Enabled = false;
                                            lbtnConfirm.Visible = false;
                                            chbSelect.Enabled = false;
                                            lbtnAddEvaluation.Enabled = false;
                                            lbtnAddEvaluation.Visible = false;
                                            lblEvaluated.Enabled = false;
                                            lblEvaluated.Visible = false;
                                            lbtnGoToEvaluate.Enabled = false;
                                            lbtnGoToEvaluate.Visible = false;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    //Session["orderID"] = lblOrderID.Text;
                }

            }
            else
            {
                imgTubiao.Visible = true;
                lblShowMassage.Visible = true;
                lblShowMassage.Text = "没有找到相关订单";
            }
            lbtnWaitPay.Text = "待付款(" + waitpay.ToString() + ")";
            lbtnWaitConfirm.Text = "待确认收货(" + waitConfirm.ToString() + ")";
            Conn.Close();
        }
        else
        {
            Response.Redirect("~/Public/Index.aspx");
        }
        if (!IsPostBack)
        {
            BindDatalist(0);
        }
    }
Пример #3
0
    public void gridviewBind()
    {
        string id = "";
        BuyerDSTableAdapters.aspnet_UsersTableAdapter userDA = new BuyerDSTableAdapters.aspnet_UsersTableAdapter();
        DataTable userdDT = userDA.GetDataByUName(Session["name"].ToString());
        if (userdDT.Rows.Count != 0)
        {
            id = userdDT.Rows[0][1].ToString();
        }
        SqlConnection Conn = new SqlConnection(ConnSql);
        Conn.Open();
        Guid guid = new Guid(id);
        string SelectSql = "select * from View1 where goodsbuyer = '" + guid + "' order by orderId desc";
           SqlDataAdapter da = new SqlDataAdapter();
           da.SelectCommand = new SqlCommand(SelectSql, Conn);
           DataSet ds = new DataSet();
        da.Fill(ds);
        gvOrderInfo.DataSource = ds.Tables[0];
        gvOrderInfo.DataBind();
        //int waitpay = 0, waitConfirm = 0;
        if (gvOrderInfo.Rows.Count > 0)
        {
            int i;
            for (i = 0; i < gvOrderInfo.Rows.Count; i++)
            {
                CheckBox chbSelect = (CheckBox)gvOrderInfo.Rows[i].FindControl("chbSelect");
                Label lblPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblPrice");
                Label lblQuantity = (Label)gvOrderInfo.Rows[i].FindControl("lblQuantity");
                Label lblTotalPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblTotalPrice");
                int price = int.Parse(lblPrice.Text);
                int quantity = int.Parse(lblQuantity.Text);
                lblTotalPrice.Text = (price * quantity).ToString();
                Label lblOrderID = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderID");
                Label lblOrderState = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderState");
                LinkButton lbtnPay = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnPay");
                LinkButton lbtnCancel = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnCancel");
                LinkButton lbtnConfirm = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnConfirm");
                LinkButton lbtnAddEvaluation = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnAddEvaluation");
                Label lblEvaluated = (Label)gvOrderInfo.Rows[i].FindControl("lblEvaluated");
                LinkButton lbtnGoToEvaluate = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnGoToEvaluate");
                if (lblOrderState.Text == "待付款")
                {

                    lbtnConfirm.Enabled = false;
                    lbtnConfirm.Visible = false;
                    lbtnAddEvaluation.Enabled = false;
                    lbtnAddEvaluation.Visible = false;
                    lblEvaluated.Enabled = false;
                    lblEvaluated.Visible = false;
                    lbtnGoToEvaluate.Enabled = false;
                    lbtnGoToEvaluate.Visible = false;

                }
                else
                {
                    if (lblOrderState.Text == "买家已付款")
                    {
                        lbtnConfirm.Enabled = false;
                        lbtnConfirm.Visible = false;
                        lbtnPay.Enabled = false;
                        lbtnPay.Visible = false;
                        chbSelect.Enabled = false;
                        lbtnAddEvaluation.Enabled = false;
                        lbtnAddEvaluation.Visible = false;
                        lblEvaluated.Enabled = false;
                        lblEvaluated.Visible = false;
                        lbtnGoToEvaluate.Enabled = false;
                        lbtnGoToEvaluate.Visible = false;
                    }
                    else
                    {
                        if (lblOrderState.Text == "卖家已发货")
                        {

                            lbtnPay.Enabled = false;
                            lbtnPay.Visible = false;
                            chbSelect.Enabled = false;
                            lbtnAddEvaluation.Enabled = false;
                            lbtnAddEvaluation.Visible = false;
                            lblEvaluated.Enabled = false;
                            lblEvaluated.Visible = false;
                            lbtnGoToEvaluate.Enabled = false;
                            lbtnGoToEvaluate.Visible = false;
                            lbtnCancel.Enabled = false;
                            lbtnCancel.Visible = false;
                        }
                        else
                        {
                            if (lblOrderState.Text == "交易成功")
                            {
                                lbtnPay.Enabled = false;
                                lbtnPay.Visible = false;
                                lbtnCancel.Enabled = false;
                                lbtnCancel.Visible = false;
                                lbtnConfirm.Enabled = false;
                                lbtnConfirm.Visible = false;
                                chbSelect.Enabled = false;
                                EstimateInfoTableAdapter estimateDA = new EstimateInfoTableAdapter();
                                DataTable estimateDT = estimateDA.GetEvaluationByOrderId(long.Parse(lblOrderID.Text));
                                if (estimateDT.Rows.Count > 0)
                                {

                                    lbtnGoToEvaluate.Enabled = false;
                                    lbtnGoToEvaluate.Visible = false;
                                }
                                else
                                {
                                    lblEvaluated.Enabled = false;
                                    lblEvaluated.Visible = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                }

                            }
                            else
                            {
                                if (lblOrderState.Text == "退款中的订单")
                                {
                                    lbtnPay.Enabled = false;
                                    lbtnPay.Visible = false;
                                    lbtnCancel.Enabled = false;
                                    lbtnCancel.Visible = false;
                                    lbtnConfirm.Enabled = false;
                                    lbtnConfirm.Visible = false;
                                    chbSelect.Enabled = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                    lblEvaluated.Enabled = false;
                                    lblEvaluated.Visible = false;
                                    lbtnGoToEvaluate.Enabled = false;
                                    lbtnGoToEvaluate.Visible = false;
                                }
                                else
                                {
                                    if (lblOrderState.Text == "交易关闭")
                                    {
                                        lbtnPay.Enabled = false;
                                        lbtnPay.Visible = false;
                                        lbtnCancel.Enabled = false;
                                        lbtnCancel.Visible = false;
                                        lbtnConfirm.Enabled = false;
                                        lbtnConfirm.Visible = false;
                                        chbSelect.Enabled = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                        lblEvaluated.Enabled = false;
                                        lblEvaluated.Visible = false;
                                        lbtnGoToEvaluate.Enabled = false;
                                        lbtnGoToEvaluate.Visible = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }

        }
        else
        {
            imgTubiao.Visible = true;
            lblShowMassage.Visible = true;
            lblShowMassage.Text = "没有找到相关订单";
        }
        Conn.Close();
    }
Пример #4
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        lblShowMassage.Visible = false;

        SqlConnection Conn = new SqlConnection(ConnSql);
        Conn.Open();
        string SelectSql = "select * from View1 where goodsbuyer = '" + System.Guid.Parse(Session["buyerID"].ToString()) + "' and phone_name like '%" + txtPhoneName.Text + "%' order by orderId desc";
        SqlDataAdapter da = new SqlDataAdapter();
        da.SelectCommand = new SqlCommand(SelectSql, Conn);
        DataSet ds = new DataSet();
        da.Fill(ds);
        gvOrderInfo.DataSource = ds.Tables[0];
        gvOrderInfo.DataBind();
        if (gvOrderInfo.Rows.Count > 0)
        {
            int i;
            for (i = 0; i < gvOrderInfo.Rows.Count; i++)
            {
                CheckBox chbSelect = (CheckBox)gvOrderInfo.Rows[i].FindControl("chbSelect");
                Label lblPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblPrice");
                Label lblQuantity = (Label)gvOrderInfo.Rows[i].FindControl("lblQuantity");
                Label lblTotalPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblTotalPrice");
                int price = int.Parse(lblPrice.Text);
                int quantity = int.Parse(lblQuantity.Text);
                lblTotalPrice.Text = (price * quantity).ToString();
                Label lblOrderID = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderID");
                Label lblOrderState = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderState");
                LinkButton lbtnPay = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnPay");
                LinkButton lbtnCancel = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnCancel");
                LinkButton lbtnConfirm = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnConfirm");
                LinkButton lbtnAddEvaluation = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnAddEvaluation");
                Label lblEvaluated = (Label)gvOrderInfo.Rows[i].FindControl("lblEvaluated");
                LinkButton lbtnGoToEvaluate = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnGoToEvaluate");
                //lbtnAddEvaluation
                if (lblOrderState.Text == "待付款")
                {

                    lbtnConfirm.Enabled = false;
                    lbtnConfirm.Visible = false;
                    lbtnAddEvaluation.Enabled = false;
                    lbtnAddEvaluation.Visible = false;
                    lblEvaluated.Enabled = false;
                    lblEvaluated.Visible = false;
                    lbtnGoToEvaluate.Enabled = false;
                    lbtnGoToEvaluate.Visible = false;

                }
                else
                {
                    if (lblOrderState.Text == "买家已付款")
                    {
                        lbtnConfirm.Enabled = false;
                        lbtnConfirm.Visible = false;
                        lbtnPay.Enabled = false;
                        lbtnPay.Visible = false;
                        chbSelect.Enabled = false;
                        lbtnAddEvaluation.Enabled = false;
                        lbtnAddEvaluation.Visible = false;
                        lblEvaluated.Enabled = false;
                        lblEvaluated.Visible = false;
                        lbtnGoToEvaluate.Enabled = false;
                        lbtnGoToEvaluate.Visible = false;
                        lbtnConfirm.Enabled = false;
                        lbtnConfirm.Visible = false;

                    }
                    else
                    {
                        if (lblOrderState.Text == "卖家已发货")
                        {

                            lbtnPay.Enabled = false;
                            lbtnPay.Visible = false;
                            chbSelect.Enabled = false;
                            lbtnAddEvaluation.Enabled = false;
                            lbtnAddEvaluation.Visible = false;
                            lblEvaluated.Enabled = false;
                            lblEvaluated.Visible = false;
                            lbtnGoToEvaluate.Enabled = false;
                            lbtnGoToEvaluate.Visible = false;
                            lbtnCancel.Enabled = false;
                            lbtnCancel.Visible = false;
                        }
                        else
                        {
                            if (lblOrderState.Text == "交易成功")
                            {
                                lbtnPay.Enabled = false;
                                lbtnPay.Visible = false;
                                lbtnCancel.Enabled = false;
                                lbtnCancel.Visible = false;
                                lbtnConfirm.Enabled = false;
                                lbtnConfirm.Visible = false;
                                chbSelect.Enabled = false;
                                EstimateInfoTableAdapter estimateDA = new EstimateInfoTableAdapter();
                                DataTable estimateDT = estimateDA.GetEvaluationByOrderId(long.Parse(lblOrderID.Text));
                                if (estimateDT.Rows.Count > 0)
                                {

                                    lbtnGoToEvaluate.Enabled = false;
                                    lbtnGoToEvaluate.Visible = false;
                                }
                                else
                                {
                                    lblEvaluated.Enabled = false;
                                    lblEvaluated.Visible = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                }

                            }
                            else
                            {
                                if (lblOrderState.Text == "退款中的订单")
                                {
                                    lbtnPay.Enabled = false;
                                    lbtnPay.Visible = false;
                                    lbtnCancel.Enabled = false;
                                    lbtnCancel.Visible = false;
                                    lbtnConfirm.Enabled = false;
                                    lbtnConfirm.Visible = false;
                                    chbSelect.Enabled = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                    lblEvaluated.Enabled = false;
                                    lblEvaluated.Visible = false;
                                    lbtnGoToEvaluate.Enabled = false;
                                    lbtnGoToEvaluate.Visible = false;
                                }
                                else
                                {
                                    if (lblOrderState.Text == "交易关闭")
                                    {
                                        lbtnPay.Enabled = false;
                                        lbtnPay.Visible = false;
                                        lbtnCancel.Enabled = false;
                                        lbtnCancel.Visible = false;
                                        lbtnConfirm.Enabled = false;
                                        lbtnConfirm.Visible = false;
                                        chbSelect.Enabled = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                        lblEvaluated.Enabled = false;
                                        lblEvaluated.Visible = false;
                                        lbtnGoToEvaluate.Enabled = false;
                                        lbtnGoToEvaluate.Visible = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }

        }

        else
        {
            imgTubiao.Visible = true;
            lblShowMassage.Visible = true;
            lblShowMassage.Text = "没有找到相关订单";
        }
    }
Пример #5
0
    public void gridviewBind()
    {
        string id = "";

        BuyerDSTableAdapters.aspnet_UsersTableAdapter userDA = new BuyerDSTableAdapters.aspnet_UsersTableAdapter();
        DataTable userdDT = userDA.GetDataByUName(Session["name"].ToString());

        if (userdDT.Rows.Count != 0)
        {
            id = userdDT.Rows[0][1].ToString();
        }
        SqlConnection Conn = new SqlConnection(ConnSql);

        Conn.Open();
        Guid           guid      = new Guid(id);
        string         SelectSql = "select * from View1 where goodsbuyer = '" + guid + "' order by orderId desc";
        SqlDataAdapter da        = new SqlDataAdapter();

        da.SelectCommand = new SqlCommand(SelectSql, Conn);
        DataSet ds = new DataSet();

        da.Fill(ds);
        gvOrderInfo.DataSource = ds.Tables[0];
        gvOrderInfo.DataBind();
        //int waitpay = 0, waitConfirm = 0;
        if (gvOrderInfo.Rows.Count > 0)
        {
            int i;
            for (i = 0; i < gvOrderInfo.Rows.Count; i++)
            {
                CheckBox chbSelect     = (CheckBox)gvOrderInfo.Rows[i].FindControl("chbSelect");
                Label    lblPrice      = (Label)gvOrderInfo.Rows[i].FindControl("lblPrice");
                Label    lblQuantity   = (Label)gvOrderInfo.Rows[i].FindControl("lblQuantity");
                Label    lblTotalPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblTotalPrice");
                int      price         = int.Parse(lblPrice.Text);
                int      quantity      = int.Parse(lblQuantity.Text);
                lblTotalPrice.Text = (price * quantity).ToString();
                Label      lblOrderID        = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderID");
                Label      lblOrderState     = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderState");
                LinkButton lbtnPay           = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnPay");
                LinkButton lbtnCancel        = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnCancel");
                LinkButton lbtnConfirm       = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnConfirm");
                LinkButton lbtnAddEvaluation = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnAddEvaluation");
                Label      lblEvaluated      = (Label)gvOrderInfo.Rows[i].FindControl("lblEvaluated");
                LinkButton lbtnGoToEvaluate  = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnGoToEvaluate");
                if (lblOrderState.Text == "待付款")
                {
                    lbtnConfirm.Enabled       = false;
                    lbtnConfirm.Visible       = false;
                    lbtnAddEvaluation.Enabled = false;
                    lbtnAddEvaluation.Visible = false;
                    lblEvaluated.Enabled      = false;
                    lblEvaluated.Visible      = false;
                    lbtnGoToEvaluate.Enabled  = false;
                    lbtnGoToEvaluate.Visible  = false;
                }
                else
                {
                    if (lblOrderState.Text == "买家已付款")
                    {
                        lbtnConfirm.Enabled       = false;
                        lbtnConfirm.Visible       = false;
                        lbtnPay.Enabled           = false;
                        lbtnPay.Visible           = false;
                        chbSelect.Enabled         = false;
                        lbtnAddEvaluation.Enabled = false;
                        lbtnAddEvaluation.Visible = false;
                        lblEvaluated.Enabled      = false;
                        lblEvaluated.Visible      = false;
                        lbtnGoToEvaluate.Enabled  = false;
                        lbtnGoToEvaluate.Visible  = false;
                    }
                    else
                    {
                        if (lblOrderState.Text == "卖家已发货")
                        {
                            lbtnPay.Enabled           = false;
                            lbtnPay.Visible           = false;
                            chbSelect.Enabled         = false;
                            lbtnAddEvaluation.Enabled = false;
                            lbtnAddEvaluation.Visible = false;
                            lblEvaluated.Enabled      = false;
                            lblEvaluated.Visible      = false;
                            lbtnGoToEvaluate.Enabled  = false;
                            lbtnGoToEvaluate.Visible  = false;
                            lbtnCancel.Enabled        = false;
                            lbtnCancel.Visible        = false;
                        }
                        else
                        {
                            if (lblOrderState.Text == "交易成功")
                            {
                                lbtnPay.Enabled     = false;
                                lbtnPay.Visible     = false;
                                lbtnCancel.Enabled  = false;
                                lbtnCancel.Visible  = false;
                                lbtnConfirm.Enabled = false;
                                lbtnConfirm.Visible = false;
                                chbSelect.Enabled   = false;
                                EstimateInfoTableAdapter estimateDA = new EstimateInfoTableAdapter();
                                DataTable estimateDT = estimateDA.GetEvaluationByOrderId(long.Parse(lblOrderID.Text));
                                if (estimateDT.Rows.Count > 0)
                                {
                                    lbtnGoToEvaluate.Enabled = false;
                                    lbtnGoToEvaluate.Visible = false;
                                }
                                else
                                {
                                    lblEvaluated.Enabled      = false;
                                    lblEvaluated.Visible      = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                }
                            }
                            else
                            {
                                if (lblOrderState.Text == "退款中的订单")
                                {
                                    lbtnPay.Enabled           = false;
                                    lbtnPay.Visible           = false;
                                    lbtnCancel.Enabled        = false;
                                    lbtnCancel.Visible        = false;
                                    lbtnConfirm.Enabled       = false;
                                    lbtnConfirm.Visible       = false;
                                    chbSelect.Enabled         = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                    lblEvaluated.Enabled      = false;
                                    lblEvaluated.Visible      = false;
                                    lbtnGoToEvaluate.Enabled  = false;
                                    lbtnGoToEvaluate.Visible  = false;
                                }
                                else
                                {
                                    if (lblOrderState.Text == "交易关闭")
                                    {
                                        lbtnPay.Enabled           = false;
                                        lbtnPay.Visible           = false;
                                        lbtnCancel.Enabled        = false;
                                        lbtnCancel.Visible        = false;
                                        lbtnConfirm.Enabled       = false;
                                        lbtnConfirm.Visible       = false;
                                        chbSelect.Enabled         = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                        lblEvaluated.Enabled      = false;
                                        lblEvaluated.Visible      = false;
                                        lbtnGoToEvaluate.Enabled  = false;
                                        lbtnGoToEvaluate.Visible  = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        else
        {
            imgTubiao.Visible      = true;
            lblShowMassage.Visible = true;
            lblShowMassage.Text    = "没有找到相关订单";
        }
        Conn.Close();
    }
Пример #6
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        lblShowMassage.Visible = false;

        SqlConnection Conn = new SqlConnection(ConnSql);

        Conn.Open();
        string         SelectSql = "select * from View1 where goodsbuyer = '" + System.Guid.Parse(Session["buyerID"].ToString()) + "' and phone_name like '%" + txtPhoneName.Text + "%' order by orderId desc";
        SqlDataAdapter da        = new SqlDataAdapter();

        da.SelectCommand = new SqlCommand(SelectSql, Conn);
        DataSet ds = new DataSet();

        da.Fill(ds);
        gvOrderInfo.DataSource = ds.Tables[0];
        gvOrderInfo.DataBind();
        if (gvOrderInfo.Rows.Count > 0)
        {
            int i;
            for (i = 0; i < gvOrderInfo.Rows.Count; i++)
            {
                CheckBox chbSelect     = (CheckBox)gvOrderInfo.Rows[i].FindControl("chbSelect");
                Label    lblPrice      = (Label)gvOrderInfo.Rows[i].FindControl("lblPrice");
                Label    lblQuantity   = (Label)gvOrderInfo.Rows[i].FindControl("lblQuantity");
                Label    lblTotalPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblTotalPrice");
                int      price         = int.Parse(lblPrice.Text);
                int      quantity      = int.Parse(lblQuantity.Text);
                lblTotalPrice.Text = (price * quantity).ToString();
                Label      lblOrderID        = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderID");
                Label      lblOrderState     = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderState");
                LinkButton lbtnPay           = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnPay");
                LinkButton lbtnCancel        = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnCancel");
                LinkButton lbtnConfirm       = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnConfirm");
                LinkButton lbtnAddEvaluation = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnAddEvaluation");
                Label      lblEvaluated      = (Label)gvOrderInfo.Rows[i].FindControl("lblEvaluated");
                LinkButton lbtnGoToEvaluate  = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnGoToEvaluate");
                //lbtnAddEvaluation
                if (lblOrderState.Text == "待付款")
                {
                    lbtnConfirm.Enabled       = false;
                    lbtnConfirm.Visible       = false;
                    lbtnAddEvaluation.Enabled = false;
                    lbtnAddEvaluation.Visible = false;
                    lblEvaluated.Enabled      = false;
                    lblEvaluated.Visible      = false;
                    lbtnGoToEvaluate.Enabled  = false;
                    lbtnGoToEvaluate.Visible  = false;
                }
                else
                {
                    if (lblOrderState.Text == "买家已付款")
                    {
                        lbtnConfirm.Enabled       = false;
                        lbtnConfirm.Visible       = false;
                        lbtnPay.Enabled           = false;
                        lbtnPay.Visible           = false;
                        chbSelect.Enabled         = false;
                        lbtnAddEvaluation.Enabled = false;
                        lbtnAddEvaluation.Visible = false;
                        lblEvaluated.Enabled      = false;
                        lblEvaluated.Visible      = false;
                        lbtnGoToEvaluate.Enabled  = false;
                        lbtnGoToEvaluate.Visible  = false;
                        lbtnConfirm.Enabled       = false;
                        lbtnConfirm.Visible       = false;
                    }
                    else
                    {
                        if (lblOrderState.Text == "卖家已发货")
                        {
                            lbtnPay.Enabled           = false;
                            lbtnPay.Visible           = false;
                            chbSelect.Enabled         = false;
                            lbtnAddEvaluation.Enabled = false;
                            lbtnAddEvaluation.Visible = false;
                            lblEvaluated.Enabled      = false;
                            lblEvaluated.Visible      = false;
                            lbtnGoToEvaluate.Enabled  = false;
                            lbtnGoToEvaluate.Visible  = false;
                            lbtnCancel.Enabled        = false;
                            lbtnCancel.Visible        = false;
                        }
                        else
                        {
                            if (lblOrderState.Text == "交易成功")
                            {
                                lbtnPay.Enabled     = false;
                                lbtnPay.Visible     = false;
                                lbtnCancel.Enabled  = false;
                                lbtnCancel.Visible  = false;
                                lbtnConfirm.Enabled = false;
                                lbtnConfirm.Visible = false;
                                chbSelect.Enabled   = false;
                                EstimateInfoTableAdapter estimateDA = new EstimateInfoTableAdapter();
                                DataTable estimateDT = estimateDA.GetEvaluationByOrderId(long.Parse(lblOrderID.Text));
                                if (estimateDT.Rows.Count > 0)
                                {
                                    lbtnGoToEvaluate.Enabled = false;
                                    lbtnGoToEvaluate.Visible = false;
                                }
                                else
                                {
                                    lblEvaluated.Enabled      = false;
                                    lblEvaluated.Visible      = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                }
                            }
                            else
                            {
                                if (lblOrderState.Text == "退款中的订单")
                                {
                                    lbtnPay.Enabled           = false;
                                    lbtnPay.Visible           = false;
                                    lbtnCancel.Enabled        = false;
                                    lbtnCancel.Visible        = false;
                                    lbtnConfirm.Enabled       = false;
                                    lbtnConfirm.Visible       = false;
                                    chbSelect.Enabled         = false;
                                    lbtnAddEvaluation.Enabled = false;
                                    lbtnAddEvaluation.Visible = false;
                                    lblEvaluated.Enabled      = false;
                                    lblEvaluated.Visible      = false;
                                    lbtnGoToEvaluate.Enabled  = false;
                                    lbtnGoToEvaluate.Visible  = false;
                                }
                                else
                                {
                                    if (lblOrderState.Text == "交易关闭")
                                    {
                                        lbtnPay.Enabled           = false;
                                        lbtnPay.Visible           = false;
                                        lbtnCancel.Enabled        = false;
                                        lbtnCancel.Visible        = false;
                                        lbtnConfirm.Enabled       = false;
                                        lbtnConfirm.Visible       = false;
                                        chbSelect.Enabled         = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                        lblEvaluated.Enabled      = false;
                                        lblEvaluated.Visible      = false;
                                        lbtnGoToEvaluate.Enabled  = false;
                                        lbtnGoToEvaluate.Visible  = false;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        else
        {
            imgTubiao.Visible      = true;
            lblShowMassage.Visible = true;
            lblShowMassage.Text    = "没有找到相关订单";
        }
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["name"] != null)
        {
            imgTubiao.Visible      = false;
            lblShowMassage.Visible = false;

            BuyerDSTableAdapters.aspnet_UsersTableAdapter userDA = new BuyerDSTableAdapters.aspnet_UsersTableAdapter();
            DataTable userdDT = userDA.GetDataByUName(Session["name"].ToString());
            if (userdDT.Rows.Count != 0)
            {
                Session["buyerID"] = userdDT.Rows[0][1].ToString();
            }

            SqlConnection Conn = new SqlConnection(ConnSql);
            Conn.Open();
            string         SelectSql = "select * from View1 where goodsbuyer = '" + System.Guid.Parse(Session["buyerID"].ToString()) + "' order by orderId desc";
            SqlDataAdapter da        = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand(SelectSql, Conn);
            DataSet ds = new DataSet();
            da.Fill(ds);
            gvOrderInfo.DataSource = ds.Tables[0];
            gvOrderInfo.DataBind();
            int waitpay = 0, waitConfirm = 0;
            if (gvOrderInfo.Rows.Count > 0)
            {
                int i;
                for (i = 0; i < gvOrderInfo.Rows.Count; i++)
                {
                    CheckBox chbSelect     = (CheckBox)gvOrderInfo.Rows[i].FindControl("chbSelect");
                    Label    lblPrice      = (Label)gvOrderInfo.Rows[i].FindControl("lblPrice");
                    Label    lblQuantity   = (Label)gvOrderInfo.Rows[i].FindControl("lblQuantity");
                    Label    lblTotalPrice = (Label)gvOrderInfo.Rows[i].FindControl("lblTotalPrice");
                    int      price         = int.Parse(lblPrice.Text);
                    int      quantity      = int.Parse(lblQuantity.Text);
                    lblTotalPrice.Text = (price * quantity).ToString();
                    Label      lblOrderID        = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderID");
                    Label      lblOrderState     = (Label)gvOrderInfo.Rows[i].FindControl("lblOrderState");
                    LinkButton lbtnPay           = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnPay");
                    LinkButton lbtnCancel        = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnCancel");
                    LinkButton lbtnConfirm       = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnConfirm");
                    LinkButton lbtnAddEvaluation = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnAddEvaluation");
                    Label      lblEvaluated      = (Label)gvOrderInfo.Rows[i].FindControl("lblEvaluated");
                    LinkButton lbtnGoToEvaluate  = (LinkButton)gvOrderInfo.Rows[i].FindControl("lbtnGoToEvaluate");
                    //lbtnAddEvaluation
                    if (lblOrderState.Text == "待付款")
                    {
                        waitpay++;
                        lbtnConfirm.Enabled       = false;
                        lbtnConfirm.Visible       = false;
                        lbtnAddEvaluation.Enabled = false;
                        lbtnAddEvaluation.Visible = false;
                        lblEvaluated.Enabled      = false;
                        lblEvaluated.Visible      = false;
                        lbtnGoToEvaluate.Enabled  = false;
                        lbtnGoToEvaluate.Visible  = false;
                    }
                    else
                    {
                        if (lblOrderState.Text == "买家已付款")
                        {
                            waitConfirm++;
                            lbtnPay.Enabled           = false;
                            lbtnPay.Visible           = false;
                            chbSelect.Enabled         = false;
                            lbtnAddEvaluation.Enabled = false;
                            lbtnAddEvaluation.Visible = false;
                            lblEvaluated.Enabled      = false;
                            lblEvaluated.Visible      = false;
                            lbtnGoToEvaluate.Enabled  = false;
                            lbtnGoToEvaluate.Visible  = false;
                            lbtnConfirm.Enabled       = false;
                            lbtnConfirm.Visible       = false;
                        }
                        else
                        {
                            if (lblOrderState.Text == "卖家已发货")
                            {
                                waitConfirm++;
                                lbtnPay.Enabled           = false;
                                lbtnPay.Visible           = false;
                                chbSelect.Enabled         = false;
                                lbtnAddEvaluation.Enabled = false;
                                lbtnAddEvaluation.Visible = false;
                                lblEvaluated.Enabled      = false;
                                lblEvaluated.Visible      = false;
                                lbtnGoToEvaluate.Enabled  = false;
                                lbtnGoToEvaluate.Visible  = false;
                                lbtnCancel.Enabled        = false;
                                lbtnCancel.Visible        = false;
                            }
                            else
                            {
                                if (lblOrderState.Text == "交易成功")
                                {
                                    lbtnPay.Enabled     = false;
                                    lbtnPay.Visible     = false;
                                    lbtnCancel.Enabled  = false;
                                    lbtnCancel.Visible  = false;
                                    lbtnConfirm.Enabled = false;
                                    lbtnConfirm.Visible = false;
                                    chbSelect.Enabled   = false;
                                    EstimateInfoTableAdapter estimateDA = new EstimateInfoTableAdapter();
                                    DataTable estimateDT = estimateDA.GetEvaluationByOrderId(long.Parse(lblOrderID.Text));
                                    if (estimateDT.Rows.Count > 0)
                                    {
                                        lbtnGoToEvaluate.Enabled = false;
                                        lbtnGoToEvaluate.Visible = false;
                                    }
                                    else
                                    {
                                        lblEvaluated.Enabled      = false;
                                        lblEvaluated.Visible      = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                    }
                                }
                                else
                                {
                                    if (lblOrderState.Text == "退款中的订单")
                                    {
                                        lbtnPay.Enabled           = false;
                                        lbtnPay.Visible           = false;
                                        lbtnCancel.Enabled        = false;
                                        lbtnCancel.Visible        = false;
                                        lbtnConfirm.Enabled       = false;
                                        lbtnConfirm.Visible       = false;
                                        chbSelect.Enabled         = false;
                                        lbtnAddEvaluation.Enabled = false;
                                        lbtnAddEvaluation.Visible = false;
                                        lblEvaluated.Enabled      = false;
                                        lblEvaluated.Visible      = false;
                                        lbtnGoToEvaluate.Enabled  = false;
                                        lbtnGoToEvaluate.Visible  = false;
                                    }
                                    else
                                    {
                                        if (lblOrderState.Text == "交易关闭")
                                        {
                                            lbtnPay.Enabled           = false;
                                            lbtnPay.Visible           = false;
                                            lbtnCancel.Enabled        = false;
                                            lbtnCancel.Visible        = false;
                                            lbtnConfirm.Enabled       = false;
                                            lbtnConfirm.Visible       = false;
                                            chbSelect.Enabled         = false;
                                            lbtnAddEvaluation.Enabled = false;
                                            lbtnAddEvaluation.Visible = false;
                                            lblEvaluated.Enabled      = false;
                                            lblEvaluated.Visible      = false;
                                            lbtnGoToEvaluate.Enabled  = false;
                                            lbtnGoToEvaluate.Visible  = false;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    //Session["orderID"] = lblOrderID.Text;
                }
            }
            else
            {
                imgTubiao.Visible      = true;
                lblShowMassage.Visible = true;
                lblShowMassage.Text    = "没有找到相关订单";
            }
            lbtnWaitPay.Text     = "待付款(" + waitpay.ToString() + ")";
            lbtnWaitConfirm.Text = "待确认收货(" + waitConfirm.ToString() + ")";
            Conn.Close();
        }
        else
        {
            Response.Redirect("~/Public/Index.aspx");
        }
        if (!IsPostBack)
        {
            BindDatalist(0);
        }
    }
Пример #8
0
    protected void ibtnConfirmEvaluation_Click(object sender, ImageClickEventArgs e)
    {
        long id = new long();
          id = Convert.ToInt64(Session["orderID"].ToString());
          // id = Convert.ToInt64("1100001");

        Guid buyer = new Guid(lblBuyerID.Text);
            long phone = new long();
            phone = Convert.ToInt64(lblPhoneID.Text);
            if (txtContent.Text != "")
            {
                EstimateInfoTableAdapter evaluate = new EstimateInfoTableAdapter();
                int EvaCount = evaluate.CreateEstimate(id, buyer, phone, txtContent.Text, DateTime.Now);
                if (EvaCount == 1)
                {
                   ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('恭喜您!\\n\\n评价成功!');", true);
                    // Response.Write("<script language=javascript>alert('恭喜您!\\n\\n评价成功!');</script>");
                   txtContent.Text = "";
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('抱歉!\\n\\n评价失败,请重新评价!');", true);
                    //Response.Write("<script language=javascript>alert('抱歉!\\n\\n评价失败,请重新评价!');</script>");
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('请填写评价内容!');", true);
               // Response.Write("<script language=javascript>alert('请填写评价内容!');</script>");
            }
    }