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); }
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); } }
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); }
//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; } }