Esempio n. 1
0
        void client_GetVechileStandardAndPlaneLineCompleted(object sender, GetVechileStandardAndPlaneLineCompletedEventArgs e)
        {
            RefreshUI(RefreshedTypes.HideProgressBar);
            OldStandardList.Clear();
            try
            {
                if (!e.Cancelled)
                {
                    if (e.Error == null)
                    {
                        if (e.VechileStandardList.Count() > 0 && (e.UserState=="DefaultSolution" || isChange==true))
                        {
                            //OldStandardList = e.VechileStandardList.ToList();
                            e.VechileStandardList.ToList().ForEach(item =>
                            {
                                T_OA_TAKETHESTANDARDTRANSPORT Sport = new T_OA_TAKETHESTANDARDTRANSPORT();
                                Sport.TAKETHESTANDARDTRANSPORTID = item.TAKETHESTANDARDTRANSPORTID;
                                Sport.T_OA_TRAVELSOLUTIONS = item.T_OA_TRAVELSOLUTIONS;
                                Sport.TAKETHETOOLLEVEL = item.TAKETHETOOLLEVEL;
                                Sport.TYPEOFTRAVELTOOLS = item.TYPEOFTRAVELTOOLS;
                                Sport.ENDPOSTLEVEL = item.ENDPOSTLEVEL;
                                Sport.CREATEDATE = item.CREATEDATE;
                                Sport.CREATEUSERID = item.CREATEUSERID;
                                Sport.UPDATEDATE = item.UPDATEDATE;
                                Sport.UPDATEUSERID = item.UPDATEUSERID;
                                Sport.EntityKey = item.EntityKey;
                                if (OldStandardList.Count() > 0)
                                {
                                    var ents = from ent in OldStandardList
                                               where ent.ENDPOSTLEVEL == item.ENDPOSTLEVEL && ent.TAKETHETOOLLEVEL == item.TAKETHETOOLLEVEL
                                               && ent.TYPEOFTRAVELTOOLS == item.TYPEOFTRAVELTOOLS && ent.T_OA_TRAVELSOLUTIONS.TRAVELSOLUTIONSID == item.T_OA_TRAVELSOLUTIONS.TRAVELSOLUTIONSID
                                               && ent.TAKETHESTANDARDTRANSPORTID == item.TAKETHESTANDARDTRANSPORTID
                                               select ent;
                                    if (ents.Count() == 0)
                                        OldStandardList.Add(Sport);
                                }
                                else
                                {
                                    OldStandardList.Add(Sport);
                                }
                            });
                            StandardList = e.VechileStandardList;

                            StandardBindDataGrid(StandardList, false);
                        }
                        else
                        {
                            DGVechileStandard.ItemsSource = null;
                            StandardList.Clear();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Esempio n. 2
0
 void client_GetVechileStandardAndPlaneLineCompleted(object sender, GetVechileStandardAndPlaneLineCompletedEventArgs e)
 {
     try
     {
         if (!e.Cancelled)
         {
             if (e.Error==null)
             {
                 if (e.VechileStandardList.Count() > 0)
                 {
                     StandardList = e.VechileStandardList;
                     OldStandardList = e.VechileStandardList.ToList();
                     StandardBindDataGrid(StandardList, false);
                 }
                 
                                         
             }
         }
     }
     catch(Exception ex)
     { 
         throw(ex);
     }
 }
Esempio n. 3
0
        void client_GetVechileStandardAndPlaneLineCompleted(object sender, GetVechileStandardAndPlaneLineCompletedEventArgs e)
        {
            RefreshUI(RefreshedTypes.HideProgressBar);
            //OldStandardList.Clear();
            try
            {
                if (!e.Cancelled)
                {
                    if (e.Error == null)
                    {
                        if (e.VechileStandardList.Count() > 0 && (e.UserState=="DefaultSolution" || isChange==true))
                        {
                            //OldStandardList = e.VechileStandardList.ToList();
                            //e.VechileStandardList.OrderBy(c => c.TYPEOFTRAVELTOOLS).ThenBy(c => c.TAKETHETOOLLEVEL).ToList().ForEach(item =>
                            //{
                            //    T_OA_TAKETHESTANDARDTRANSPORT Sport = new T_OA_TAKETHESTANDARDTRANSPORT();
                            //    Sport.TAKETHESTANDARDTRANSPORTID = item.TAKETHESTANDARDTRANSPORTID;
                            //    Sport.T_OA_TRAVELSOLUTIONS = item.T_OA_TRAVELSOLUTIONS;
                            //    Sport.TAKETHETOOLLEVEL = item.TAKETHETOOLLEVEL;
                            //    Sport.TYPEOFTRAVELTOOLS = item.TYPEOFTRAVELTOOLS;
                            //    Sport.ENDPOSTLEVEL = item.ENDPOSTLEVEL;
                            //    Sport.CREATEDATE = item.CREATEDATE;
                            //    Sport.CREATEUSERID = item.CREATEUSERID;
                            //    Sport.UPDATEDATE = item.UPDATEDATE;
                            //    Sport.UPDATEUSERID = item.UPDATEUSERID;
                            //    Sport.EntityKey = item.EntityKey;
                            //    if (OldStandardList.Count() > 0)
                            //    {
                            //        var ents = from ent in OldStandardList
                            //                   where ent.ENDPOSTLEVEL == item.ENDPOSTLEVEL && ent.TAKETHETOOLLEVEL == item.TAKETHETOOLLEVEL
                            //                   && ent.TYPEOFTRAVELTOOLS == item.TYPEOFTRAVELTOOLS && ent.T_OA_TRAVELSOLUTIONS.TRAVELSOLUTIONSID == item.T_OA_TRAVELSOLUTIONS.TRAVELSOLUTIONSID
                            //                   && ent.TAKETHESTANDARDTRANSPORTID == item.TAKETHESTANDARDTRANSPORTID
                            //                   select ent;
                            //        if (ents.Count() == 0)
                            //            OldStandardList.Add(Sport);
                            //    }
                            //    else
                            //    {
                            //        OldStandardList.Add(Sport);
                            //    }
                            //});

                            var listALl=e.VechileStandardList.OrderBy(c => c.TYPEOFTRAVELTOOLS).ThenBy(c => c.TAKETHETOOLLEVEL).ToList();
                            ObservableCollection<T_OA_TAKETHESTANDARDTRANSPORT> tObjectStruct = new ObservableCollection<T_OA_TAKETHESTANDARDTRANSPORT>();

                            listALl.ForEach(p => tObjectStruct.Add(p));

                            StandardList = tObjectStruct;

                            this.DGVechileStandard.ItemsSource = StandardList;
                        }
                        else
                        {
                            DGVechileStandard.ItemsSource = null;
                            StandardList.Clear();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }