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 gvCustomerList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.VoyageId))
                {
                    ShowMsg("请先保存集装箱费用报表再填写客户提货单。");
                    return;
                }
                string id = e.CommandArgument.ToString();
                if (e.CommandName == "btnDel")
                {
                    new FCLCustomer().Delete(id);
                }
                else
                {
                    #region 控件
                    GridViewRow gvr = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                    TextBox tbName = (TextBox)gvr.FindControl("tbName");
                    TextBox tbFee = (TextBox)gvr.FindControl("tbFee");
                    TextBox tbgp20 = (TextBox)gvr.FindControl("tbgp20");
                    TextBox tbgp40 = (TextBox)gvr.FindControl("tbgp40");
                    TextBox tbdp20 = (TextBox)gvr.FindControl("tbdp20");
                    TextBox tbdp40 = (TextBox)gvr.FindControl("tbdp40");
                    #endregion

                    FCLCustomerInfo info = new FCLCustomerInfo(id);
                    info.Name = tbName.Text;
                    info.Fee = tbFee.Text;
                    info.gp20 = tbgp20.Text;
                    info.gp40 = tbgp40.Text;
                    info.dp20 = tbdp20.Text;
                    info.dp40 = tbdp40.Text;
                    VoyageFCLInfo vfInfo = new VoyageFCL().GetByVoyageID(this.VoyageId);
                    string fclID = (vfInfo == null) ? string.Empty : vfInfo.ID;
                    info.FCLID = fclID;

                    if (e.CommandName == "btnEdit")
                    {
                        new FCLCustomer().Update(info);
                    }

                    if (e.CommandName == "btnAdd")
                    {
                        new FCLCustomer().Add(info);
                    }
                }
                BindCustomerList();
                ShowMsg("操作成功!");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 客户提单情况
 /// </summary>
 void BindCustomerList()
 {
     VoyageFCLInfo vfInfo = new VoyageFCL().GetByVoyageID(this.VoyageId);
     string fclID = (vfInfo == null) ? string.Empty : vfInfo.ID;
     IList<FCLCustomerInfo> list = new FCLCustomer().GetByFCLIDAddBlank(fclID);
     gvCustomerList.DataSource = list;
     gvCustomerList.DataBind();
 }
Exemplo n.º 4
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.º 5
0
 protected void gvFCL_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;
             }
             VoyageFCLInfo vInfo = new VoyageFCL().GetByID(reportID);
             Label lbTotal = (Label)e.Row.FindControl("lbTotal");
             lbTotal.Text = new VoyageFCL().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.º 6
0
 /// <summary>
 /// 绑定散货报表
 /// </summary>
 private void BindFCL(int pageIndex)
 {
     string shipID = MonthAndShipNavigate1.ShipID;
     string dateID = MonthAndShipNavigate1.DateID;
     string reportType = ddlFCLType.SelectedValue;
     DataSet ds = new VoyageFCL().GetList(dateID, shipID, reportType, pGridV.PageSize, pageIndex);
     gvFCL.DataSource = ds;
     gvFCL.DataBind();
     CustomDataSet cDS = ds as CustomDataSet;
     if (cDS == null)
     {
         pGridV.TotalAmout = 0;
         return;
     }
     pGridV.TotalAmout = cDS.TotalAmout;
 }