private void BindDDL()
        {
            try
            {
                IList<RouteInfo> dRouteList = new Route().GetList();
                ddlRouteName.DataSource = dRouteList;
                ddlRouteName.DataBind();

                IList<ShipInfo> dShipList = new Ship().GetList();
                ddlShipName.DataSource = dShipList;
                ddlShipName.DataBind();
                ddlShipName.Items.Insert(0, new ListItem("全部", ""));

                //tbStartTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
                //tbEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");

            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 绑定船舶报表
        /// </summary>
        private void BindShip(int pageIndex)
        {
            IList<ShipInfo> list = new Ship().GetList();
            gvShipList.DataSource = list;
            gvShipList.DataBind();
            if (list == null)
            {
                pGridV.TotalAmout = 0;
                return;
            }
            pGridV.TotalAmout = list.Count;

        }
        private void VoyageLoadInitial(VoyageInfo vInfo)
        {
            ShipInfo sInfo = new Ship().GetByID(vInfo.ShipID.ToString());
            switch (sInfo.LoadTypeEnum)
            {
                case ShipType.FCL:
                    #region 集装箱
                    divFCL.Visible = true;
                    VoyageLoadInfo vfInfo = new VoyageLoad().GetByVoyageID(this.VoyageId);
                    if (vfInfo != null && string.IsNullOrEmpty(vfInfo.ID) == false)
                    {
                        tbTEUEmpty.Text = vfInfo.TEUEmpty;
                        tbTEUHeavy.Text = vfInfo.TEUHeavy;
                        tbTEUFROST.Text = vfInfo.TEUFrost;

                        tbFEUEmpty.Text = vfInfo.FEUEmpty;
                        tbFEUHeavy.Text = vfInfo.FEUHeavy;
                        tbFEUFROST.Text = vfInfo.FEUFrost;
                        tbFEUDANG.Text = vfInfo.FEUDanger;

                        tbFFEUEmpty.Text = vfInfo.FFEUEmpty;
                        tbFFEUHeavy.Text = vfInfo.FFEUHeavy;
                        tbFFEUFROST.Text = vfInfo.FFEUFrost;
                        tbFFEUDANG.Text = vfInfo.FFEUDanger;

                        tbRest.Text = vfInfo.Rest;
                        tbEqualTo.Text = vfInfo.EqualTo;
                        tbTotalNatu.Text = vfInfo.TotalNat;
                        tbTotalStand.Text = vfInfo.TotalStand;
                    }
                    #endregion
                    break;
                default:
                    break;
            }

        }
        protected void btnOtherSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.VoyageId))
                {
                    ShowMsg("请先保存航次信息。");
                    return;
                }
                ShipInfo sInfo = new Ship().GetByID(ddlShipName.SelectedValue);
                VoyageOtherInfo voInfo = new VoyageOther().GetByVoyageID(this.VoyageId);
                if (voInfo == null)
                {
                    voInfo = new VoyageOtherInfo();
                }
                voInfo.VoyageID = this.VoyageId;
                voInfo.Customer = tbCustomer.Text;
                voInfo.Remark = tbRemark.Text;
                voInfo.User1 = tbOtherUser1.Text;
                voInfo.User2 = tbOtherUser2.Text;
                voInfo.User3 = tbOtherUser3.Text;

                voInfo.Amount = tbOtherFee.Text;
                voInfo.OtherName = tbOtherName.Text;
                voInfo.CurrencyID = ddlCurrencyOther.SelectedValue;
                if (string.IsNullOrEmpty(voInfo.ID))
                {
                    new VoyageOther().Add(voInfo);
                }
                else
                {
                    new VoyageOther().Update(voInfo);
                }
                lbOtherRMB.Text = new ExchangeRate().GetRMB(voInfo.Amount, voInfo.CurrencyID, voInfo.CreateTime).ToString();

                ShowMsg("操作成功!");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
        /// <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);
            }
        }
        private void ShipTypeInitial()
        {
            ShipInfo sInfo = new Ship().GetByID(ddlShipName.SelectedValue);

            divFCL.Visible = false;
            divLCL.Visible = false;
            if (GetRequest("type") == "other")
            {
                return;
            }
            switch (sInfo.LoadTypeEnum)
            {
                case ShipType.LCL:
                    divLCL.Visible = true;
                    break;
                case ShipType.FCL:
                    divFCL.Visible = true;
                    break;
                default:
                    break;
            }
        }
 private void BindShip()
 {
     IList<ShipInfo> sList = new Ship().GetList();
     ddlShip.DataSource = sList;
     ddlShip.DataBind();
     ddlShip.SelectedIndex = 0;
 }
