/// <summary>
 /// 根据报表ID获取20万元柜的总数
 /// </summary>
 /// <param name="id">报表ID</param>
 /// <returns></returns>
 protected int Get200kiloAmount(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return 0;
     }
     InsuranceOfFreightTransportInfo iInfo = new BLL.InsuranceOfFreightTransport().GetByID(id);
     return iInfo.ContainerList.Count;
 }
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string month = rblMoth.SelectedValue;
     if (year == "-1")
     {
         // 年份选择更多不进行任何操作
         return;
     }
     string dimID = new DimTime().GetIDByMonth(year, month);
     string shipID = rblShip.SelectedValue;
     DataSet ds = new BLL.InsuranceOfFreightTransport().GetList(year, month, shipID);
     rList.DataSource = ds;
     rList.DataBind();
     if (rList.Items.Count == 0)
     {
         trNull.Visible = true;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             TitleInitial("内贸线货运险投保货量及保费输入", "用户可以维护内贸线货运险投保货量及保费输入相关信息。");
             this.DimID = GetRequest("dimID");
             string shipID = string.Empty;
             BindShip(shipID);
             BindCurrency();
             this.ID = GetRequest("ID");
             InsuranceOfFreightTransportInfo wInfo = new InsuranceOfFreightTransportInfo();
             if (string.IsNullOrEmpty(this.ID) == false)
             {
                 wInfo = new BLL.InsuranceOfFreightTransport().GetByID(this.ID);
             }
             SetPageValue(wInfo);
             BindRate();
         }
     }
     catch (ArgumentNullException aex)
     {
         ShowMsg(aex.Message);
     }
     catch (Exception ex)
     {
         ShowMsg(ex.Message);
         Log(ex);
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                InsuranceOfFreightTransportInfo wInfo = new InsuranceOfFreightTransportInfo();
                if (string.IsNullOrEmpty(this.ID) == false)
                {
                    wInfo = new BLL.InsuranceOfFreightTransport().GetByID(this.ID);
                }

                wInfo.VoyageID = ddlVoyage.SelectedValue;
                wInfo.InputUserID = this.UserCacheInfo.ID;
                string year = tbYear.Text;
                string month = tbMonth.Text;
                string dimTimeID = new DimTime().GetIDByMonth(year, month);
                wInfo.DimTimeID = dimTimeID;
                wInfo.CurrencyID = ddlCurrency.SelectedValue;
                wInfo.ExchangeRateID = this.RateID;
                wInfo.Amount50kilo20feet = tb20英尺.Text;
                wInfo.Amount50kilo40feet = tb40英尺.Text;
                wInfo.备注 = tb备注.Text;

                tb总保费.Text = wInfo.总保费;
                lb总重柜量.Text = wInfo.总重柜量;

                if (string.IsNullOrEmpty(this.ID) == true)
                {
                    this.ID = new BLL.InsuranceOfFreightTransport().Add(wInfo);
                    wInfo.ID = this.ID;
                    SetPageValue(wInfo);
                }
                else
                {
                    new BLL.InsuranceOfFreightTransport().Update(wInfo);
                }
                ShowMsg("报表保存成功。");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }