//按名称搜索
 public void FindByName()
 {
     try
     {
         ViewState["page"] = 1;
         List <int> achieve = ach.FindByAchievementNamelist(tCondition.Text.Trim());
         List <Common.Entities.AchievementCA> list = ca.FindByAchievementName(achieve, Convert.ToInt32(Session["SecrecyLevel"])); Convert.ToInt32(Session["SecrecyLevel"]);
         Grid_AchievementCA.RecordCount = list.Count();
         if (list != null)
         {
             Grid_AchievementCA.DataSource = list.Skip(Grid_AchievementCA.PageIndex * Grid_AchievementCA.PageSize).Take(Grid_AchievementCA.PageSize);
             Grid_AchievementCA.DataBind();
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
 //按成果名称搜索
 public void FindByAchievementNmae()
 {
     try
     {
         ViewState["page"] = 1;
         List <int>             achieve = ach.FindByAchievementNamelist(tCondition.Text.Trim());
         List <AchivementApply> list    = applys.FindByAchievementName(achieve, Convert.ToInt32(Session["SecrecyLevel"]));
         Grid_AchieveApply.RecordCount = list.Count();
         if (list != null)
         {
             Grid_AchieveApply.DataSource = list.Skip(Grid_AchieveApply.PageIndex * Grid_AchieveApply.PageSize).Take(Grid_AchieveApply.PageSize);
             Grid_AchieveApply.DataBind();
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
Exemple #3
0
        //初始化所属成果名称
        public void InitAchievement()
        {
            try
            {
                BLHelper.BLLAchievement            achevement = new BLHelper.BLLAchievement();
                List <Common.Entities.Achievement> list       = achevement.FindAllAchievementName();
                int id = 0;
                List <Common.Entities.Patent> listA = patent.FindAll(Convert.ToInt32(Session["PatentID"]));
                Common.Entities.Patent        pa    = listA.FirstOrDefault();
                for (int i = 0; i < list.Count(); i++)
                {
                    tAchievement.Items.Add(list[i].AchievementName.ToString(), list[i].AchievementID.ToString());
                    if (pa.AchievementID != null)
                    {
                        if (achevement.FindByAchievementName(pa.AchievementID) != 0)
                        {
                            id = -1;
                        }
                    }
                }

                if (pa.AchievementID != null && id == 0)
                {
                    //tAchievement.Text = ach.FindAchieveName(Convert.ToInt32(pa.AchievementID));
                    tAchievement.Items.Add(pa.AchievementID, pa.AchievementID);
                    tAchievement.SelectedValue = pa.AchievementID;
                }
                else if (pa.AchievementID != null && id != 0)
                {
                    tAchievement.SelectedValue = achevement.FindByAchievementNamelist(pa.AchievementID)[0].ToString();
                }
                else
                {
                    tAchievement.SelectedValue = list[0].AchievementID.ToString();
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }