//初始化所属成果名称 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); } }
//初始化 public void InitData() { try { List <Common.Entities.Patent> list = patent.FindAll(Convert.ToInt32(Session["PatentID"])); Common.Entities.Patent pa = list.FirstOrDefault(); tAccreditTime.SelectedDate = pa.AccreditTime; tApplicationTime.SelectedDate = pa.ApplicationTime; tCertificateNumber.Text = pa.CertificateNumber; if (pa.Comment != null) { tRemark.Text = pa.Comment; } else { tRemark.Text = ""; } DropDownListAgency.SelectedValue = pa.AgencyID; //Fund.Text = pa.Fund; FirstPeople.Text = pa.FirstPeople; dPatentCondition.SelectedValue = pa.PatentCondition; //ApplyNum.Text = pa.ApplyNum; //pa.EntryPerson = Session["LoginName"].ToString(); tGivenUnit.Text = pa.GivenUnit; dPatentForm.SelectedValue = pa.PatentForm; tPatentName.Text = pa.PatentName; tPatentNumber.Text = pa.PatentNumber; //if (pa.SecrecyLevel == 1) //{ // tSecrecyLevel.Text = "公开"; //} //if (pa.SecrecyLevel == 3) //{ // tSecrecyLevel.Text = "秘密"; //} drSecrecyLevel.SelectedIndex = Convert.ToInt32(pa.SecrecyLevel - 1); tState.Text = pa.State; PatentPeople.Text = pa.PatentPeople; //PatentMember.Text = pa.Member; if (pa.PatentDepartment != null) { List <string> res = new List <string>(); string[] str = pa.PatentDepartment.Split(','); foreach (string ss in str) { res.Add(ss); } switch (res.Count) { case 1: tPatentDepartment1.Text = res[0]; break; case 2: tPatentDepartment1.Text = res[0]; tPatentDepartment2.Text = res[1]; break; case 3: tPatentDepartment1.Text = res[0]; tPatentDepartment2.Text = res[1]; tPatentDepartment3.Text = res[2]; break; } } else { tPatentDepartment1.Text = ""; tPatentDepartment2.Text = ""; tPatentDepartment3.Text = ""; } //lby ↓ tPatentAuthorization.Text = pa.PatentAuthorization.ToString(); tPatentCertificate.Text = pa.PatentCertificate.ToString(); } catch (Exception ex) { pm.SaveError(ex, this.Request); } }