Пример #1
0
            public override void UpdatedCaseList(CaseListUpdate updatelist)
            {
                if (updatelist.state == CaseListUpdateState.Add)
                {
                    //caseList.Merge(updatelist.dsCaseList);
                    
                    foreach (CaseListDataSet.CaseListTableRow row in updatelist.dsCaseList.CaseListTable.Rows)
                    {
                        try
                        {
                            lock (caseList.CaseListLock)
                            {
                                caseList.List.CaseListTable.AddCaseListTableRow(row.CaseId, row.AnalystComment, row.ObjectId, row.FlightNumber,
                                    row.Analyst, row.CaseDirectory, row.ReferenceImage, row.Result,
                                    row.UpdateTime, row.Archived, row.AnalysisTime, row.CreateTime, row.Area, row.Image, row.CTI, row.AssignedId);
                            }
                        }
                        catch (ConstraintException exp)
                        {                            
                            logger.listBox1.Dispatcher.Invoke(DispatcherPriority.Normal,
                                new Action(
                                    delegate()
                                    {
                                        logger.listBox1.Items.Add("Exp: " + exp.ToString());
                                    }));
                        }
                    }
                    
                }
                else if (updatelist.state == CaseListUpdateState.Delete)
                {
                    foreach (DataRow row in updatelist.dsCaseList.CaseListTable.Rows)
                    {
                        string caseId = row[updatelist.dsCaseList.CaseListTable.CaseIdColumn, DataRowVersion.Original].ToString();
                        bool refImg = (bool) row[updatelist.dsCaseList.CaseListTable.ReferenceImageColumn, DataRowVersion.Original];
                        DataRow foundRow = caseList.List.CaseListTable.FindByCaseIdReferenceImage(caseId, refImg);
                        if (foundRow != null)
                        {
                            foundRow.Delete();
                        }
                    }
                }
                else if (updatelist.state == CaseListUpdateState.Modify)
                {
                    foreach (DataRow row in updatelist.dsCaseList.CaseListTable.Rows)
                    {
                        string caseId = row[updatelist.dsCaseList.CaseListTable.CaseIdColumn, DataRowVersion.Original].ToString();
                        bool refImg = (bool)row[updatelist.dsCaseList.CaseListTable.ReferenceImageColumn, DataRowVersion.Original];
                        DataRow foundRow = caseList.List.CaseListTable.FindByCaseIdReferenceImage(caseId, refImg);
                        if (foundRow != null)
                        {
                            foundRow.ItemArray = row.ItemArray;
                        }
                    }
                }

                //caseList.AcceptChanges();                
            }
Пример #2
0
        public override void UpdateCaseList(CaseListUpdate listupdate)
        {
            List<String> callbacks = new List<String>();

            lock (m_ClientListLock)
            {
                if (m_WSCallbacks != null)
                {
                    foreach (String key in m_WSCallbacks.Keys)
                    {
                        try
                        {
                            m_WSCallbacks[key].UpdatedCaseList(listupdate);
                        }
                        catch
                        {
                            callbacks.Add(key);
                        }
                    }
                }
            }

            RemoveCallBacks(callbacks);
        }
Пример #3
0
 public virtual void UpdatedCaseList(CaseListUpdate listupdate)
 {
 }