ASP.NET物流配送管理系统(13)

来源:xiaoniu168.com 作者:本站原创 添加时间:2011-11-17 点击数:32747

计算机毕业设计货物托运单维护介绍:

5.9 货物托运单维护(HuoWuEdit)
在货物托运单列表页面点击新单按钮,进入货物托运单维护页面,在该页面中,先点击货物明细按钮,维护托送货物分单信息,然后选择路程费用,系统自动计算应收金额。如图所示:
计算机毕业论文

以下是引用片段:

其主要代码实现如下:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedValue != "" && TextBox2.Text.Trim() != "")
        {
            //计算总重量和相关费用
            DataTable tmprs = new DataTable();
            tmprs = DataBase.Get_Table("select * from 配送路程费用,路程收费 where 配送路程费用.路程编号=路程收费.路程编号 and 配送路程费用.路程费用编号=" + DropDownList1.SelectedValue + "");
            if (tmprs.Rows.Count > 0)
            {
                decimal monryzl = 0;
                DataTable tmprs1 = new DataTable();
                tmprs1 = DataBase.Get_Table("select * from 重量收费 where 重量下限<=" + TextBox2.Text + " and 重量上限>=" + TextBox2.Text + "");
                if (tmprs1.Rows.Count > 0)
                {
                    monryzl = Convert.ToDecimal(tmprs1.Rows[0]["收费金额"].ToString());
                }
                this.TextBox1.Text = Convert.ToString((Convert.ToDecimal(tmprs.Rows[0]["收费金额"].ToString()) + monryzl));
                this.TextBox3.Text = this.TextBox1.Text;
            }
        }
    }
protected void Button2_Click(object sender, EventArgs e)
    {
        //保存单据信息
        Guid bookID = Guid.NewGuid();
        DataTable tmprs = new DataTable();
        tmprs = DataBase.Get_Table("select * from 托送货物临时单 where 帐号='" + Session["khid"].ToString() + "'");
        //循环保存分单
        if (tmprs.Rows.Count > 0)
        {
            for (int i = 0; i < tmprs.Rows.Count; i++)
            {
                DataBase.ExecSql("insert into 托送货物分单(货物托送编号,货物名称,货物规格,货物重量,类别编号,货物数量) values('" + bookID + "','" + tmprs.Rows[i]["货物名称"] + "','" + tmprs.Rows[i]["货物规格"] + "'," + tmprs.Rows[i]["货物重量"] + "," + tmprs.Rows[i]["类别编号"] + "," + tmprs.Rows[i]["货物数量"] + ")");
            }
        }
        //保存货物托运单
        DataBase.ExecSql("insert into 货物托送单(货物托送编号,帐号,托送时间,总重量,应收金额,实际收费,路程费用编号,接收标志,托运标志,托运标志原因) values('" + bookID + "','" + Session["khid"].ToString() + "','" + txtXm.Text + "'," + TextBox2.Text + "," + TextBox1.Text + "," + TextBox3.Text + "," + DropDownList1.SelectedValue + ",'未接收','提交托运','')");
        DataBase.ExecSql("delete from 托送货物临时单 where 帐号='" + Session["khid"].ToString() + "'");
        Response.
    }

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第14页为计算机毕业论文参考文献......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网