예제 #1
0
        /// <summary>
        /// 暂时直接保存分词
        /// </summary>
        /// <param name="model"></param>
        public void UpdateParticiple(InstitutionModel model)
        {
            var count =
                DbContext.Database.SqlQuery<Guid>(string.Format("select Id from [Participle] where ObjectId='{0}'",
                    model.Id)).ToList();
            if (count.Any())
            {
                DbContext.Database.ExecuteSqlCommand(string.Format("update [Participle]  set Words='{0}' where ObjectId='{1}'",
                    model.Words, model.Id));
            }
            else
            {
                DbContext.Database.ExecuteSqlCommand(
                    string.Format("INSERT INTO [Participle] values(NEWID(),'{0}','{1}')" ,model.Id, model.Words));
            }

        }
예제 #2
0
 /// <summary>
 /// 主数据选择行
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView1_Click(object sender, EventArgs e)
 {
     var view = (GridView)sender;
     var pt = view.GridControl.PointToClient(MousePosition);
     var info = view.CalcHitInfo(pt);
     if (info.InRow || info.InRowCell)
     {
         //数据源中的Index
         var itemId = view.GetRowCellValue(info.RowHandle, "Id") as Guid?;
         SelectedInstitutionModel = InstitutionModels.FirstOrDefault(n => n.Id == itemId);
         gridControl2.DataSource = Place.Where(n => n.ItemId == itemId).ToArray();
     }
 }