Esempio n. 1
0
    protected void query_Click(object sender, EventArgs e)
    {
        Label2.Text    = "";
        Label2.Visible = false;

        ProfitBudgetAdapter pba = new ProfitBudgetAdapter();

        T_ProfitBudget item = new T_ProfitBudget();

        sale_bill_no = this.txt_sale_bill_no.Text.Trim();

        //判断是否提交过
        DataSet ds = pba.getProfitBudgetSummaryByID(sale_bill_no);

        if (ds.Tables[0].Rows.Count > 0)
        {
            Label2.Text    = "该销售订单号已经提交过利润预算!";
            Label2.Visible = true;
            return;
        }

        item.SaleBillNo = sale_bill_no;
        ds = pba.getSEOrderInfo(item);
        if (ds.Tables[0].Rows.Count > 0)
        {
            finterid = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
            show(ds);
        }
    }
    protected void btn_query_Click(object sender, EventArgs e)
    {
        string queryStr         = this.txt_sale_bill_no.Text.Trim();
        ProfitBudgetAdapter pba = new ProfitBudgetAdapter();

        if (String.IsNullOrEmpty(queryStr))
        {
            show(GridView2, pba.getProfitBudgetSummary());
        }
        else
        {
            show(GridView2, pba.getProfitBudgetSummaryByID(queryStr));
        }
    }
    private void setData(string id)
    {
        if (string.IsNullOrEmpty(id))
        {
            return;
        }
        ProfitBudgetAdapter pba  = new ProfitBudgetAdapter();
        DataSet             head = pba.getProfitBudgetSummaryByID(id);

        lblt_sale_bill_no.Text = id;
        lbl_extra_charges.Text = Decimal.Parse(head.Tables[0].Rows[0]["extra_charges"].ToString()).ToString("f2");

        DataSet list = pba.getProfitBudgetList(id);

        gridviewBind(list);
    }