Exemplo n.º 1
0
        private void grdvStopEvents_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            int idx = grdvStopEvents.GetFocusedDataSourceRowIndex();

            if (idx < 0 || idx >= stopEvents.Count)
            {
                return;
            }

            SelectPeriodStopEvent stopEvent = stopEvents[idx];

            List <SelectPeriodAndonEvent> datas = new List <SelectPeriodAndonEvent>();

            for (int i = 0; i < stopEvent.AndonEventFactIDs.Count; i++)
            {
                SelectPeriodAndonEvent data = FindAndonEventWithFactID(andonEvents, stopEvent.AndonEventFactIDs[i]);
                if (data != null)
                {
                    data          = data.Clone();
                    data.Selected = true;
                    datas.Add(data);
                }
            }
            foreach (SelectPeriodAndonEvent data in unUsedAndonEvents)
            {
                datas.Add(data.Clone());
            }

            SelectPeriodAndonEvent_CompareByFactID compare = new SelectPeriodAndonEvent_CompareByFactID();

            datas.Sort(compare);

            grdAndonEvents.DataSource = datas;
            grdvAndonEvents.BestFitColumns();
        }
Exemplo n.º 2
0
        private void repositoryItemCheckEdit1_CheckedChanged(object sender, EventArgs e)
        {
            int idx = grdvAndonEvents.GetFocusedDataSourceRowIndex();

            if (grdvAndonEvents.GetFocusedRow() != null)
            {
                SelectPeriodAndonEvent data =
                    grdvAndonEvents.GetFocusedRow() as SelectPeriodAndonEvent;

                SelectPeriodStopEvent stopEvent =
                    grdvStopEvents.GetFocusedRow() as SelectPeriodStopEvent;

                data.Selected = !data.Selected;
                grdvStopEvents.BeginDataUpdate();
                if (data.Selected)
                {
                    RemoveFromUnUsedAndonEvents(data.EventFactID);
                    stopEvent.AndonEventFactIDs.Add(data.EventFactID);
                }
                else
                {
                    unUsedAndonEvents.Add(data.Clone());
                    stopEvent.AndonEventFactIDs.Remove(data.EventFactID);
                }
                grdvStopEvents.EndDataUpdate();
            }
        }
Exemplo n.º 3
0
        private void GetAndonEvents()
        {
            string strProcedureName =
                string.Format(
                    "{0}.{1}",
                    className,
                    MethodBase.GetCurrentMethod().Name);

            WriteLog.Instance.WriteBeginSplitter(strProcedureName);
            try
            {
                andonEvents.Clear();
                unUsedAndonEvents.Clear();

                int    errCode = 0;
                string errText = "";
                List <PeriodAndonEvent> datas = new List <PeriodAndonEvent>();

                IRAPFVSClient.Instance.ufn_GetList_PeriodAndonEvents(
                    IRAPUser.Instance.CommunityID,
                    IRAPUser.Instance.SysLogID,
                    ref datas,
                    out errCode,
                    out errText);
                WriteLog.Instance.Write(
                    string.Format("({0}){1}", errCode, errText),
                    strProcedureName);
                if (errCode == 0)
                {
                    foreach (PeriodAndonEvent data in datas)
                    {
                        SelectPeriodAndonEvent andonEvent = new SelectPeriodAndonEvent();
                        andonEvent.CopyFrom(data);

                        andonEvents.Add(andonEvent);
                        unUsedAndonEvents.Add(andonEvent.Clone());
                    }
                }
                else
                {
                    IRAPMessageBox.Instance.ShowErrorMessage(errText, caption);
                }
            }
            finally
            {
                WriteLog.Instance.WriteEndSplitter(strProcedureName);
            }
        }