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 InsuranceOfCompensation().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");
             InsuranceOfCompensationInfo wInfo = new InsuranceOfCompensationInfo();
             if (string.IsNullOrEmpty(this.ID) == false)
             {
                 wInfo = new InsuranceOfCompensation().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
            {
                string id = this.ID;
                InsuranceOfCompensationInfo wInfo = new InsuranceOfCompensationInfo();
                if (string.IsNullOrEmpty(id) == false)
                {
                    wInfo = new InsuranceOfCompensation().GetByID(id);
                }

                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.ShipID = ddlShip.SelectedValue;
                wInfo.CurrencyID = ddlCurrency.SelectedValue;

                //船舶险
                wInfo.BeginDate = cBeginDate.Text;
                wInfo.EndDate = cEndDate.Text;
                wInfo.主险保额 = tb主险保额.Text;
                wInfo.船舶险保单号 = tb船舶险保单号.Text;
                wInfo.主险费率 = tb主险费率.Text;
                wInfo.主险保费 = tb主险保费.Text;
                wInfo.战争保赔险费率 = tb战争保赔险费率.Text;
                wInfo.战争保赔险保费 = tb战争保赔险保费.Text;
                wInfo.免赔额 = tb免赔额.Text;
                wInfo.船舶险总保费 = tb船舶险总保费.Text;

                //保赔险
                wInfo.保险期限自 = DateTime.Parse(c保险期限自.Text);
                wInfo.保险期限到 = DateTime.Parse(c保险期限到.Text);
                wInfo.保赔险保单号 = tb保赔险保单号.Text;
                wInfo.保赔险费率 = tb保赔险费率.Text;
                wInfo.保赔险保费 = tb保赔险保费.Text;
                wInfo.备注 = tb备注.Text;

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