public static List<TagProcessResult> GetSpellCheckForTags(List<TagSimple> tagSet)
        {
            var resultSet = new List<WordProcessResult>();

             foreach (var tag in tagSet)
             {
            tag.TagValue.Split(' ').ToList().ForEach(w => resultSet.Add(ProcessWord(w, tag.TagId)));
             }
             var groupedResultSet = resultSet.GroupBy(r => r.TagId).Select(i => new TagProcessResult{ TagId = i.Key, WordProcessResultList = i.ToList()}).ToList();
             return groupedResultSet;
        }
Beispiel #2
0
 /// <summary>
 /// 地接社其他企业统计信息
 /// </summary>
 /// <param name="dateyear">查询年份</param>
 /// <param name="EntName">查询企业名称</param>
 /// <param name="EntId">所在地接社id</param>
 /// <returns>查询出的企业列表</returns>
 public IList<DJ_TourEnterprise> GetDJStaticsEnt(string bengintime, string endtime, string EntName, int type, int EntId, bool? IsVerified_City, bool? IsVerified_Country)
 {
     List<DJ_GroupConsumRecord> ListRecord = GetRecordByCondition(bengintime, endtime, EntName, type, EntId, IsVerified_City, IsVerified_Country).ToList();
     //过滤掉有相同团队的记录
     List<DJ_GroupConsumRecord> List = new List<DJ_GroupConsumRecord>();
     foreach (DJ_GroupConsumRecord item in ListRecord)
     {
         if (List.Where(x => x.Route.DJ_TourGroup.Id == item.Route.DJ_TourGroup.Id).Where(x => x.ConsumeTime.ToShortDateString() == item.ConsumeTime.ToShortDateString()).Where(x=>x.Enterprise.Id==item.Enterprise.Id).Count() == 0)
         {
             List.Add(item);
         }
     }
     List<DJ_TourEnterprise> ListTE = new List<DJ_TourEnterprise>();
     foreach (IGrouping<DJ_TourEnterprise, DJ_GroupConsumRecord> item in List.GroupBy(x => x.Enterprise).ToList())
     {
         ListTE.Add(item.Key);
     }
     return ListTE;
 }
Beispiel #3
0
 public void GetCountInfoByETid(int etid, out int groupcount, out int adultcount, out int childrencount, List<DJ_GroupConsumRecord> Listrecord)
 {
     adultcount = 0;
     childrencount = 0;
     groupcount = Listrecord.GroupBy(x => x.Route.DJ_TourGroup.Id).Count();
     foreach (DJ_GroupConsumRecord record in Listrecord)
     {
         adultcount += record.AdultsAmount;
         childrencount += record.ChildrenAmount;
     }
 }
        /// <summary>
        /// 验证是否有重复项
        /// </summary>
        protected void ValidateJudge()
        {
            if (!IsValidated)
            {
               MessageBoxEx.ShowWarning("在增加新数据之前,需要先将之前出现的错误操作给修订");
               return;
            }
            DataGridViewRowCollection ds = dgvWareHouseList.Rows;

            List<DataGridViewRow> list = new List<DataGridViewRow>();
            foreach (DataGridViewRow item in ds)
            {
                list.Add(item);
            }
            var ak47 = list.GroupBy(q => q.Cells[0].Value).Where(s => s.Count() > 1).Select(v => v);
            if (ak47.Count()>0)
            {
                //只要有一行相等就退出
                MessageBoxEx.ShowError("新增加的“货位编号”已经和“在此之前”添加的“货物编号”重复!");
                IsValidated = false;
            }
        }
        /// <summary>
        /// 验证是否有重复项
        /// </summary>
        protected bool ValidateJudge()
        {
            DataGridViewRowCollection ds = dgvWareHouseList.Rows;

            List<DataGridViewRow> list = new List<DataGridViewRow>();
            foreach (DataGridViewRow item in ds)
            {
                list.Add(item);
            }
            var ak47 = list.GroupBy(q => q.Cells[0].Value).Where(s => s.Count() > 1).Select(v => v);
            if (ak47.Count() > 0)
            {
                //只要有一行相等就退出
                MessageBoxEx.ShowError("新增加的“货位编号”重复!");


                int i = 0;
                foreach (var item in ak47)
                {
                    List<DataGridViewRow> ColorRow = list.FindAll((V) =>
                         {
                             return V.Cells[0].Value.Equals(item.Key.ToString());
                         });
                    i++;
                    if (i == 1)
                    {
                        ColorRow.ForEach((U) =>
                        {
                            U.DefaultCellStyle.BackColor = Color.Lime;
                        });
                    }
                    if (i == 2)
                    {
                        ColorRow.ForEach((U) =>
                        {
                            U.DefaultCellStyle.BackColor = Color.Orange;
                        });
                    }
                    if (i == 3)
                    {
                        ColorRow.ForEach((U) =>
                        {
                            U.DefaultCellStyle.BackColor = Color.BlueViolet;
                        });
                    }

                }
                return false;
            }
            return true;
        }