Exemple #1
0
        public static bool HasAssignments(string freightID)
        {
            //Determine if the specified fright has assignments
            FreightAssignDS assignments = new FreightAssignDS();

            assignments.Merge(FreightFactory.StationAssignments.StationFreightAssignmentTable.Select("FreightID = '" + freightID + "'"));
            return(assignments.StationFreightAssignmentTable.Count > 0);
        }
Exemple #2
0
        public static FreightAssignDS GetAssignments(string freightID, string workStationID)
        {
            //Return a dataset of all assignments from the assignments grid dataset
            FreightAssignDS dsAssignments = null;

            try {
                dsAssignments = new FreightAssignDS();
                FreightAssignDS dsSelectedAssignments = new FreightAssignDS();
                if (workStationID.Trim() == "")
                {
                    dsSelectedAssignments.Merge(_Assignments.StationFreightAssignmentTable.Select("FreightID = '" + freightID + "'"));
                }
                else
                {
                    dsSelectedAssignments.Merge(_Assignments.StationFreightAssignmentTable.Select("FreightID = '" + freightID + "' AND WorkStationID = '" + workStationID + "'"));
                }
                for (int i = 0; i < dsSelectedAssignments.StationFreightAssignmentTable.Rows.Count; i++)
                {
                    dsAssignments.StationFreightAssignmentTable.ImportRow(dsSelectedAssignments.StationFreightAssignmentTable[i]);
                }
            }
            catch (Exception) { }
            return(dsAssignments);
        }
Exemple #3
0
        public static void RefreshStationAssignments()
        {
            //Refresh the list of freight assignments for the local terminal
            DataSet ds = null;

            try {
                _Assignments.Clear();
                ds = App.Mediator.FillDataset(USP_ASSIGNMENTS, TBL_ASSIGNMENTS, null);
                if (ds != null)
                {
                    _Assignments.Merge(ds, false, MissingSchemaAction.Ignore);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Failed to refresh station assignments.", ex); }
            finally { if (AssignmentsChanged != null)
                      {
                          AssignmentsChanged(null, EventArgs.Empty);
                      }
            }
        }