protected void btnSave_Click(object sender, EventArgs e) { try { string id = this.ReportID; JianyanInputInfo wInfo = new JianyanInputInfo(); if (string.IsNullOrEmpty(id) == false) { wInfo = new JianyanInput().GetByID(id); } wInfo.UsageType = rblUsage.SelectedValue; string reportTypeID = rblReportType.SelectedValue; if (string.IsNullOrEmpty(reportTypeID)) { ShowMsg("请选择报表类型。"); return; } wInfo.ReportTypeID = rblReportType.SelectedValue; wInfo.InputUserID = this.UserCacheInfo.ID; wInfo.CurrencyID = ddlCurrency.SelectedValue; wInfo.ExchangeRateID = this.RateID; wInfo.总数 = tb总数.Text; string year = ddlReportYear.SelectedValue; string month = ddlReportMonth.SelectedValue; string dimTimeID = new DimTime().GetIDByMonth(year, month); wInfo.DimTimeID = dimTimeID; wInfo.ShipID = ddlShip.SelectedValue; if (string.IsNullOrEmpty(id) == true) { this.ReportID = new JianyanInput().Add(wInfo); } else { new JianyanInput().Update(wInfo); } tb总数.Text = wInfo.总数; ShowMsg("检验报表保存成功。"); } catch (ArgumentNullException aex) { ShowMsg(aex.Message); } catch (Exception ex) { ShowMsg(ex.Message); Log(ex); } }
/// <summary> /// 更新费用类别 /// </summary> /// <param name="cInfo">实体</param> public void Update(JianyanInputInfo cInfo) { if (string.IsNullOrEmpty(cInfo.ID)) { throw new ArgumentNullException("参数ID不能为空。"); } dal.Update(cInfo); }
/// <summary> /// 添加费用类别 /// </summary> /// <param name="ID">实体主键</param> /// <returns></returns> public void Delete(string ID) { JianyanInputInfo cInfo = new JianyanInputInfo(ID); dal.Delete(cInfo); }
/// <summary> /// 添加费用类别 /// </summary> /// <param name="cInfo">实体</param> /// <returns>新增实体的主键</returns> public string Add(JianyanInputInfo cInfo) { return dal.Add(cInfo); }