protected void Btn_UpAll_Click(object sender, EventArgs e)
    {
        ExpressCarriageService      ecDal = new ExpressCarriageService();
        IList <ExpressCarriageInfo> list  = new List <ExpressCarriageInfo>();
        string nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);

        foreach (RepeaterItem item in Rpt_ExpressCarriage.Items)
        {
            TextBox             tb   = (TextBox)item.FindControl("Tb_Carri");
            Label               lb   = (Label)item.FindControl("Lbl_Id");
            Label               lbc  = (Label)item.FindControl("Lbl_Carri");
            ExpressCarriageInfo info = new ExpressCarriageInfo();
            info.ID       = new Guid(lb.Text);
            info.Carriage = decimal.Parse(lbc.Text);
            try
            {
                info.Carriage = decimal.Parse(tb.Text);
            }
            catch (Exception ex)
            {
            }
            list.Add(info);
        }

        foreach (ExpressCarriageInfo info in list)
        {
            ecDal.UpdateExpressCarriageInfo(info.ID, info.Carriage);
        }

        IList <ExpressCarriageInfo> ecList = ecDal.GetAllExpressCarriageInfo(nick);

        Rpt_ExpressCarriage.DataSource = ecList;
        Rpt_ExpressCarriage.DataBind();
    }
    protected void Btn_Ok_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(ddl_City.SelectedValue))
        {
            Page.RegisterStartupScript("error", "<script>alert('请选择城市');</script>");
            return;
        }

        ExpressCarriageService ecDal = new ExpressCarriageService();
        ExpressCarriageInfo    info  = new ExpressCarriageInfo();

        info.CityId     = new Guid(ddl_City.SelectedValue);
        info.ExpressId  = new Guid(ddl_Express.SelectedValue);
        info.ProvinceId = new Guid(ddl_Pr.SelectedValue);
        info.Goods      = int.Parse(Rbl_Huo.SelectedValue);

        info.Nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        try
        {
            info.Carriage = decimal.Parse(TB_Carriage.Text);
        }
        catch (Exception ex)
        {
        }

        ExpressCarriageInfo hadinfo = ecDal.GetExpressCarriageInfo(info.Nick, info.CityId, info.ExpressId, info.ProvinceId);

        if (hadinfo == null)
        {
            info.ID = Guid.NewGuid();
            ecDal.AddExpressCarriage(info);
        }
        else
        {
            ecDal.UpdateExpressCarriageInfo(hadinfo.ID, info.Carriage);
        }

        IList <ExpressCarriageInfo> ecList = ecDal.GetAllExpressCarriageInfo(info.Nick);

        Rpt_ExpressCarriage.DataSource = ecList;
        Rpt_ExpressCarriage.DataBind();
    }