Beispiel #8
0
        /// <summary>
        /// 船舶编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvShipList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                string ShipId = e.CommandArgument.ToString();

                if (e.CommandName == "btnDelShip")
                {
                    new Ship().Delete(ShipId);
                    ShowMsg("操作成功!");
                    BindShip(0);
                    NewShip();
                    return;
                }
                else if (e.CommandName == "btnEditShip")
                {
                    // 编辑
                    lbID2.Value = ShipId;
                    ShipInfo sInfo = new Ship().GetByID(ShipId);
                    tbName.Text = sInfo.Name;
                    tbCode.Text = sInfo.Code;
                    tbCaptain.Text = sInfo.Captain;
                    tbChiefEngineer.Text = sInfo.ChiefEngineer;
                    tbGeneralManager.Text = sInfo.GeneralManager;
                    cRentDate.Text = sInfo.RentDate.ToShortDateString();
                    rblLoadType.SelectedValue = sInfo.LoadType;
                    rblOperationType.SelectedValue = sInfo.OperationType;
                }
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
        /// <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.FCL:
                        //集装箱
                        VoyageLoadInfo vfInfo = new VoyageLoad().GetByVoyageID(this.VoyageId);
                        if (vfInfo == null)
                        {
                            vfInfo = new VoyageLoadInfo();
                        }
                        vfInfo.TEUEmpty = tbTEUEmpty.Text;
                        vfInfo.TEUHeavy = tbTEUHeavy.Text;
                        vfInfo.TEUFrost = tbTEUFROST.Text;

                        vfInfo.FEUEmpty = tbFEUEmpty.Text;
                        vfInfo.FEUHeavy = tbFEUHeavy.Text;
                        vfInfo.FEUFrost = tbFEUFROST.Text;
                        vfInfo.FEUDanger = tbFEUDANG.Text;

                        vfInfo.FFEUEmpty = tbFFEUEmpty.Text;
                        vfInfo.FFEUHeavy = tbFFEUHeavy.Text;
                        vfInfo.FFEUFrost = tbFFEUFROST.Text;
                        vfInfo.FFEUDanger = tbFFEUDANG.Text;

                        vfInfo.Rest = tbRest.Text;
                        vfInfo.EqualTo = tbEqualTo.Text;
                        vfInfo.TotalNat = tbTotalNatu.Text;
                        vfInfo.TotalStand = tbTotalStand.Text;
                        vfInfo.VoyageID = this.VoyageId;

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

                ShowMsg("操作成功!");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
