public string GetAmout(RentShipReportInfo vInfo) { // 运费、滞期、速遣合计 decimal dPrice = Convert.ToDecimal(vInfo.Price); decimal dDays = Convert.ToDecimal(vInfo.RealDays); decimal dComun = Convert.ToDecimal(vInfo.CommunicateFee); decimal dLockFee = Convert.ToDecimal(vInfo.LockFee); decimal dOtherFee = Convert.ToDecimal(vInfo.OtherFee); decimal dTotal = dPrice * dDays + dComun + dLockFee + dOtherFee; return dTotal.ToString(); }
protected void btnSaveVoyage_Click(object sender, EventArgs e) { try { RentShipReportInfo rInfo = new RentShipReportInfo(); if (string.IsNullOrEmpty(this.RentShipReportID) == false) { rInfo = new RentShipReport().GetByID(this.RentShipReportID); } rInfo.User1 = tbUser1.Text; rInfo.User2 = tbUser2.Text; rInfo.User3 = tbUser3.Text; rInfo.ShipID = ddlShipName.SelectedValue; rInfo.RentTypeID = ddlRentType.SelectedValue; rInfo.Customer = tbCustomer.Text; rInfo.Customer = tbCustomer.Text; rInfo.TaxNo = tbTaxNo.Text; rInfo.BeginDate = Convert.ToDateTime(tbStartTime.Text); rInfo.EndDate = Convert.ToDateTime(tbEndTime.Text); rInfo.DiscountDays = tbDiscountDays.Text; rInfo.RealDays = tbRealDays.Text; rInfo.CurrencyID = ddlCurrency.SelectedValue; rInfo.Price = tbPrice.Text; rInfo.CommunicateFee = tbCommunicateFee.Text; rInfo.LockFee = tbLockFee.Text; rInfo.OtherFee = tbOtherFee.Text; rInfo.RentFee = tbRentFee.Text; rInfo.Remark = tbRemark.Text; if (string.IsNullOrEmpty(this.RentShipReportID)) { this.RentShipReportID = new RentShipReport().Add(rInfo); } else { new RentShipReport().Update(rInfo); } RentShipReportInitial(this.RentShipReportID); ShowMsg("保存成功。"); } catch (ArgumentNullException aex) { ShowMsg(aex.Message); } catch (Exception ex) { ShowMsg(ex.Message); Log(ex); } }
/// <summary> /// 更新费用类别 /// </summary> /// <param name="cInfo">实体</param> public void Update(RentShipReportInfo cInfo) { if (string.IsNullOrEmpty(cInfo.ID)) { throw new ArgumentNullException("参数ID不能为空。"); } //string msg = string.Empty; //int restInt = 0; //int equalInt = 0; //if (int.TryParse(cInfo.Rest, out restInt) && int.TryParse(cInfo.EqualTo, out equalInt)) //{ // if (restInt > equalInt) // { // throw new ArgumentException("特殊的柜数目必须小于或者等于标准柜数目。"); // } //} dal.Update(cInfo); }
/// <summary> /// 添加费用类别 /// </summary> /// <param name="ID">实体主键</param> /// <returns></returns> public void Delete(string ID) { RentShipReportInfo cInfo = new RentShipReportInfo(ID); dal.Delete(cInfo); }
/// <summary> /// 添加费用类别 /// </summary> /// <param name="cInfo">实体</param> /// <returns>新增实体的主键</returns> public string Add(RentShipReportInfo cInfo) { string msg = string.Empty; //int restInt = 0; //int equalInt = 0; //if (int.TryParse(cInfo.Rest, out restInt) && int.TryParse(cInfo.EqualTo, out equalInt)) //{ // if (restInt > equalInt) // { // throw new ArgumentException("特殊的柜数目必须小于或者等于标准柜数目。"); // } //} return dal.Add(cInfo); }