コード例 #1
0
ファイル: VoyageFCL.cs プロジェクト: shanfree/SharpReport
        /// <summary>
        /// 航次船舶租金,包干燃油,箱费用,增减港口费用,船舶延时作业费,港口装卸费,港口理货费
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public string GetAmout(VoyageFCLInfo vInfo)
        {
            string total = NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                NumericHandler.StringAdd(
                vInfo.Fee, vInfo.BeginFee),
                vInfo.EndFee),
                vInfo.OilFee),
                vInfo.Box),
                vInfo.Tally),
                vInfo.Subsidize),
                vInfo.BookFee),
                vInfo.BranchOther),
                vInfo.Other);
            decimal dTotal = decimal.Parse(total);

            return dTotal.ToString();
        }
コード例 #2
0
        /// <summary>
        /// 增改船舶装箱情况
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.VoyageId))
                {
                    ShowMsg("请先保存航次信息。");
                    return;
                }
                ShipInfo sInfo = new Ship().GetByID(ddlShipName.SelectedValue);
                switch (sInfo.LoadTypeEnum)
                {
                    case ShipType.LCL:
                        VoyageLCLInfo vlInfo = new VoyageLCL().GetByVoyageID(this.VoyageId);
                        if (vlInfo == null)
                        {
                            vlInfo = new VoyageLCLInfo();
                        }
                        vlInfo.VoyageID = this.VoyageId;
                        vlInfo.Customer = tbCustomer.Text;
                        vlInfo.TaxNo = tbTaxNo.Text;
                        vlInfo.User1 = tbLCLUser1.Text;
                        vlInfo.User2 = tbLCLUser2.Text;
                        vlInfo.User3 = tbLCLUser3.Text;

                        vlInfo.LCLAmount = tbLCLAmount.Text;
                        vlInfo.LCLAmountReal = tbLCLAmountReal.Text;
                        vlInfo.LCLCatalog = tbLCLName.Text;
                        vlInfo.LCLPrice = tbTransport.Text;
                        vlInfo.CurrencyID = ddlCurrency.SelectedValue;
                        vlInfo.DelayDay = tbDelay.Text;
                        vlInfo.DelayRate = tbDelayFee.Text;
                        vlInfo.QuickDay = tbDispatch.Text;
                        vlInfo.QuickRate = tbDispatchFee.Text;

                        lbTotal.Text = new VoyageLCL().GetAmout(vlInfo);
                        vlInfo.Amount = lbTotal.Text;
                        lbTotalRMB.Text = new VoyageLCL().GetRMBAmout(vlInfo);
                        lbLCLCName.Text = ddlCurrency.SelectedItem.Text;

                        if (string.IsNullOrEmpty(vlInfo.ID))
                        {
                            new VoyageLCL().Add(vlInfo);
                        }
                        else
                        {
                            new VoyageLCL().Update(vlInfo);
                        }
                        lbDelayAmount.Text = vlInfo.DelayAmount;
                        lbDelayRMB.Text = new ExchangeRate().GetRMB(vlInfo.DelayAmount, vlInfo.CurrencyID, vlInfo.CreateTime).ToString();
                        lbDispatchAmount.Text = vlInfo.DispatchAmount;
                        lbDispatchRMB.Text = new ExchangeRate().GetRMB(vlInfo.DispatchAmount, vlInfo.CurrencyID, vlInfo.CreateTime).ToString();
                        break;
                    case ShipType.FCL:
                        //集装箱
                        VoyageFCLInfo vfInfo = new VoyageFCL().GetByVoyageID(this.VoyageId);
                        if (vfInfo == null)
                        {
                            vfInfo = new VoyageFCLInfo();
                        }
                        vfInfo.VoyageID = this.VoyageId;
                        vfInfo.Customer = tbCustomer.Text;
                        vfInfo.TaxNo = tbTaxNo.Text;
                        vfInfo.Amount = tbFCLFee.Text;

                        vfInfo.User1 = tbFCLUser1.Text;
                        vfInfo.User2 = tbFCLUser2.Text;
                        vfInfo.User3 = tbFCLUser3.Text;

                        vfInfo.Fee = tbFCLFee.Text;
                        vfInfo.BeginFee = tbBeginFee.Text;
                        vfInfo.EndFee = tbEndFee.Text;
                        vfInfo.OilFee = tbOilFee.Text;
                        vfInfo.Tally = tbTally.Text;
                        vfInfo.Box = tbBox.Text;
                        vfInfo.Other = tbOther.Text;
                        vfInfo.Subsidize = tbSubsidize.Text;
                        vfInfo.BookFee = tbBookFee.Text;
                        vfInfo.BranchOther = tbBranchOther.Text;
                        lbFCLTotal.Text = new VoyageFCL().GetAmout(vfInfo);
                        vfInfo.Amount = lbFCLTotal.Text;
                        lbFCLTotalRMB.Text = new VoyageFCL().GetRMBAmout(vfInfo);
                        vfInfo.Remark = tbFCLRemark.Text;

                        if (string.IsNullOrEmpty(vfInfo.ID))
                        {
                            new VoyageFCL().Add(vfInfo);
                        }
                        else
                        {
                            new VoyageFCL().Update(vfInfo);
                        }
                        break;
                    default:
                        break;
                }

                ShowMsg("操作成功!");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
コード例 #3
0
ファイル: VoyageFCL.cs プロジェクト: shanfree/SharpReport
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="ID">实体主键</param>
 /// <returns></returns>
 public void Delete(string ID)
 {
     VoyageFCLInfo cInfo = new VoyageFCLInfo(ID);
     dal.Delete(cInfo);
 }
コード例 #4
0
ファイル: VoyageFCL.cs プロジェクト: shanfree/SharpReport
 /// <summary>
 /// 更新费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(VoyageFCLInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }
コード例 #5
0
ファイル: VoyageFCL.cs プロジェクト: shanfree/SharpReport
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(VoyageFCLInfo cInfo)
 {
     return dal.Add(cInfo);
 }
コード例 #6
0
ファイル: VoyageFCL.cs プロジェクト: shanfree/SharpReport
        /// <summary>
        /// 获取发票的等额人民币价值,汇率按照开票时间计算
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public string GetRMBAmout(VoyageFCLInfo vInfo)
        {
            // 运费、滞期、速遣合计
            string total = GetAmout(vInfo);
            decimal dTotal = decimal.Parse(total);

            if (vInfo.CurrencyID != "1" && vInfo.InputDate == null)
            {
                return "--";
            }
            decimal amount = new ExchangeRate().GetRMB(total, vInfo.CurrencyID, vInfo.CreateTime);
            return amount.ToString();
        }