private void InitData() { ProductTypeManager proBLL = new ProductTypeManager(); EtNet_Models.ProductType proModel = new EtNet_Models.ProductType(); object id = Request.QueryString["id"]; if (id == null || id.ToString() == string.Empty) { return; } object action = Request.QueryString["action"]; if (action != null && action.ToString() == "MODIFY") { proModel = proBLL.GetModel(Request.QueryString["id"].ToString().Split('-')[0]); txtName.Text = proModel.ProdTypeName; SetDdlTargetSelectIndex(proModel.TargetTypeId.ToString()); SetDdlTypeSelectIndex(proModel.ProdClass); if (proBLL.GetModel(proModel.ParentId) != null) { txtParent.Text = proBLL.GetModel(proModel.ParentId).ProdTypeName; } } else if (action != null && action.ToString() == "ADD") { txtParent.Text = Request.QueryString["id"].ToString(); } }
/// <summary> /// 根据险种ID绑定右侧数据 /// </summary> /// <param name="prodTypeID"></param> private void ReadyProductData(string prodTypeID) { EtNet_Models.ProductType productTypeModel = new EtNet_Models.ProductType(); ProductTypeManager productTypeBLL = new ProductTypeManager(); productTypeModel = productTypeBLL.GetModel(prodTypeID); txtName.Text = productTypeModel.ProdTypeName; hidNum.Value = productTypeModel.ProdTypeNo; if (productTypeModel.ParentId.Trim() != "0") { StringBuilder parentName = new StringBuilder(); parentName.Append(GetParent(productTypeModel.ParentId).ProdTypeNo); parentName.Append("-"); parentName.Append(GetParent(productTypeModel.ParentId).ProdTypeName); txtParent.Text = parentName.ToString(); //lblParentNo.Text = GetParent(productTypeModel.ParentId).ProdTypeNo; } else { txtParent.Text = ""; //lblParentNo.Text = ""; } hidParent.Value = productTypeModel.ProdTypeNo + "-" + productTypeModel.ProdTypeName; SetDdlTargetSelectIndex(productTypeModel.TargetTypeId.ToString()); SetDdlTypeSelectIndex(productTypeModel.ProdClass); }
//修改险种 private void ModifyProType(string proID) { ProductTypeManager productTypeBLL = new ProductTypeManager(); EtNet_Models.ProductType productTypeModel = new EtNet_Models.ProductType(); productTypeModel = productTypeBLL.GetModel(proID); productTypeModel.ProdClass = ddlType.SelectedValue; productTypeModel.ProdTypeName = txtName.Text; productTypeModel.TargetTypeId = Convert.ToInt32(ddlTarget.SelectedValue); productTypeBLL.Update(productTypeModel); hidId.Value = "MODIFY" + "$" + productTypeModel.ProdTypeName; }
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="parentID"></param> /// <returns></returns> private EtNet_Models.ProductType GetParent(string parentID) { ProductTypeManager productTypeBLL = new ProductTypeManager(); return(productTypeBLL.GetModel(parentID)); }