Ejemplo n.º 1
0
        public string buildUpMAN(ManEntity msgEntity, string msgType, string subType)
        {
            string strAWB = "";

            strAWB = base.buildUpBase(msgEntity, msgType, subType);

            string depDate         = msgEntity.depDate.ToString("dd") + transMonth(msgEntity.depDate.ToString("MM"));
            string depTime         = msgEntity.depDate.ToString("HH") + msgEntity.depDate.ToString("mm");
            string arrTime         = msgEntity.arrDate.ToString("HH") + msgEntity.arrDate.ToString("mm");
            string weightFormatted = string.Format("{0:0.0}", msgEntity.weightMAN);
            char   shipmentCode    = replaceShipmentIndicator(msgEntity.shipmentIndicatorMAN[0]);

            // 2014-04-07
            //strAWB += subType.ToUpper() + "/" + msgEntity.flightNo + "/" + depDate + "/" +
            //    msgEntity.origin + msgEntity.destFlight + "/" + shipmentCode + msgEntity.pcsMAN + "K" + weightFormatted + "/";

            strAWB += subType.ToUpper() + "/" + msgEntity.flightNo.Trim() + "/" + depDate + "/" +
                      msgEntity.forigin + msgEntity.destFlight + "/" + shipmentCode + msgEntity.pcsMAN + "K" + weightFormatted + "/";


            //if (subType.ToUpper() == "MAN")
            //    strAWB += "E" + msgEntity.estDepDate.ToString("HH") + msgEntity.estDepDate.ToString("mm");

            //if (subType.ToUpper() == "DEP")
            //    strAWB += "A" + msgEntity.actDepDate.ToString("HH") + msgEntity.actDepDate.ToString("mm");


            // Original. 2016-02-10
            //strAWB += msgEntity.depDateType + depTime + "/" + msgEntity.arrDateType + arrTime;
            strAWB += msgEntity.depDateType + depTime;


            // added. 2016-02-10
            if (msgEntity.Ccode == "IBEMIA" || msgEntity.Ccode == "IBEJFK")
            {
                // for now.
            }
            else
            {
                strAWB += "/" + msgEntity.arrDateType + arrTime;

                if (msgEntity.dayChangeIndicator != "")
                {
                    strAWB += "-" + msgEntity.dayChangeIndicator.ToUpper();
                }
            }

            strAWB += "\r\n";

            return(strAWB);
        }
Ejemplo n.º 2
0
        public ManEntity GetMANfromReader(BaseEntity baseEntity, IDataReader reader)
        {
            ManEntity manEntity = new ManEntity();

            if (reader.Read())
            {
                int pcs = 0;
                try
                {
                    pcs = Convert.ToInt32(reader["pcs"]);
                }
                catch
                {
                    ManEntity manEntityEx = new ManEntity();
                    return(manEntityEx);
                }
                double weight = 0.00;

                try
                {
                    weight = Convert.ToDouble(reader["weight"].ToString());
                }
                catch (Exception e)
                {
                    ManEntity manEntityEx = new ManEntity();
                    return(manEntityEx);
                }
                try
                {
                    manEntity = new ManEntity(
                        baseEntity,
                        pcs,
                        weight,
                        reader["Partial"].ToString().Trim(),
                        Convert.ToDateTime(reader["DepDate"]),
                        reader["DepDateType"].ToString().Trim(),
                        Convert.ToDateTime(reader["ArrDate"]),
                        reader["ArrDateType"].ToString().Trim(),
                        reader["DayChange"].ToString().Trim(),
                        reader["FlightNo"].ToString().Trim());

                    reader.Close();
                    reader.Dispose();
                    disConnect_dbcn_ExcuteReader();

                    return(manEntity);
                }
                catch (Exception e)
                {
                    reader.Close();
                    reader.Dispose();
                    disConnect_dbcn_ExcuteReader();

                    ManEntity manEntityEx = new ManEntity();
                    return(manEntityEx);
                }
            }

            reader.Close();
            reader.Dispose();
            disConnect_dbcn_ExcuteReader();

            return(manEntity);
        }