protected void BindRuleInfo(int ID) { ExtendBLL.Rule rule = new ExtendBLL.Rule(); DataSet ds = new DataSet(); ds = rule.GetList("[ID]=" + ID); labFileNum.Text = ds.Tables[0].Rows[0]["Rule_CodeNum"].ToString(); LabTitle.Text = ds.Tables[0].Rows[0]["Rule_Title"].ToString(); LabComent.Text = ds.Tables[0].Rows[0]["Rule_Content"].ToString(); LabDanWei.Text = ds.Tables[0].Rows[0]["Rule_OutputUnit"].ToString(); }
//�жϹ����ƶ��ĺ��Ƿ��Ѵ��� protected bool IsCode(string code) { ExtendBLL.Rule rule = new ExtendBLL.Rule(); DataSet ds = new DataSet(); if (ViewState["ID"] != null) { ds = rule.GetList(" Rule_CodeNum='" + code + "' and [ID]<>" + int.Parse(ViewState["ID"].ToString())); } else { ds = rule.GetList("Rule_CodeNum='" + code + "'"); } if (ds.Tables[0].Rows.Count== 0) { return false; } else { return true; } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("GZZD"); if (UserType == "student" || UserType == "teacher") { modifybtn.Visible = false; DeleteBtn.Visible = false; } if (Request.QueryString["ID"] != null) { if (!IsPostBack) { int ID; string strID = Request.QueryString["ID"].ToString(); if (int.TryParse(strID, out ID)) { IDHF.Value = ID.ToString(); ExtendBLL.Rule rule = new ExtendBLL.Rule(); DataSet ds = new DataSet(); ds = rule.GetList("[ID]=" + ID); CodeNumLbl.Text = ds.Tables[0].Rows[0]["Rule_CodeNum"].ToString(); TitleLbl.Text = ds.Tables[0].Rows[0]["Rule_Title"].ToString(); SubTitleLbl.Text = ds.Tables[0].Rows[0]["Rule_SubTitle"].ToString(); KeyLbl.Text = ds.Tables[0].Rows[0]["Rule_KeyWord"].ToString(); OutputUnitLbl.Text = ds.Tables[0].Rows[0]["Rule_OutputUnit"].ToString(); ResourceContentLbl.Text = ds.Tables[0].Rows[0]["Rule_Content"].ToString();//内容 ModifyDateLbl.Text = string.Format("{0:d}", ds.Tables[0].Rows[0]["Rule_Date"].ToString());//日期 List<LabMS.Model.Dictionary> dic = new List<LabMS.Model.Dictionary>(); //绑定数据字典 dic = DictionaryDropdownlist("118"); RuleKindDDL.DataSource = dic; RuleKindDDL.DataBind(); RuleKindDDL.SelectedValue = ds.Tables[0].Rows[0]["Rule_Type"].ToString(); //绑定录入单位 LabDropdowlist(); InputUnitDDL.SelectedValue = ds.Tables[0].Rows[0]["Rule_InputUnit"].ToString(); //获取文件列表 string strHTML = ""; if (ds.Tables[0].Rows[0]["AttachmentID"].ToString() != "") { LabMS.BLL.AttachmentItem attIte = new LabMS.BLL.AttachmentItem(); List<LabMS.Model.AttachmentItem> attIteModelList = new List<LabMS.Model.AttachmentItem>(); attIteModelList = attIte.GetModelList("Attach_ID=" + int.Parse(ds.Tables[0].Rows[0]["AttachmentID"].ToString())); for (int i = 0; i < attIteModelList.Count; i++) { strHTML += "<a onclick='downloadfile(" + attIteModelList[i].ID + ")'>"; strHTML += attIteModelList[i].Item_Name; strHTML += "</a>"; strHTML += "<br/>"; } filehtml.InnerHtml = strHTML; } } else { ERRLbl.Text = "系统异常,ID值不合法!"; ERRLbl.Visible = true; modifybtn.Visible = false; DeleteBtn.Visible = false; } } } else { ERRLbl.Text = "系统异常,ID值不合法!"; ERRLbl.Visible = true; modifybtn.Visible = false; DeleteBtn.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("GZZD"); strPageUserType.Add("mana"); if (Request.QueryString["ID"] == null) { if (!IsPostBack) { List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>(); //���ƶȷ��� list = DictionaryDropdownlist("118"); RuleKindDDL.DataSource = list; RuleKindDDL.DataBind(); //��¼�뵥λ LabDropdowlist(); } } else { label1.Visible = false; label2.Visible = true; if (!IsPostBack) { int ID; string strID = Request.QueryString["ID"].ToString(); if (int.TryParse(strID, out ID)) { ViewState["ID"] = ID; ExtendBLL.Rule rule = new ExtendBLL.Rule(); DataSet ds = new DataSet(); ds = rule.GetList("[ID]=" + ID); CodeNumTBX.Text = ds.Tables[0].Rows[0]["Rule_CodeNum"].ToString(); TitleTBX.Text = ds.Tables[0].Rows[0]["Rule_Title"].ToString(); SubTitleTBX.Text = ds.Tables[0].Rows[0]["Rule_SubTitle"].ToString(); KeyTBX.Text = ds.Tables[0].Rows[0]["Rule_KeyWord"].ToString(); OutputUnitTBX.Text = ds.Tables[0].Rows[0]["Rule_OutputUnit"].ToString(); ResourceContent.Text = LabMS.Common.codehelper.Decode(ds.Tables[0].Rows[0]["Rule_Content"].ToString());//���� ModifyDateTBX.Text = string.Format("{0:d}", ds.Tables[0].Rows[0]["Rule_Date"].ToString());//���� List<LabMS.Model.Dictionary> dic = new List<LabMS.Model.Dictionary>(); //�������ֵ� dic = DictionaryDropdownlist("118"); RuleKindDDL.DataSource = dic; RuleKindDDL.DataBind(); RuleKindDDL.SelectedValue = ds.Tables[0].Rows[0]["Rule_Type"].ToString(); //��¼�뵥λ LabDropdowlist(); InputUnitDDL.SelectedValue = ds.Tables[0].Rows[0]["Rule_InputUnit"].ToString(); //��ȡ�ļ��б� string strHTML = ""; if (ds.Tables[0].Rows[0]["AttachmentID"].ToString() != "") { AttachIDHF.Value = ds.Tables[0].Rows[0]["AttachmentID"].ToString(); LabMS.BLL.AttachmentItem attIte = new LabMS.BLL.AttachmentItem(); List<LabMS.Model.AttachmentItem> attIteModelList = new List<LabMS.Model.AttachmentItem>(); attIteModelList = attIte.GetModelList("Attach_ID=" + int.Parse(ds.Tables[0].Rows[0]["AttachmentID"].ToString())); strHTML += "<table>"; for (int i = 0; i < attIteModelList.Count; i++) { strHTML += "<tr>"; strHTML += "<td style='display:none;'>"; strHTML += attIteModelList[i].ID; strHTML += "</td>"; strHTML += "<td>"; strHTML += "<a>"; strHTML += "ɾ��"; strHTML += "</a>"; strHTML += "</td>"; strHTML += "<td>"; strHTML += attIteModelList[i].Item_Name; strHTML += "</td>"; strHTML += "</tr>"; } strHTML += "</table>"; filehtml.Value = strHTML; } } else { SaveBtn.Visible = false; ERRLbl.Text = "ϵͳ�쳣��IDֵ���Ϸ���"; ERRLbl.Visible = true; } } } ModifyDateTBX.Attributes.Add("onclick", "c.showMoreDay = false;c.show(this);"); ModifyDateTBX.Attributes.Add("readOnly", "-1"); }