private void BindList() { string year = rblYear.SelectedValue; string month ="12"; if (year == "-1") { // 年份选择更多不进行任何操作 return; } string dimID = new DimTime().GetIDByMonth(year, month); DataSet ds = new InsuranceOfContainer().GetList(year); 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"); BindCurrency(); this.ID = GetRequest("ID"); InsuranceOfContainerInfo wInfo = new InsuranceOfContainerInfo(); if (string.IsNullOrEmpty(this.ID) == false) { wInfo = new InsuranceOfContainer().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; InsuranceOfContainerInfo wInfo = new InsuranceOfContainerInfo(); if (string.IsNullOrEmpty(id) == false) { wInfo = new InsuranceOfContainer().GetByID(id); } wInfo.InputUserID = this.UserCacheInfo.ID; string year = tbYear.Text; string dimTimeID = new DimTime().GetIDByMonth(year, "12"); wInfo.DimTimeID = dimTimeID; wInfo.CurrencyID = ddlCurrency.SelectedValue; wInfo.ExchangeRateID = this.RateID; wInfo.保险期限自 = DateTime.Parse(cBeginDate.Text); wInfo.保险期限到 = DateTime.Parse(cEndDate.Text); wInfo.柜号起始字母 = tb柜号起始字母.Text; wInfo.保费 = tb保费.Text; wInfo.集装箱数量20 = tb集装箱数量20.Text; wInfo.集装箱数量40 = tb集装箱数量40.Text; wInfo.单价20 = tb单价20.Text; wInfo.单价40 = tb单价40.Text; wInfo.保额 = tb保额.Text; wInfo.基本险保险费率 = tb基本险保险费率.Text; wInfo.备注 = tb备注.Text; if (string.IsNullOrEmpty(id) == true) { this.ID = new InsuranceOfContainer().Add(wInfo); ReportCatalog catalog = ReportCatalog.InsuranceOfContainer; BindList(this.ID, catalog); } else { new InsuranceOfContainer().Update(wInfo); } ShowMsg("报表保存成功。"); } catch (ArgumentNullException aex) { ShowMsg(aex.Message); } catch (Exception ex) { ShowMsg(ex.Message); Log(ex); } }