Esempio n. 1
0
        public static InboundLabel CreateInboundLabel(int labelID)
        {
            //Create an inbound label for returns freight
            InboundLabel label = null;

            try {
                DataSet ds = Mediator.FillDataset(USP_IBLABEL_RET, TBL_IBLABEL_RET, new object[] { labelID });
                if (ds.Tables[TBL_IBLABEL_RET].Rows.Count == 0)
                {
                    throw new ApplicationException("Inbound label " + labelID.ToString() + " not found.");
                }
                else
                {
                    InboundLabelDS labelDS = new InboundLabelDS();
                    labelDS.Merge(ds);
                    ds = Mediator.FillDataset(USP_IBLABEL_ELEMS, TBL_IBLABEL_ELEMS, new object[] { labelID });
                    if (ds != null)
                    {
                        labelDS.Merge(ds);
                    }
                    label = new InboundLabel(labelDS);
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected exception creating regular inbound label.", ex); }
            return(label);
        }
Esempio n. 2
0
 public static void RefreshCache()
 {
     //Refresh cached data
     try {
         DefaultSanInboundLabel = CreateInboundLabel(DefaultIBLabelID);
     }
     catch (ApplicationException ex) { throw ex; }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while caching FreightFactory data.", ex); }
 }
Esempio n. 3
0
        public InboundLabel Copy()
        {
            //Return a copy of this object
            InboundLabel input = null;

            try {
                InboundLabelDS label = (InboundLabelDS)this.ToDataSet();
                input = new InboundLabel(label);
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while creating a copy of an Inbound Label.", ex); }
            return(input);
        }
Esempio n. 4
0
        //Interface
        public dlgInboundLabel(InboundLabel label)
        {
            //Constructor
            try {
                //Required designer support
                InitializeComponent();
                this.btnOk.Text     = CMD_OK;
                this.btnCancel.Text = CMD_CANCEL;

                //Set mediator service, data, and titlebar caption
                this.mLabel = label;
                this.Text   = (this.mLabel != null) ? "Inbound Label (" + this.mLabel.LabelID.ToString() + ")" : "Inbound Label (New)";
            }
            catch (Exception ex) { throw ex; }
        }