/// <summary> /// 更新费用类别 /// </summary> /// <param name="cInfo">实体</param> public void Update(InsuranceOfCompensationInfo cInfo) { if (string.IsNullOrEmpty(cInfo.ID)) { throw new ArgumentNullException("参数ID不能为空。"); } dal.Update(cInfo); }
/// <summary> /// 添加费用类别 /// </summary> /// <param name="cInfo">实体</param> /// <returns>新增实体的主键</returns> public string Add(InsuranceOfCompensationInfo cInfo) { return dal.Add(cInfo); }
/// <summary> /// 添加费用类别 /// </summary> /// <param name="ID">实体主键</param> /// <returns></returns> public void Delete(string ID) { InsuranceOfCompensationInfo cInfo = new InsuranceOfCompensationInfo(ID); dal.Delete(cInfo); }
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); } }
/// <summary> /// 根据页面实体设置页面值 /// </summary> /// <param name="wInfo"></param> private void SetPageValue(InsuranceOfCompensationInfo wInfo) { tbUserName.Text = this.UserCacheInfo.Name; tbCreateTime.Text = wInfo.CreateTime.ToShortDateString(); tbYear.Text = wInfo.CreateTime.Year.ToString(); tbMonth.Text = wInfo.CreateTime.Month.ToString(); if (string.IsNullOrEmpty(wInfo.ID)) { return; } DimTimeInfo dInfo = new DimTime().GetDimTimeInfo(wInfo.DimTimeID); tbMonth.Text = dInfo.MonthNumOfYear.ToString(); tbYear.Text = dInfo.Year.ToString(); ddlShip.SelectedValue = wInfo.ShipID.ToString(); ddlCurrency.SelectedValue = wInfo.CurrencyID; ddlYear.SelectedValue = dInfo.Year.ToString(); ddlMonth.SelectedValue = dInfo.MonthNumOfYear.ToString(); //船舶险 cBeginDate.Text = wInfo.BeginDate; cEndDate.Text = wInfo.EndDate; tb主险保额.Text = wInfo.主险保额; tb船舶险保单号.Text = wInfo.船舶险保单号; tb主险费率.Text = wInfo.主险费率; tb主险保费.Text = wInfo.主险保费; tb战争保赔险费率.Text = wInfo.战争保赔险费率; tb战争保赔险保费.Text = wInfo.战争保赔险保费; tb免赔额.Text = wInfo.免赔额; tb船舶险总保费.Text = wInfo.船舶险总保费; BindList(this.ID, ReportCatalog.InsuranceOfShip); //保赔险 c保险期限自.Text = wInfo.保险期限自.ToString("yyyy-MM-dd"); c保险期限到.Text = wInfo.保险期限到.ToString("yyyy-MM-dd"); tb保赔险保单号.Text = wInfo.保赔险保单号; tb保赔险费率.Text = wInfo.保赔险费率; tb保赔险保费.Text = wInfo.保赔险保费; BindList(this.ID, ReportCatalog.InsuranceOfCompensation); tb备注.Text = wInfo.备注; }