Ejemplo n.º 1
0
 //Interface
 public dlgSubscriptions(string reportName, ShipSchedule schedule)
 {
     //Constructor
     try {
         //Required for Windows Form Designer support
         InitializeComponent();
         this.mReportName = reportName;
         this.mSchedule   = schedule;
     }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new dlgSubscriptions instance.", ex); }
 }
Ejemplo n.º 2
0
 //Interface
 public AutoRefreshService(ShipSchedule schedule)
 {
     //
     this.mSortCenterID               = schedule.SortCenterID;
     this.mScheduleDate               = schedule.ScheduleDate;
     this.mTimer                      = new System.Windows.Forms.Timer();
     this.mTimer.Interval             = global::Argix.Properties.Settings.Default.AutoRefreshTimer;
     this.mTimer.Tick                += new EventHandler(OnTick);
     this.mWorker                     = new BackgroundWorker();
     this.mWorker.DoWork             += new DoWorkEventHandler(OnAutoRefresh);
     this.mWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(schedule.OnAutoRefreshCompleted);
 }
Ejemplo n.º 3
0
        public static ShipSchedule SchedulesAdd(long sortCenterID, string sortCenter, DateTime scheduleDate)
        {
            //Add a new ship schedule
            ShipSchedule schedule = null;

            try {
                //Add and update collection
                ShipScheduleDS ds = new ShipScheduleDS();
                ds.ShipScheduleViewTable.AddShipScheduleViewTableRow("", sortCenterID, sortCenter, scheduleDate, DateTime.Now, Environment.UserName);
                schedule          = new ShipSchedule(ds.ShipScheduleViewTable[0], Mediator);
                schedule.Changed += new EventHandler(OnShipScheduleChanged);
                schedule.Create();
            }
            catch (Exception ex) { throw new ApplicationException("Failed to add new ship schedule.", ex); }
            return(schedule);
        }
Ejemplo n.º 4
0
        public static ShipSchedule SchedulesItem(string scheduleID)
        {
            //Return a new or an existing ship schedule
            ShipSchedule schedule = null;

            try {
                //Existing- import from collection
                DataRow[] rows = _Schedules.ShipScheduleViewTable.Select("ScheduleID='" + scheduleID + "'");
                if (rows.Length > 0)
                {
                    schedule          = new ShipSchedule((ShipScheduleDS.ShipScheduleViewTableRow)rows[0], Mediator);
                    schedule.Changed += new EventHandler(OnShipScheduleChanged);
                }
            }
            catch (Exception ex) { throw ex; }
            return(schedule);
        }
Ejemplo n.º 5
0
        public static ShipSchedule SchedulesItem(long sortCenterID, DateTime date)
        {
            //Return a new or an existing ship schedule
            ShipSchedule schedule = null;

            try {
                //Existing- import from collection (notice table change)
                DataRow[] rows = _Schedules.ShipScheduleViewTable.Select("SortCenterID=" + sortCenterID + " AND ScheduleDate='" + date + "'");
                if (rows.Length > 0)
                {
                    schedule          = new ShipSchedule((ShipScheduleDS.ShipScheduleViewTableRow)rows[0], Mediator);
                    schedule.Changed += new EventHandler(OnShipScheduleChanged);
                }
            }
            catch (Exception ex) { throw ex; }
            return(schedule);
        }
Ejemplo n.º 6
0
        public static ShipSchedule SchedulesArchiveItem(long sortCenterID, string sortCenter, DateTime scheduleDate)
        {
            //Return an archived ship schedule
            ShipSchedule schedule = null;

            try {
                //
                DataSet ds = Mediator.FillDataset(Lib.USP_SCHEDULES, Lib.TBL_SCHEDULES, new object[] { scheduleDate });
                if (ds.Tables[Lib.TBL_SCHEDULES].Rows.Count > 0)
                {
                    DataRow[] rows = ds.Tables[Lib.TBL_SCHEDULES].Select("SortCenterID=" + sortCenterID + " AND ScheduleDate='" + scheduleDate + "'");
                    if (rows.Length > 0)
                    {
                        ShipScheduleDS scheduleDS = new ShipScheduleDS();
                        scheduleDS.ShipScheduleViewTable.AddShipScheduleViewTableRow("", sortCenterID, sortCenter, scheduleDate, DateTime.Now, Environment.UserName);
                        schedule          = new ShipSchedule(scheduleDS.ShipScheduleViewTable[0], Mediator);
                        schedule.Changed += new EventHandler(OnShipScheduleChanged);
                    }
                }
            }
            catch (Exception ex) { throw ex; }
            return(schedule);
        }
Ejemplo n.º 7
0
        public static ShipSchedule SchedulesArchiveItem(long sortCenterID, string sortCenter, DateTime scheduleDate)
        {
            //Return an archived ship schedule
            ShipSchedule schedule = null;

            try {
                //
                ShipScheduleDataset schedules = new ShipScheduleDataset();
                schedules.Merge(ShipScheduleGateway.GetShipSchedules(scheduleDate));
                if (schedules.ShipScheduleTable.Rows.Count > 0)
                {
                    DataRow[] rows = schedules.ShipScheduleTable.Select("SortCenterID=" + sortCenterID + " AND ScheduleDate='" + scheduleDate + "'");
                    if (rows.Length > 0)
                    {
                        ShipScheduleDataset scheduleDS = new ShipScheduleDataset();
                        scheduleDS.ShipScheduleTable.AddShipScheduleTableRow("", sortCenterID, sortCenter, scheduleDate, DateTime.Now, Environment.UserName);
                        schedule          = new ShipSchedule(scheduleDS.ShipScheduleTable[0]);
                        schedule.Changed += new EventHandler(OnShipScheduleChanged);
                    }
                }
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(schedule);
        }