protected void btnOk_Click(object sender, EventArgs e) { string str = ViewState["PostID"].ToString(); foreach (TreeViewNode node in tvTrainType.Nodes) { if (node.Checked == true) { TrainStandardBLL objTrainStandard = new TrainStandardBLL(); IList <RailExam.Model.TrainStandard> objTrainStandardList = objTrainStandard.GetTrainStandardInfo(0, Convert.ToInt32(str), Convert.ToInt32(node.Value), "", "", "", "", "", "", 0, 200, ""); if (objTrainStandardList.Count == 0) { RailExam.Model.TrainStandard obj = new RailExam.Model.TrainStandard(); obj.PostID = Convert.ToInt32(str); obj.TypeID = Convert.ToInt32(node.Value); obj.TrainTime = ""; obj.TrainContent = ""; obj.TrainForm = ""; obj.ExamForm = ""; obj.Description = ""; obj.Memo = ""; objTrainStandard.AddTrainStandard(obj); } } if (node.Nodes.Count > 0) { foreach (TreeViewNode childnode in node.Nodes) { if (childnode.Checked == true) { TrainStandardBLL objTrainStandard = new TrainStandardBLL(); IList <RailExam.Model.TrainStandard> objTrainStandardList = objTrainStandard.GetTrainStandardInfo(0, Convert.ToInt32(str), Convert.ToInt32(childnode.Value), "", "", "", "", "", "", 0, 200, ""); if (objTrainStandardList.Count == 0) { RailExam.Model.TrainStandard obj = new RailExam.Model.TrainStandard(); obj.PostID = Convert.ToInt32(str); obj.TypeID = Convert.ToInt32(childnode.Value); obj.TrainTime = ""; obj.TrainContent = ""; obj.TrainForm = ""; obj.ExamForm = ""; obj.Description = ""; obj.Memo = ""; objTrainStandard.AddTrainStandard(obj); } } } } } Response.Write("<script>window.opener.form1.Refresh.value='" + str + "' ;window.opener.form1.submit();window.close();</script>"); }
private void GetPost() { TrainStandardBLL objTrainStandardBll = new TrainStandardBLL(); RailExam.Model.TrainStandard objTrainStandard = objTrainStandardBll.GetTrainStandardInfo(Convert.ToInt32(ViewState["StandardID"].ToString())); ViewState["PostID"] = objTrainStandard.PostID; lblTitle1.Text = objTrainStandard.PostName + "岗位相关教材"; }
private void BindtvType(string str) { ViewState["PostID"] = str; TrainStandardBLL trainStandardBLL = new TrainStandardBLL(); TrainTypeBLL trainTypeBLL = new TrainTypeBLL(); IList <TrainType> trainTypeList = trainTypeBLL.GetTrainStandardTypeInfo(Convert.ToInt32(str), 1); if (trainTypeList.Count > 0) { TreeViewNode tvn = null; foreach (TrainType trainType in trainTypeList) { tvn = new TreeViewNode(); RailExam.Model.TrainStandard trainStandard = new RailExam.Model.TrainStandard(); trainStandard = trainStandardBLL.GetTrainStandardInfo(Convert.ToInt32(ViewState["PostID"].ToString()), trainType.TrainTypeID); int nStandardID = trainStandard.TrainStandardID; tvn.ID = nStandardID.ToString(); tvn.Value = nStandardID.ToString(); tvn.Text = trainType.TypeName; tvn.ToolTip = trainType.TypeName; if (trainType.ParentID == 0) { tvTrainType.Nodes.Add(tvn); } else { try { trainStandard = trainStandardBLL.GetTrainStandardInfo(Convert.ToInt32(ViewState["PostID"].ToString()), trainType.ParentID); int nParentStandardID = trainStandard.TrainStandardID; tvTrainType.FindNodeById(nParentStandardID.ToString()).Nodes.Add(tvn); } catch { tvTrainType.Nodes.Clear(); Response.Write("数据错误!"); return; } } } } tvTrainType.DataBind(); tvTrainType.ExpandAll(); }
private void AddImplateType(ArrayList objList) { tvTrainType.Nodes.Clear(); TrainTypeBLL trainTypeBLL = new TrainTypeBLL(); IList <TrainType> trainTypeList = trainTypeBLL.GetTrainTypeInfo(0, 0, 0, "", 0, "", "", true, false, "", 0, 200, "LevelNum,OrderIndex ASC"); if (trainTypeList.Count > 0) { foreach (TrainType trainType in trainTypeList) { if (objList.Count > 0) { if (objList.IndexOf(trainType.TrainTypeID) != -1) { continue; } } TrainStandardBLL trainStandardBLL = new TrainStandardBLL(); RailExam.Model.TrainStandard trainStandard = new RailExam.Model.TrainStandard(); trainStandard.PostID = Convert.ToInt32(ViewState["PostID"].ToString()); trainStandard.TypeID = Convert.ToInt32(trainType.TrainTypeID); trainStandard.TrainTime = ""; trainStandard.TrainContent = ""; trainStandard.TrainForm = ""; trainStandard.ExamForm = ""; trainStandard.Description = ""; trainStandard.Memo = ""; trainStandardBLL.AddTrainStandard(trainStandard); } } BindtvType(ViewState["PostID"].ToString()); }