コード例 #1
0
        private void UpdateMachineDowntime(int ms_id, string cid, int downtime)
        {
            if (ms_id == 0)
            {
                return;
            }

            if (cid.Trim().Length != 6)
            {
                return;
            }

            if (downtime == 0)
            {
                return;
            }

            CtxService service = new CtxService(null, cid);

            try
            {
                service.updateMachineDowntime(ms_id, downtime);
            } finally
            {
                service.Dispose();
            }
        }
コード例 #2
0
        private void AutoAddScheduledOrder(schedule record, CtxService service)
        {
            if (service == null)
            {
                return;
            }
            try
            {
                int defaultEMPID = service.getDefaultEMPID();
                record.MS_Next_Main_Date     = DateTime.Now.AddDays(record.MS_Frequency).ToShortDateString() + " " + DateTime.Now.AddDays(record.MS_Frequency).ToShortTimeString();
                record.MS_Main_Comp_Date     = "";
                record.MS_WOCreate_Timestamp = DateTime.Now.AddDays(record.MS_Frequency).ToShortDateString() + " " + DateTime.Now.AddDays(record.MS_Frequency).ToShortTimeString();
                record.MS_WOClosed_Timestamp = "";
                record.EMP_ID = (record.EMP_ID != 0) ? record.EMP_ID : defaultEMPID;

                int result = service.Add(record);
                if (result == 0)
                {
                    throw new Exception("Error editing scheduled maintenance record.");
                }
                else
                {
                    service.clearCache();
                }
            } finally
            {
                service.Dispose();
            }
        }