Beispiel #10
0
        /// <summary>
        /// 绑定燃润列表
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        private void BindReport(int pageSize, int pageIndex)
        {
            try
            {
                //string qShipName = tbShipName.Text;
                //string qStartDate = tbStartDate.Text;
                //string qEndDate = tbEndDate.Text;
                //string qStartPort = ddlStartPort.SelectedValue;
                //string qEndPort = ddlEndPort.SelectedValue;
                string qShipName = string.Empty;
                string qStartDate = string.Empty;
                string qEndDate = string.Empty;
                string qStartPort = string.Empty;
                string qEndPort = string.Empty;

                string shipID = MonthAndShipNavigate1.ShipID;
                if (string.IsNullOrEmpty(shipID) == false)
                {
                    ShipInfo sInfo = new Ship().GetByID(shipID);
                    qShipName = sInfo.Name;
                }
                string dateID = MonthAndShipNavigate1.DateID;

                DataSet ds = new HangciBaseInput().GetBaseInputList(dateID, qShipName, qStartDate, qEndDate, qStartPort, qEndPort, pageSize, pageIndex);
                gvReportList.DataSource = ds;
                gvReportList.DataBind();
                CustomDataSet cDS = ds as CustomDataSet;
                if (cDS == null)
                {
                    pGridV.TotalAmout = 0;
                    return;
                }
                pGridV.TotalAmout = cDS.TotalAmout;

            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
 private void BindShip(string shipID)
 {
     IList<ShipInfo> sList = new Ship().GetList();
     ddlShip.DataSource = sList;
     ddlShip.DataBind();
     if (string.IsNullOrEmpty(shipID) == false)
     {
         ddlShip.SelectedValue = shipID;
     }
     else
     {
         shipID = ddlShip.Items[0].Value;
     }
 }
 void BindShip()
 {
     IList<ShipInfo> sList = new Ship().GetList();
     rblShip.DataSource = sList;
     rblShip.DataBind();
     rblShip.Items.Insert(0, new ListItem("全部", string.Empty));
     rblShip.SelectedIndex = 0;
 }
 private void BindList()
 {
     string shipID = MonthAndShipNavigate1.ShipID;
     string dateID = MonthAndShipNavigate1.DateID;
     DataSet ds = new Ship().GetIncomeMonthReport(dateID, shipID, pGridV.PageSize, pGridV.CurrentPageIndex);
     CustomDataSet cDS = ds as CustomDataSet;
     gvList.DataSource = ds;
     gvList.DataBind();
     pGridV.TotalAmout = cDS.TotalAmout;
 }
        protected void gvList_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;
                    }
                    decimal dLCL = Convert.ToDecimal(dv.Row["散货美元收入"]);
                    decimal dLCLR = Convert.ToDecimal(dv.Row["散货人民币收入"]);

                    decimal dFCL = Convert.ToDecimal(dv.Row["集装箱美元收入"]);
                    decimal dFCLR = Convert.ToDecimal(dv.Row["集装箱人民币收入"]);

                    decimal dRent = Convert.ToDecimal(dv.Row["出租美元收入"]);
                    decimal dRentR = Convert.ToDecimal(dv.Row["出租人民币收入"]);

                    Label lbTotalD = (Label)e.Row.FindControl("lbTotalD");
                    lbTotalD.Text = (dLCL + dFCL + dRent).ToString();
                    Label lbTotalR = (Label)e.Row.FindControl("lbTotalR");
                    lbTotalR.Text = (dLCLR + dFCLR + dRentR).ToString();
                    Label lbTotal = (Label)e.Row.FindControl("lbTotal");
                    Label lbTotalNO = (Label)e.Row.FindControl("lbTotalNO");

                    string shipID = dv.Row["ID"].ToString();
                    HyperLink hlShip = (HyperLink)e.Row.FindControl("hlShip");
                    ShipInfo sInfo = new Ship().GetByID(shipID);
                        string dateID = MonthAndShipNavigate1.DateID;
                    if (sInfo.LoadTypeEnum == ShipType.FCL)
                    {
                        hlShip.NavigateUrl = string.Format("FCLManageList.aspx?shipID={0}&dateID={1}", shipID, dateID);
                    }
                    else if (sInfo.LoadTypeEnum == ShipType.LCL)
                    {
                        hlShip.NavigateUrl = string.Format("LCLManageList.aspx?shipID={0}&dateID={1}", shipID, dateID);
                    }
                }
                if (e.Row.RowIndex >= 0)
                {
                    string strVoyage = e.Row.Cells[2].Text;
                    string strLoad = e.Row.Cells[3].Text;
                    string strContainner = e.Row.Cells[6].Text;
                    string strRent = e.Row.Cells[9].Text;

                    double result = 0;
                    bool isDouble = Double.TryParse(strVoyage, out result);
                    if (isDouble)
                    {
                        sumVoyage += Convert.ToDouble(strVoyage);
                    }
                    isDouble = Double.TryParse(strContainner, out result);
                    if (isDouble)
                    {
                        sumContainner += Convert.ToDouble(strContainner);
                    }
                    isDouble = Double.TryParse(strLoad, out result);
                    if (isDouble)
                    {
                        sumLoad += Convert.ToDouble(strLoad);
                    }
                    isDouble = Double.TryParse(strRent, out result);
                    if (isDouble)
                    {
                        sumRent += Convert.ToDouble(strRent);
                    }

                }
                else if (e.Row.RowType == DataControlRowType.Footer)
                {
                    e.Row.Cells[2].Text = "航次总计:" + sumVoyage.ToString() + "班";
                    e.Row.Cells[3].Text = "承运货量总计:" + sumLoad.ToString() + "吨";
                    e.Row.Cells[6].Text = "承运箱量总计:" + sumContainner.ToString() + "箱";
                    e.Row.Cells[9].Text = "出租天数总计:" + sumRent.ToString() + "天";
                }
            }
            catch (ArgumentException ae)
            {
                this.ShowMsg(ae.Message);
            }
            catch (Exception exc)
            {
                ShowMsg(exc.Message);
            }
        }
        private void BindDDL()
        {
            IList<RouteInfo> dRouteList = new Route().GetList();
            ddlRouteName.DataSource = dRouteList;
            ddlRouteName.DataBind();

            IList<ManagerTypeInfo> mtList = new ManagerType().GetList();
            ddlManagerType.DataSource = mtList;
            ddlManagerType.DataBind();


            IList<ShipInfo> dShipList = new Ship().GetList();
            ddlShipName.DataSource = dShipList;
            ddlShipName.DataBind();
            ShipTypeInitial();

            tbStartTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            tbEndTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
            // 绑定小时和分钟
            for (int i = 0; i < 24; i++)
            {
                ddlStartHour.Items.Add(new ListItem(i.ToString(), i.ToString()));
                ddlEndHour.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
            for (int j = 0; j < 60; j++)
            {
                ddlStartMin.Items.Add(new ListItem(j.ToString(), j.ToString()));
                ddlEndMin.Items.Add(new ListItem(j.ToString(), j.ToString()));
            }
            ddlStartHour.SelectedIndex = 0;
            ddlEndHour.SelectedIndex = 0;
            ddlStartMin.SelectedIndex = 0;
            ddlEndMin.SelectedIndex = 0;
        }
        private void ShipTypeInitial()
        {
            ShipInfo sInfo = new Ship().GetByID(ddlShipName.SelectedValue);

            divFCL.Visible = false;
            switch (sInfo.LoadTypeEnum)
            {
                case ShipType.FCL:
                    divFCL.Visible = true;
                    break;
                default:
                    break;
            }
        }
 void BindShip()
 {
     IList<ShipInfo> sList = new Ship().GetList();
     rblShip.DataSource = sList;
     rblShip.DataBind();
     if (IsShowShipAll)
     {
         rblShip.Items.Insert(0, new ListItem("全部", string.Empty));
     }
     if (rblShip.Items != null && rblShip.Items.Count > 0)
     {
         rblShip.SelectedIndex = 0;
     }
 }
Beispiel #18
0
        /// <summary>
        /// 初始化航次信息
        /// </summary>
        /// <param name="voyageID"></param>
        private string VoyageInitial(string voyageIds)
        {
            //根据航次或者船舶绑定数据
            string[] voyageIdArray = voyageIds.Split(',');
            IList<VoyageInfo> vList = new Voyage().GetList(voyageIdArray);
            ddlVoyage.DataSource = vList;
            ddlVoyage.DataBind();

            string voyageID = voyageIdArray[0];
            VoyageInfo vInfo = new Voyage().GetByID(voyageID);
            ddlVoyage.SelectedValue = voyageID;

            string shipID = vInfo.ShipID.ToString();
            ShipInfo sInfo = new Ship().GetByID(shipID);
            lbShip.Text = sInfo.Name;

            string routeID = vInfo.RouteID.ToString();
            RouteInfo rInfo = new Route().GetByID(routeID);
            lbRoute.Text = rInfo.Name;
            lbMile.Text = rInfo.Distance.ToString();

            IList<PortInfo> pList = new Port().GetList(routeID, "2");
            lbBegin.Text = pList[0].Name;
            pList = new Port().GetList(routeID, "4");
            lbEnd.Text = pList[0].Name;

            return voyageID;
        }
        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;
            }

        }
        //航次基本信息绑定
        private void bindVoyageInfo(string voyageid)
        {
            VoyageInfo vi = new VoyageInfo();
            Voyage v = new Voyage();

            vi = v.GetByID(voyageid);

            string voyageName = vi.Name;
            string beginDate = vi.BeginDate.ToString();
            string endDate = vi.EndDate.ToString();
            string routeId = vi.RouteID.ToString();

            Route r = new Route();
            RouteInfo ri = new RouteInfo();

            ri = r.GetByID(routeId);
            float distance = ri.Distance;

            Ship ship = new Ship();
            ShipInfo si = new ShipInfo();
            si = ship.GetByID(vi.ShipID.ToString());

            string shipName = si.Name;
            string chiefEngineer = si.ChiefEngineer;
            string captain = si.Captain;
            string generalManager = si.GeneralManager;

            Relation_RoutePort rrp = new Relation_RoutePort();
            Relation_RoutePortInfo rrpi = new Relation_RoutePortInfo();

            int startPortId = 0;
            int endPortId = 0;
            rrpi = rrp.GetListByRouteID(routeId)[0];
            int portType = rrpi.PortTypeID;

            //出发港
            if (portType == 2)
            {
                startPortId = rrpi.PortID;
            }
            //到达港
            if (portType == 4)
            {
                endPortId = rrpi.PortID;
            }

            rrpi = rrp.GetListByRouteID(routeId)[1];
            portType = rrpi.PortTypeID;

            //出发港
            if (portType == 2)
            {
                startPortId = rrpi.PortID;
            }
            //到达港
            if (portType == 4)
            {
                endPortId = rrpi.PortID;
            }

            Port p = new Port();
            PortInfo pi = new PortInfo();

            pi = p.GetByID(startPortId.ToString());
            string startPortName = pi.Name;
            pi = p.GetByID(endPortId.ToString());
            string endPortName = pi.Name;

            lblShipName.Text = shipName;
            lblDistance.Text = distance.ToString();

            if (beginDate.Split(' ')[0].ToString().Equals("1900/1/1"))
            {
                lblStartTime.Text = "";
            }
            else
            {
                lblStartTime.Text = beginDate;
            }

            if (endDate.Split(' ')[0].ToString().Equals("1900/1/1"))
            {
                lblStartTime.Text = "";
            }
            else
            {
                lblEndTime.Text = endDate;
            }

            lblStartPort.Text = startPortName;
            lblEndPort.Text = endPortName;
            lblChiefEngineer.Text = chiefEngineer;
            lblCaptain.Text = captain;
            lblGeneralManager.Text = generalManager;
        }
        private void BindDDL()
        {
            IList<ShipInfo> dShipList = new Ship().GetList();
            ddlShipName.DataSource = dShipList;
            ddlShipName.DataBind();


            IList<CurrencyInfo> cList = new Currency().GetList();
            ddlCurrency.DataSource = cList;
            ddlCurrency.DataBind();
        }