public string buildUpAWD(AwdEntity msgEntity, string msgType, string subType)
        {
            string strAWB = "";

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


            /*TIMEZONE. 2015-07-02  */
            /*Local Time added      */

            // --> removed time zone. it is already local time 2016-1-13
            //int timezone = getTimezone(msgEntity.Lcode, msgEntity.queueId);
            //msgEntity.docAvailDate = msgEntity.docAvailDate.AddHours(timezone);

            string rcfTime = msgEntity.docAvailDate.ToString("dd") + transMonth(msgEntity.docAvailDate.ToString("MM")) +
                             msgEntity.docAvailDate.ToString("HH") + msgEntity.docAvailDate.ToString("mm");

            /*Original*/
            //string rcfTime = msgEntity.docAvailDate.ToString("dd") + transMonth(msgEntity.docAvailDate.ToString("MM")) +
            //                msgEntity.docAvailDate.ToString("HH") + msgEntity.docAvailDate.ToString("mm");


            string weightFormatted = string.Format("{0:0.0}", msgEntity.weightAWD);
            char   shipmentCode    = replaceShipmentIndicator(msgEntity.shipmentIndicatorAWD[0]);
            string cnee            = truncateString(msgEntity.cnee, 35);

            //strAWB += subType.ToUpper() + "/" + rcfTime + "/" + msgEntity.destFlight + "/" +
            //    shipmentCode + msgEntity.pcsAWD + "K" + weightFormatted + "/" + cnee + "\r\n";

            strAWB += subType.ToUpper() + "/" + rcfTime + "/" + msgEntity.destFlight + "/" +
                      shipmentCode + msgEntity.pcsAWD + "K" + weightFormatted;

            if (cnee.ToString() != "")
            {
                strAWB += "/" + cnee.ToUpper() + "\r\n";
            }
            else
            {
                strAWB += "\r\n";
            }

            return(strAWB);
        }
Exemplo n.º 2
0
        public AwdEntity GetAWDfromReader(BaseEntity baseEntity, IDataReader reader)
        {
            if (!reader.IsClosed)
            {
                reader.Read();

                int pcs = 0;
                try
                {
                    pcs = Convert.ToInt32(reader["pcs"]);
                }
                catch
                {
                    AwdEntity awdEntityEx = new AwdEntity();
                    return(awdEntityEx);
                }
                double weight = 0.00;

                try
                {
                    weight = Convert.ToDouble(reader["weight"].ToString());
                }
                catch (Exception e)
                {
                    AwdEntity awdEntityEx = new AwdEntity();
                    return(awdEntityEx);
                }
                try
                {
                    AwdEntity awdEntity = new AwdEntity(
                        baseEntity,
                        pcs,
                        weight,
                        reader["Partial"].ToString().Trim(),
                        Convert.ToDateTime(reader["DocAvailDate"]),
                        reader["cnee"].ToString().Trim());


                    reader.Close();
                    reader.Dispose();
                    disConnect_dbcn_ExcuteReader();
                    return(awdEntity);
                }
                catch
                {
                    reader.Close();
                    reader.Dispose();
                    disConnect_dbcn_ExcuteReader();

                    AwdEntity awdEntityEx = new AwdEntity();
                    return(awdEntityEx);
                }
            }
            else
            {
                reader.Close();
                reader.Dispose();
                disConnect_dbcn_ExcuteReader();

                AwdEntity awdEntity = new AwdEntity();
                return(awdEntity);
            }
        }