示例#1
0
        public ShipperDS GetShippers(FreightType freightType, string clientNumber, string clientTerminal)
        {
            //Get a list of shippers
            ShipperDS shippers = null;

            try {
                shippers = new ShipperDS();
                if (freightType == FreightType.Regular)
                {
                    VendorDS vendors = GetVendors(clientNumber, clientTerminal);
                    shippers = new ShipperDS();
                    for (int i = 0; i < vendors.VendorTable.Rows.Count; i++)
                    {
                        shippers.ShipperTable.AddShipperTableRow(vendors.VendorTable[i].VendorNumber, vendors.VendorTable[i].VendorName, vendors.VendorTable[i].VendorParentNumber, vendors.VendorTable[i].VendorSummary);
                    }
                    shippers.AcceptChanges();
                }
                else if (freightType == FreightType.Returns)
                {
                    AgentDS   agents    = GetAgents(false);
                    ShipperDS _shippers = new ShipperDS();
                    for (int i = 0; i < agents.AgentTable.Rows.Count; i++)
                    {
                        _shippers.ShipperTable.AddShipperTableRow(agents.AgentTable[i].AgentNumber, agents.AgentTable[i].AgentName, agents.AgentTable[i].AgentParentNumber, agents.AgentTable[i].AgentSummary);
                    }
                    shippers.Merge(_shippers.ShipperTable.Select("", "ShipperNumber ASC"));
                    shippers.AcceptChanges();
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected exception creating shipper list.", ex); }
            return(shippers);
        }
示例#2
0
        public DataSet GetShippers(FreightType freightType, string clientNumber, string clientTerminal)
        {
            //Get a list of shippers
            DataSet shippers = new DataSet();

            shippers.Tables.Add("ShipperTable");
            shippers.Tables["ShipperTable"].Columns.Add("ShipperNumber");
            shippers.Tables["ShipperTable"].Columns.Add("ShipperName");
            shippers.Tables["ShipperTable"].Columns.Add("ShipperParentNumber");
            shippers.Tables["ShipperTable"].Columns.Add("ShipperSummary");
            try {
                if (freightType == FreightType.Regular)
                {
                    DataSet vendors = GetVendors(clientNumber, clientTerminal);
                    for (int i = 0; i < vendors.Tables[TBL_VENDORS].Rows.Count; i++)
                    {
                        shippers.Tables["ShipperTable"].Rows.Add(new object[] { vendors.Tables[TBL_VENDORS].Rows[i]["VendorNumber"], vendors.Tables[TBL_VENDORS].Rows[i]["VendorName"], vendors.Tables[TBL_VENDORS].Rows[i]["VendorParentNumber"], vendors.Tables[TBL_VENDORS].Rows[i]["VendorSummary"] });
                    }
                }
                else if (freightType == FreightType.Returns)
                {
                    DataSet agents = GetAgents(false);
                    shippers.Merge(agents.Tables[TBL_AGENTS].Select("", "ShipperNumber ASC"));
                    for (int i = 0; i < agents.Tables[TBL_AGENTS].Rows.Count; i++)
                    {
                        shippers.Tables["ShipperTable"].Rows.Add(new object[] { agents.Tables[TBL_AGENTS].Rows[i]["AgentNumber"], agents.Tables[TBL_AGENTS].Rows[i]["AgentName"], agents.Tables[TBL_AGENTS].Rows[i]["AgentParentNumber"], agents.Tables[TBL_AGENTS].Rows[i]["AgentSummary"] });
                    }
                }
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(shippers);
        }
示例#3
0
        public static IFreight GetFreight(FreightType freightType)
        {
            var dictionaryFreights = new Dictionary <FreightType, IFreight>
            {
                { FreightType.NORMAL, new NormalFreight() },
                { FreightType.SEDEX, new SEDEXFreight() }
            };

            return(dictionaryFreights[freightType]);
        }
示例#4
0
        public FreightContainer(FreightType type, uint weight)
        {
            Type         = type;
            this._weight = weight;

            if (Weight > 30_000)
            {
                throw new ArgumentException();
            }
        }
示例#5
0
        public async Task <ActionResult> Delete(int id)
        {
            FreightType freightType = await freightTypeRepository.FindFreightTypesByIDAsync(id);

            if (freightType == null)
            {
                return(HttpNotFound());
            }
            return(View(freightType));
        }
示例#6
0
        public async Task <ActionResult> Edit([Bind(Include = "FreightTypeID,Description")] FreightType freightType)
        {
            if (ModelState.IsValid)
            {
                await freightTypeRepository.UpdateAsync(freightType);

                return(RedirectToAction("Index"));
            }

            return(View(freightType));
        }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Freight"/> struct.
 /// </summary>
 /// <param name="weight"></param>
 /// <param name="freightType"></param>
 public Freight(double weight, FreightType freightType)
 {
     Weight      = weight;
     FreightType = freightType;
 }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsLogin)
            {
                Response.Clear();
                Response.Write("你尚未登录");
                Response.End();
                return;
            }
            int    m = 100;
            string y = Utils.GetMoney(m);

            airTypestr = Utils.GetInt(Utils.GetQueryStringValue("airType"), 1);
            FreightType airType = (FreightType)airTypestr;

            startCity = Utils.GetQueryStringValue("startCity");
            toCity    = Utils.GetQueryStringValue("toCity");
            int peopleNum = Utils.GetInt(Utils.GetQueryStringValue("peopleNum"), -1);

            startDatestr = Utils.GetQueryStringValue("startDate");
            backDatestr  = Utils.GetQueryStringValue("backDate");
            DateTime startDate  = Utils.GetDateTime(startDatestr);
            DateTime backDate   = Utils.GetDateTime(backDatestr);
            string   airCompany = Utils.GetQueryStringValue("airCompany");

            airCompany = Regex.Replace(airCompany, @"\(.*\)", "");
            int airId = -1;

            pType = Utils.GetInt(Utils.GetQueryStringValue("peopleType"), 0);
            if (pType == 0)
            {
                peopleType = new Nullable <TravellerType>(TravellerType.内宾);
            }
            else if (pType == 1)
            {
                peopleType = new Nullable <TravellerType>(TravellerType.外宾);
            }
            startCityName = Server.UrlDecode((Request.QueryString["startCity1"] ?? ""));
            toCityName    = Server.UrlDecode((Request.QueryString["toCity1"] ?? ""));
            //string[] sCityArr = startCity.Split('|');
            //string[] tCityArr = toCity.Split('|');
            //if (sCityArr.Length > 1 && tCityArr.Length > 1)
            //{
            startCityId = Utils.GetInt(startCity);
            toCityId    = Utils.GetInt(toCity);
            //}
            IList <EyouSoft.Model.TicketStructure.TicketFlightCompany> airList = EyouSoft.BLL.TicketStructure.TicketFlightCompany.CreateInstance().GetTicketFlightCompanyList(airCompany);

            if (airList != null && airList.Count == 1 && airList[0].AirportName == airCompany)
            {
                airId = airList[0].Id;
            }
            else
            {
                airId = -1;
            }


            QueryTicketFreightInfo queryInfo = new QueryTicketFreightInfo(null, null, startCityId, toCityId, peopleNum, startDate, backDate, airId, peopleType);

            EyouSoft.IBLL.TicketStructure.ITicketFreightInfo tfiBll = EyouSoft.BLL.TicketStructure.TicketFreightInfo.CreateInstance();


            imageServerUrl = ImageManage.GetImagerServerUrl(1);

            IList <EyouSoft.Model.TicketStructure.TicketFreightInfoList> tfilList = tfiBll.GetFreightInfoList(queryInfo);

            if (tfilList != null && tfilList.Count > 0)
            {
                acl_rptCustomerList.DataSource = tfilList;
                acl_rptCustomerList.DataBind();
            }
            else
            {
                acl_rptCustomerList.EmptyText = "<table><tr><td style='text-align:center'>暂无机票信息</td></tr><table>";
            }
        }