Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
 protected void gvLCL_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     try
     {
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             DataRowView dv = e.Row.DataItem as DataRowView;
             if (dv.Row["ID"] == null)
             {
                 return;
             }
             string reportID = dv.Row["ID"].ToString();
             if (string.IsNullOrEmpty(reportID))
             {
                 return;
             }
             VoyageLCLInfo vInfo = new VoyageLCL().GetByID(reportID);
             Label lbTotal = (Label)e.Row.FindControl("lbTotal");
             lbTotal.Text = new VoyageLCL().GetRMBAmout(reportID);
         }
         if (e.Row.RowIndex >= 0)
         {
             Label lbTotal = (Label)e.Row.FindControl("lbTotal");
             double result = 0;
             bool isDouble = Double.TryParse(lbTotal.Text, out result);
             if (isDouble)
             {
                 sum += Convert.ToDouble(lbTotal.Text);
             }
         }
         else if (e.Row.RowType == DataControlRowType.Footer)
         {
             e.Row.Cells[8].Text = "总额相当于人民币:" + sum.ToString() + "元";
         }
     }
     catch (ArgumentException ae)
     {
         this.ShowMsg(ae.Message);
     }
     catch (Exception exc)
     {
         ShowMsg(exc.Message);
     }
 }
Exemplo n.º 3
0
        private void VoyageLoadInitial(VoyageInfo vInfo)
        {
            if (GetRequest("type") == "other")
            {
                divOther.Visible = true;
                divFCL.Visible = false;
                divLCL.Visible = false;
            }
            if (vInfo == null || string.IsNullOrEmpty(vInfo.ID))
            {
                return;
            }

            #region 其他收入
            if (GetRequest("type") == "other")
            {

                VoyageOtherInfo voInfo = new VoyageOther().GetByVoyageID(vInfo.ID);
                if (voInfo != null && string.IsNullOrEmpty(voInfo.ID) == false)
                {
                    tbOtherName.Text = voInfo.OtherName;
                    tbRemark.Text = voInfo.Remark;
                    tbOtherFee.Text = voInfo.Amount;
                    ddlCurrencyOther.SelectedValue = voInfo.CurrencyID;
                    tbOtherUser1.Text = voInfo.User1;
                    tbOtherUser2.Text = voInfo.User2;
                    tbOtherUser3.Text = voInfo.User3;
                    lbOtherRMB.Text = new ExchangeRate().GetRMB(voInfo.Amount, voInfo.CurrencyID, voInfo.CreateTime).ToString();
                }
                return;
            }
            #endregion

            IList<PortInfo> pList = new Port().GetList(vInfo.RouteID.ToString(), string.Empty);
            gvList.DataSource = pList;
            gvList.DataBind();
            ShipInfo sInfo = new Ship().GetByID(vInfo.ShipID.ToString());
            switch (sInfo.LoadTypeEnum)
            {
                case ShipType.LCL:
                    #region 散货
                    divLCL.Visible = true;
                    // 散货
                    VoyageLCLInfo vlInfo = new VoyageLCL().GetByVoyageID(vInfo.ID);
                    if (vlInfo != null && string.IsNullOrEmpty(vlInfo.ID) == false)
                    {
                        tbCustomer.Text = vlInfo.Customer;
                        tbTaxNo.Text = vlInfo.TaxNo;
                        tbLCLAmount.Text = vlInfo.LCLAmount;
                        tbLCLAmountReal.Text = vlInfo.LCLAmountReal;
                        tbLCLName.Text = vlInfo.LCLCatalog;
                        tbTransport.Text = vlInfo.LCLPrice;
                        ddlCurrency.SelectedValue = vlInfo.CurrencyID;
                        lbAmount.Text = vlInfo.Fee;

                        tbDelay.Text = vlInfo.DelayDay;
                        tbDelayFee.Text = vlInfo.DelayRate;
                        lbDelayAmount.Text = vlInfo.DelayAmount;
                        lbDelayRMB.Text = new ExchangeRate().GetRMB(vlInfo.DelayAmount, vlInfo.CurrencyID, vlInfo.CreateTime).ToString();

                        tbDispatch.Text = vlInfo.QuickDay;
                        tbDispatchFee.Text = vlInfo.QuickRate;
                        lbDispatchAmount.Text = vlInfo.DispatchAmount;
                        lbDispatchRMB.Text = new ExchangeRate().GetRMB(vlInfo.DispatchAmount, vlInfo.CurrencyID, vlInfo.CreateTime).ToString();

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

                        tbLCLUser1.Text = vlInfo.User1;
                        tbLCLUser2.Text = vlInfo.User2;
                        tbLCLUser3.Text = vlInfo.User3;
                    }
                    #endregion
                    break;
                case ShipType.FCL:
                    #region 集装箱
                    divFCL.Visible = true;
                    VoyageFCLInfo vfInfo = new VoyageFCL().GetByVoyageID(vInfo.ID);
                    if (vfInfo != null && string.IsNullOrEmpty(vfInfo.ID) == false)
                    {
                        tbCustomer.Text = vfInfo.Customer;
                        tbTaxNo.Text = vfInfo.TaxNo;
                        tbFCLFee.Text = vfInfo.Amount;
                        ddlCurrencyFCL.SelectedValue = vfInfo.CurrencyID;

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

                        tbFCLFee.Text = vfInfo.Fee;
                        tbBeginFee.Text = vfInfo.BeginFee;
                        tbEndFee.Text = vfInfo.EndFee;
                        tbOilFee.Text = vfInfo.OilFee;
                        tbTally.Text = vfInfo.Tally;
                        tbBox.Text = vfInfo.Box;
                        tbOther.Text = vfInfo.Other;
                        tbSubsidize.Text = vfInfo.Subsidize;
                        tbBookFee.Text = vfInfo.BookFee;
                        tbBranchOther.Text = vfInfo.BranchOther;

                        lbFCLTotal.Text = new VoyageFCL().GetAmout(vfInfo.ID);
                        lbFCLTotalRMB.Text = new VoyageFCL().GetRMBAmout(vfInfo.ID);
                        tbFCLRemark.Text = vfInfo.Remark;
                    }
                    #endregion
                    break;
                default:
                    break;
            }

        }
Exemplo n.º 4
0
 /// <summary>
 /// 绑定散货报表
 /// </summary>
 private void BindLCL(int pageIndex)
 {
     string shipID = MonthAndShipNavigate1.ShipID;
     string dateID = MonthAndShipNavigate1.DateID;
     DataSet ds = new VoyageLCL().GetList(dateID, shipID, pGridV.PageSize, pageIndex);
     gvLCL.DataSource = ds;
     gvLCL.DataBind();
     CustomDataSet cDS = ds as CustomDataSet;
     if (cDS == null)
     {
         pGridV.TotalAmout = 0;
         return;
     }
     pGridV.TotalAmout = cDS.TotalAmout;
 }