public void BindTarget(int policyID) { IList <To_PolicyTarget> targetList = To_PolicyTargetManager.GetListByPolicy(policyID); if (targetList.Count > 0) { rpTargetProperty.DataSource = targetList; rpTargetProperty.DataBind(); TargetTypeManager tpBLL = new TargetTypeManager(); TargetType tpModel = tpBLL.GetModel(targetList[0].PropertyTypeID); if (tpModel != null) { ltrTargetType.Text = tpModel.TypeName; } } }
private int?GetTargetType(string proTypeID) { TargetTypeManager targetType = new TargetTypeManager(); ProductTypeManager proTypeBLL = new ProductTypeManager(); ProductType proTypeModel = proTypeBLL.GetModel(proTypeID); if (proTypeModel != null) { TargetType tgModel = targetType.GetModel(Convert.ToInt32(proTypeModel.TargetTypeId)); if (tgModel != null) { ltrTargetType.Text = tgModel.TypeName; } return(proTypeModel.TargetTypeId); } else { return(null); } }
/// <summary> /// 初始化数据 /// </summary> /// <param name="typeId"></param> /// <param name="targetId"></param> private void InitData() { object typeId = Request.QueryString["typeid"]; //标的种类编号 object targetId = Request.QueryString["targetid"]; object action = Request.QueryString["action"]; TargetProperty targetModel = new TargetProperty(); TargetPropertyManager targetBLL = new TargetPropertyManager(); targetModel = targetBLL.GetModel(Convert.ToInt32(typeId), Convert.ToInt32(targetId)); if (typeId == null || action == null || typeId.ToString() == string.Empty || action.ToString() == string.Empty) { return; } if (action.ToString() == "edit" && targetId != null && targetId.ToString() != string.Empty) { txtName.Text = targetModel.PropertyName; txtNum.Text = targetModel.PropertyNO; if (targetModel.MainFlag != null) { if (targetModel.MainFlag == true) { chkMain.SelectedIndex = 0; } else { chkMain.SelectedIndex = 1; } } if (targetModel.IsRequired != null) { this.isrequired.Checked = (bool)targetModel.IsRequired; } else { this.isrequired.Checked = false; } //根据数据类型设定选中项(0:文字描述;3:是非判断;5:日期;9:多选一) ListItem item = rdoDataType.Items.FindByValue(targetModel.PropertyType.ToString()); item.Selected = true; ListItem selItem = rdoDataType.Items.FindByValue("9"); if (targetModel.PropertyType == 9) { selItem.Enabled = true; List <TargetEnum> enumModel = new List <TargetEnum>(); TargetEnumManager enumBLL = new TargetEnumManager(); enumModel = enumBLL.GetModelList(string.Format("EnumTypeId={0}", targetModel.EnumTypeId)); if (enumModel.Count > 0) { foreach (TargetEnum enumItem in enumModel) { LtlEnum.Text += string.Format("<tr><td><input class='tbxprocess' value='{0}' type='text' /></td><td><img class='add imgBtn' onclick='addRow()' alt='添加一行' src='Image/add.png' /></td></tr>", enumItem.EnumValue); } } else { LtlEnum.Text = "<tr><td><input class='tbxprocess' type='text' /></td><td><img class='add imgBtn' onclick='addRow()' alt='添加一行' src='Image/add.png' /><img class='delete imgBtn' onclick='delRow(this)' alt='删除' src='Image/backto.png' /></td></tr>"; } this.HidShow.Value = "true"; } else { selItem.Enabled = false; this.HidShow.Value = "false"; } rdoDataType.Items.FindByValue("0").Enabled = rdoDataType.Items.FindByValue("3").Enabled = rdoDataType.Items.FindByValue("5").Enabled = !selItem.Enabled; } //自动生成标的编号 else if (action.ToString() == "new") { StringBuilder num = new StringBuilder(); TargetTypeManager typeBll = new TargetTypeManager(); TargetType type = typeBll.GetModel(Convert.ToInt32(typeId)); for (int i = 1; i < 100; i++) { num.Append(type.TypeNo); if (i.ToString().Length == 1) { num.Append("0"); } num.Append(i.ToString()); if (!ExitsNum(num.ToString())) { break; } else { num.Clear(); } } txtNum.Text = num.ToString(); LtlEnum.Text = "<tr><td><input class='tbxprocess' type='text' /></td><td><img class='add imgBtn' onclick='addRow()' alt='添加一行' src='Image/add.png' /><img class='delete imgBtn' onclick='delRow(this)' alt='删除' src='Image/backto.png' /></td></tr>"; } }
private string GetNum(int id) { TargetTypeManager targetType = new TargetTypeManager(); return(targetType.GetModel(id).TypeNo); }