protected void Button1_Click(object sender, EventArgs e) { _user = user.Text.ToString(); string _password = passwrod.Text.ToString(); string jiamipassword = System.Encryption.MD5.MDString(_password); if (cookie_password != "" && _password == cookie_password) { jiamipassword = _password; } ResultDataSet Rs = new ResultDataSet(); string strSQL = "select user_name,role_id,group_id from dt_manager where user_name='" + _user + "' and password='******' and is_lock='0'"; db.DB2Obj.GetRs(strSQL, out Rs); if (Rs.RowCount > 0) { Session["user_name"] = Rs[0, "user_name"].ToString(); Session["role_id"] = Rs[0, "role_id"].ToString(); Session["group_id"] = Rs[0, "group_id"].ToString(); if (Request.Form["remember"] != null) { Utils.WriteCookie("password123", jiamipassword, 720); } else { Utils.WriteCookie("password123", jiamipassword, -1); } //写入Cookies Utils.WriteCookie("DTRememberName", _user, 14400); //更新微信数据库 updateWeChatUsers(); Response.Redirect("InfoAdd.aspx"); } else { ResultDataSet Rs2 = new ResultDataSet(); string strSQL2 = "select UserName,UserId from Users where UserId='" + _user + "' and Password ='******'"; db.DBObj.GetRs(strSQL2, out Rs2); if (Rs2.RowCount > 0) { string _OARole = ConfigurationManager.AppSettings["OARole"].ToString(); Session["user_name"] = Rs2[0, "UserId"].ToString(); Session["role_id"] = _OARole; Session["group_id"] = Rs2[0, "UserId"].ToString(); if (Request.Form["remember"] != null) { Utils.WriteCookie("password123", jiamipassword, 720); } else { Utils.WriteCookie("password123", jiamipassword, -1); } //写入Cookies Utils.WriteCookie("DTRememberName", _user, 14400); updateWeChatUsers(); Response.Redirect("InfoAdd.aspx"); } else { Response.Write("<script>alert('用户名或密码错误!')</script>"); } } }
protected void Button1_Click(object sender, EventArgs e) { Button1.Attributes.Add("onclick", "this.value='正在提交中,请稍等……';this.disabled=true;" + this.GetPostBackEventReference(Button1) + ";"); string _title = title.Text.ToString(); string _number = number.Text.ToString(); int _dp_priority = Convert.ToInt32(dp_priority.SelectedValue); string _txtImgUrl = "", _img_url = ""; HttpPostedFile _upfile = FileUpload1.PostedFile; if (FileUpload1.HasFile == true) { UpLoad upFiles = new UpLoad(); _txtImgUrl = upFiles.fileSaveAs(_upfile, false, false); _img_url = _txtImgUrl.Substring(2); string userAgent = Request.UserAgent; if (userAgent.ToLower().Contains("micromessenger")) { _img_url += ".jpg"; } } string _name = name.Text.ToString(); string _tel = tel.Text.ToString(); string _address = address.Text.ToString(); string _details = details.Text.ToString(); string _username = Session["user_name"].ToString(); string group_id = Session["group_id"].ToString(); int _state = 0; string _add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string _type = type.SelectedItem.Value; string _OADeptID = null; string tbAssinger = null; string _assets = null; string _ddpAddress = dp_dress.SelectedValue; string _floor = getDDPAddress(); if (String.IsNullOrEmpty(_title) || String.IsNullOrEmpty(_name) || String.IsNullOrEmpty(_tel) || String.IsNullOrEmpty(_address) || String.IsNullOrEmpty(_details) || _type == "0" || String.IsNullOrEmpty(_ddpAddress)) { //JscriptMsg("haha", "content.aspx", "Success");$.dialog.alert('标题不能为空!'); //Response.Write("<script>$.dialog.alert('提交失败,请填写完整!');</script>"); ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>SetUIStyle();</script>"); } else { //判断选哪个类别 string ddpItem = ddp_item.Items.Count.ToString(); string ddpItemChild = ddp_item_child.Items.Count.ToString(); if (ddpItem != "1" && ddp_item.SelectedValue != "0") { _type = ddp_item.SelectedItem.Value; if (ddpItemChild != "1" && ddp_item_child.SelectedValue != "0") { _type = ddp_item_child.SelectedItem.Value; } } //OA用户登录的情况 if (_username == group_id) { _OADeptID = getOADeptID(_username); } else { _OADeptID = group_id; } group_id = getGroupID(_type); //判断是否有指定人 if (!String.IsNullOrEmpty(TbAssinger.Text.ToString().Trim())) { tbAssinger = TbAssinger.Text.ToString().Trim(); } //判断固定资产号是否为空 if (!String.IsNullOrEmpty(assets.Text.ToString().Trim())) { _assets = assets.Text.ToString().Trim(); } ResultDataSet Rs2 = new ResultDataSet(); database_inte db2 = new database_inte(); string sql2 = "insert into dt_order (title,number,img_url,name,telephone,address,details,username,priority,state,add_time,type,group_id,AppointUser,deptID,fixedAssets,floor,flevel) values ('" + _title + "','" + _number + "','" + _img_url + "','" + _name + "','" + _tel + "','" + _address + "','" + _details + "','" + _username + "','" + _dp_priority + "','" + _state + "','" + _add_time + "','" + _type + "','" + group_id + "','" + tbAssinger + "','" + _OADeptID + "','" + _assets + "','" + _floor + "','" + _ddpAddress + "') SELECT @@IDENTITY as ID"; if (db2.DB2Obj.GetRs(sql2, out Rs2)) { title.Text = ""; string _OrderId = ""; if (Rs2.RowCount > 0) { _OrderId = Rs2[0, "ID"].ToString(); } string _SmsUrl = ConfigurationManager.AppSettings["SmsUrl"].ToString(); RequestHelper.SendGet(string.Format("http://{0}/Handler/TestHandler.ashx?action=ProblemInfo&OrderId={1}", _SmsUrl, _OrderId)); Response.Write("<script>alert('恭喜您,提交成功啦!维保人员正在路上,请耐心等待!');window.location.href ='content.aspx'</script>"); //ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>SetUIStyle2();</script>"); } else { //Response.Write("<script>alert('提交失败,请稍后重试!');window.location.href ='content.aspx'</script>"); ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>SetUIStyle3();</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { hrmID = Request.QueryString["hrmID"]; if (!IsPostBack) { ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_Item where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { string[] normalItem1Array = Rs3[0, "normalItem1"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem1Array[0])) { Label1.Visible = false; TextBox1.Visible = false; } else { Label1.Text = normalItem1Array[0]; TextBox1.Text = getTextBoxContent(normalItem1Array[0]); } string[] normalItem2Array = Rs3[0, "normalItem2"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem2Array[0])) { Label2.Visible = false; TextBox2.Visible = false; } else { Label2.Text = normalItem2Array[0]; TextBox2.Text = getTextBoxContent(normalItem2Array[0]); } string[] normalItem3Array = Rs3[0, "normalItem3"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem3Array[0])) { Label3.Visible = false; TextBox3.Visible = false; } else { Label3.Text = normalItem3Array[0]; TextBox3.Text = getTextBoxContent(normalItem3Array[0]); } string[] normalItem4Array = Rs3[0, "normalItem4"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem4Array[0])) { Label4.Visible = false; TextBox4.Visible = false; } else { Label4.Text = normalItem4Array[0]; TextBox4.Text = getTextBoxContent(normalItem4Array[0]); } string[] normalItem5Array = Rs3[0, "normalItem5"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem5Array[0])) { Label5.Visible = false; TextBox5.Visible = false; } else { Label5.Text = normalItem5Array[0]; TextBox5.Text = getTextBoxContent(normalItem5Array[0]); } string[] normalItem6Array = Rs3[0, "normalItem6"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem6Array[0])) { Label6.Visible = false; TextBox6.Visible = false; } else { Label6.Text = normalItem6Array[0]; TextBox6.Text = getTextBoxContent(normalItem6Array[0]); } string[] normalItem7Array = Rs3[0, "normalItem7"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem7Array[0])) { Label7.Visible = false; TextBox7.Visible = false; } else { Label7.Text = normalItem7Array[0]; TextBox7.Text = getTextBoxContent(normalItem7Array[0]); } string[] normalItem8Array = Rs3[0, "normalItem8"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem8Array[0])) { Label8.Visible = false; TextBox8.Visible = false; } else { Label8.Text = normalItem8Array[0]; TextBox8.Text = getTextBoxContent(normalItem8Array[0]); } string[] normalItem9Array = Rs3[0, "normalItem9"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem9Array[0])) { Label9.Visible = false; TextBox9.Visible = false; } else { Label9.Text = normalItem9Array[0]; TextBox9.Text = getTextBoxContent(normalItem9Array[0]); } string[] normalItem10Array = Rs3[0, "normalItem10"].ToString().Split('&'); if (String.IsNullOrEmpty(normalItem10Array[0])) { Label10.Visible = false; TextBox10.Visible = false; } else { Label10.Text = normalItem10Array[0]; TextBox10.Text = getTextBoxContent(normalItem10Array[0]); } } } }
protected void Page_Load(object sender, EventArgs e) { string _filename = "", _filepath = ""; id_version = Request.QueryString["id_version"]; id = Convert.ToInt32(Request["id"]); if (String.IsNullOrEmpty(id_version)) { string strSQL = "select * from FileInfo where id=" + id; ResultDataSet Rs = new ResultDataSet(); database_inte db = new database_inte(); db.DB2Obj.GetRs(strSQL, out Rs); if (Rs.RowCount > 0) { _filename = Rs[0, "fileName"].ToString(); _filepath = Rs[0, "filePath"].ToString(); } if (System.IO.File.Exists(MapPath(_filepath))) { Response.Clear(); Response.Buffer = true; Response.AddHeader("Content-Disposition", "attachment;filename=" + _filename); Response.ContentType = "application/unknow"; Response.TransmitFile(_filepath); Response.End(); } else { Response.Write("<script>alert('原文件已被删除!');window.location.href ='category_list.aspx'</script>"); Response.End(); } } else { string strSQL = "select * from FileInfoChild where id='" + id_version + "'"; ResultDataSet Rs = new ResultDataSet(); database_inte db = new database_inte(); db.DB2Obj.GetRs(strSQL, out Rs); if (Rs.RowCount > 0) { _filename = Rs[0, "fileName"].ToString(); _filepath = Rs[0, "filePath"].ToString(); } if (System.IO.File.Exists(MapPath(_filepath))) { Response.Clear(); Response.Buffer = true; Response.AddHeader("Content-Disposition", "attachment;filename=" + _filename); Response.ContentType = "application/unknow"; Response.TransmitFile(_filepath); Response.End(); } else { Response.Write("<script>alert('原文件已被删除!');window.location.href ='category_list.aspx'</script>"); Response.End(); } } }
protected void Button1_Click(object sender, EventArgs e) { string _s1 = getRadioButtonValue(RB1, TB1); string _s2 = getRadioButtonValue(RB2, TB21, TB22); string _s3 = getRadioButtonValue(RB3, TB31, TB32, TB33); string _s4 = getRadioButtonValue(RB4, TB41, TB42); string _s5 = getRadioButtonValue(RB5, TB51, TB52, TB53); string _s6 = getRadioButtonValue(RB6, TB61, TB62, TB63); string _s7 = getRadioButtonValue(RB7, TB71, TB72, TB73); string _s8 = getRadioButtonValue(RB8, TB81, TB82); string _s10 = getRadioButtonValue(RB10, TB10); string _s11 = getRadioButtonValue(RB11, TB11); string _s12 = getRadioButtonValue(RB12, TB12); string _s13 = getRadioButtonValue(RB13, TB13); string _s14 = getRadioButtonValue(RB14, TB14); string _s15 = getRadioButtonValue(RB15, TB15); string _s16 = getRadioButtonValue(RB16, TB16); string _s17 = getRadioButtonValue(RB17, TB17); string _s18 = getRadioButtonValue(RB18, TB18); string _s19 = getRadioButtonValue(RB19, TB19); string _s20 = getRadioButtonValue(RB20, TB20, TB30); string _s30 = getRadioButtonValue(RB30, TBS1, TBS2); string _s40 = getRadioButtonValue(RB40, TBS3, TBS4); string _s50 = getRadioButtonValue(RB50); string _mark = mark.Text.ToString(); string _add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_First where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { string sql2 = "UPDATE [dbo].[Doctor_First]" + " SET [UserId] = '" + hrmID + "'" + " ,[add_time] = '" + _add_time + "'" + " ,[tb1] = '" + _s1 + "'" + " ,[tb2] = '" + _s2 + "'" + " ,[tb3] = '" + _s3 + "'" + " ,[tb4] = '" + _s4 + "'" + " ,[tb5] = '" + _s5 + "'" + " ,[tb6] = '" + _s6 + "'" + " ,[tb7] = '" + _s7 + "'" + " ,[tb8] = '" + _s8 + "'" + " ,[rb1] = '" + _s10 + "'" + " ,[rb2] = '" + _s11 + "'" + " ,[rb3] = '" + _s12 + "'" + " ,[rb4] = '" + _s13 + "'" + " ,[rb5] = '" + _s14 + "'" + " ,[rb6] = '" + _s15 + "'" + " ,[rb7] = '" + _s16 + "'" + " ,[rb8] = '" + _s17 + "'" + " ,[rb9] = '" + _s18 + "'" + " ,[rb10] = '" + _s19 + "'" + " ,[pass1] = '" + _s20 + "'" + " ,[pass2] = '" + _s30 + "'" + " ,[pass3] = '" + _s40 + "'" + " ,[rb11] = '" + _s50 + "'" + " ,[mark] = '" + _mark + "'" + " WHERE [UserId]='" + hrmID + "'"; if (db.DBObj.Exec(sql2)) { Response.Write("<script>javascript:alert( '修改成功');window.location='Doctor2.aspx?hrmID=" + hrmID + "'</script>"); } } else { string sql = "INSERT INTO [dbo].[Doctor_First] ([UserId],[add_time],[tb1],[tb2],[tb3],[tb4],[tb5],[tb6],[tb7],[tb8],[rb1],[rb2],[rb3],[rb4],[rb5],[rb6],[rb7],[rb8],[rb9],[rb10],[pass1],[pass2],[pass3],[rb11],[mark])" + " VALUES ('" + hrmID + "','" + _add_time + "','" + _s1 + "','" + _s2 + "','" + _s3 + "','" + _s4 + "','" + _s5 + "','" + _s6 + "','" + _s7 + "','" + _s8 + "'" + " ,'" + _s10 + "','" + _s11 + "','" + _s12 + "','" + _s13 + "','" + _s14 + "','" + _s15 + "','" + _s16 + "','" + _s17 + "','" + _s18 + "','" + _s19 + "'" + " ,'" + _s20 + "','" + _s30 + "','" + _s40 + "','" + _s50 + "','" + _mark + "')"; if (db.DBObj.Exec(sql)) { Response.Write("<script>javascript:alert( '保存成功');window.location='Doctor2.aspx?hrmID=" + hrmID + "'</script>"); } } }
public String[] GetCompleteDepart(string prefixText, int count) { DrugInfo drugInfo = new DrugInfo(); ///检测参数是否为空 if (string.IsNullOrEmpty(prefixText) == true || count <= 0) { return(null); } // 如果数组为空 if (autoCompleteWordList == null) { //string sql = "select top 10.药品名称 from DrugInfo where 药品名称 like'" + prefixText + "%'"; //ResultDataSet Rs = new ResultDataSet(); //db.DB4Obj.GetRs(sql, out Rs); ResultDataSet Rs = drugInfo.GetList(prefixText); ResultDataSet Rs2 = drugInfo.GetList_C(prefixText); string[] temp = null; if (Rs.RowCount > 0 || Rs2.RowCount > 0) { DataSet ds = ((DataSet)Rs); DataSet ds2 = ((DataSet)Rs2); ds.Merge(ds2); //读取数据库的内容 //OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Ex18_02.mdb")); //conn.Open(); //OleDbDataAdapter da = new OleDbDataAdapter("select keyName from keyInfo where keyName like'" + prefixText + "%' order by keyName", conn); //DataSet ds = new DataSet(); //da.Fill(ds); //读取内容文件的数据到临时数组 temp = new string[ds.Tables[0].Rows.Count]; int i = 0; foreach (DataRow dr in ds.Tables[0].Rows) { temp[i] = dr["药品名称"].ToString(); i++; } Array.Sort(temp, new CaseInsensitiveComparer()); //将临时数组的内容赋给返回数组 autoCompleteWordList = temp; //if (conn.State == ConnectionState.Open) // conn.Close(); } //中药 //ResultDataSet Rs2 = drugInfo.GetList_C(prefixText); //string[] temp2 = null; //if (Rs2.RowCount > 0) //{ // DataSet ds2 = ((DataSet)Rs2); // temp2 = new string[ds2.Tables[0].Rows.Count]; // int j = 0; // foreach (DataRow dr in ds2.Tables[0].Rows) // { // temp2[j] = dr["药品名称"].ToString(); // j++; // } // Array.Sort(temp2, new CaseInsensitiveComparer()); //} //string[] s3 = new string[temp.Length + temp2.Length]; //Array.Copy(temp, 0, s3, 0, temp.Length); //Array.Copy(temp2, 0, s3, temp.Length, temp2.Length); //autoCompleteWordList = s3; } //定位二叉树搜索的起点 int index = Array.BinarySearch(autoCompleteWordList, prefixText, new CaseInsensitiveComparer()); if (index < 0) { //修正起点 index = ~index; } //搜索符合条件的数据 int matchCount = 0; for (matchCount = 0; matchCount < count && matchCount + index < autoCompleteWordList.Length; matchCount++) { ///查看开头字符串相同的项 if (autoCompleteWordList[index + matchCount].StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) == false) { break; } } //处理搜索结果 string[] matchResultList = new string[matchCount]; if (matchCount > 0) { //复制搜索结果 Array.Copy(autoCompleteWordList, index, matchResultList, 0, matchCount); } return(matchResultList); }
protected void Button1_Click(object sender, EventArgs e) { string _cb = CheckBox1.Checked ? "1" : "0"; string _name = TB1.Text.ToString(); string _rb1 = setValue(RB1) + "&" + setValue(RB2); string _rb2 = TB2.Text.ToString() + "&" + setValue(RB3); string _rb3 = TB3.Text.ToString() + "&" + setValue(RB4); string _rb4 = setValue(RadioButtonList5); string _rb5 = TB4.Text.ToString() + "&" + TB5.Text.ToString() + "&" + setValue(RB5); string _rb6 = TB6.Text.ToString() + "&" + TB7.Text.ToString() + "&" + setValue(RB6); string _tb18 = TB18.Text.ToString() + "&" + setValue(RB18); string _tb19 = TB19.Text.ToString() + "&" + setValue(RB19); string _tb20 = TB20.Text.ToString() + "&" + setValue(RB20); string _tb21 = TB21.Text.ToString() + "&" + setValue(RB21); string _tb22 = TB22.Text.ToString() + "&" + setValue(RB22); string _tb23 = TB23.Text.ToString() + "&" + setValue(RB23); string _tb24 = setValue(RB24); string _mark = mark.Text.ToString(); string _add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_Special where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { string sql2 = "UPDATE [dbo].[Doctor_Special]" + " SET [UserId] ='" + hrmID + "'" + " ,[add_time] = '" + _add_time + "'" + " ,[cb] = '" + _cb + "'" + " ,[name] ='" + _name + "'" + " ,[rb1] = '" + _rb1 + "'" + " ,[rb2] ='" + _rb2 + "'" + " ,[rb3] = '" + _rb3 + "'" + " ,[rb4] = '" + _rb4 + "'" + " ,[rb5] = '" + _rb5 + "'" + " ,[rb6] = '" + _rb6 + "'" + " ,[tb18] = '" + _tb18 + "'" + " ,[tb19] = '" + _tb19 + "'" + " ,[tb20] ='" + _tb20 + "'" + " ,[tb21] = '" + _tb21 + "'" + " ,[tb22] = '" + _tb22 + "'" + " ,[tb23] = '" + _tb23 + "'" + " ,[tb24] = '" + _tb24 + "'" + " ,[mark] = '" + _mark + "'" + " WHERE UserId='" + hrmID + "'"; if (db.DBObj.Exec(sql2)) { Response.Write("<script>javascript:alert( '修改成功');window.location='Doctor3.aspx?hrmID=" + hrmID + "'</script>"); } } else { string sql = "INSERT INTO [dbo].[Doctor_Special] ([UserId],[add_time],[cb],[name],[rb1],[rb2],[rb3],[rb4],[rb5],[rb6],[tb18],[tb19],[tb20],[tb21],[tb22],[tb23],[tb24],[mark])" + " VALUES('" + hrmID + "','" + _add_time + "','" + _cb + "','" + _name + "'" + " ,'" + _rb1 + "','" + _rb2 + "','" + _rb3 + "','" + _rb4 + "','" + _rb5 + "','" + _rb6 + "'" + " ,'" + _tb18 + "','" + _tb19 + "','" + _tb20 + "','" + _tb21 + "','" + _tb22 + "','" + _tb23 + "','" + _tb24 + "','" + _mark + "')"; if (db.DBObj.Exec(sql)) { Response.Write("<script>javascript:alert( '保存成功');window.location='Doctor3.aspx?hrmID=" + hrmID + "'</script>"); } } }
protected void Button1_Click(object sender, EventArgs e) { string _sq1 = SQ1.Text.ToString(); string _cbs1 = CBS1.Checked ? "1" : "0"; string _cbq1 = CBQ1.Checked ? "1" : "0"; string _sq1cb = _sq1 + "&" + _cbs1 + "&" + _cbq1; string _sq2 = SQ2.Text.ToString(); string _cbs2 = CBS2.Checked ? "1" : "0"; string _cbq2 = CBQ2.Checked ? "1" : "0"; string _sq2cb = _sq2 + "&" + _cbs2 + "&" + _cbq2; string _sq3 = SQ3.Text.ToString(); string _cbs3 = CBS3.Checked ? "1" : "0"; string _cbq3 = CBQ3.Checked ? "1" : "0"; string _sq3cb = _sq3 + "&" + _cbs3 + "&" + _cbq3; string _sq4 = SQ4.Text.ToString(); string _cbs4 = CBS4.Checked ? "1" : "0"; string _cbq4 = CBQ4.Checked ? "1" : "0"; string _sq4cb = _sq4 + "&" + _cbs4 + "&" + _cbq4; string _sq5 = SQ5.Text.ToString(); string _cbs5 = CBS5.Checked ? "1" : "0"; string _cbq5 = CBQ5.Checked ? "1" : "0"; string _sq5cb = _sq5 + "&" + _cbs5 + "&" + _cbq5; string _sq6 = SQ6.Text.ToString(); string _cbs6 = CBS6.Checked ? "1" : "0"; string _cbq6 = CBQ6.Checked ? "1" : "0"; string _sq6cb = _sq6 + "&" + _cbs6 + "&" + _cbq6; string _sq7 = SQ7.Text.ToString(); string _cbs7 = CBS7.Checked ? "1" : "0"; string _cbq7 = CBQ7.Checked ? "1" : "0"; string _sq7cb = _sq7 + "&" + _cbs7 + "&" + _cbq7; string _sq8 = SQ8.Text.ToString(); string _cbs8 = CBS8.Checked ? "1" : "0"; string _cbq8 = CBQ8.Checked ? "1" : "0"; string _sq8cb = _sq8 + "&" + _cbs8 + "&" + _cbq8; string _sq9 = SQ9.Text.ToString(); string _cbs9 = CBS9.Checked ? "1" : "0"; string _cbq9 = CBQ9.Checked ? "1" : "0"; string _sq9cb = _sq9 + "&" + _cbs9 + "&" + _cbq9; string _sq10 = SQ10.Text.ToString(); string _cbs10 = CBS10.Checked ? "1" : "0"; string _cbq10 = CBQ10.Checked ? "1" : "0"; string _sq10cb = _sq10 + "&" + _cbs10 + "&" + _cbq10; string _sq11 = SQ11.Text.ToString(); string _cbs11 = CBS11.Checked ? "1" : "0"; string _cbq11 = CBQ11.Checked ? "1" : "0"; string _sq11cb = _sq11 + "&" + _cbs11 + "&" + _cbq11; string _tp1 = TB1.Text.ToString(); string _cb1 = CB1.Checked ? "1" : "0"; string _cb11 = CB11.Checked ? "1" : "0"; string _tssq1 = _tp1 + "&" + _cb1 + "&" + _cb11; string _tp2 = TB2.Text.ToString(); string _cb2 = CB2.Checked ? "1" : "0"; string _cb12 = CB12.Checked ? "1" : "0"; string _tssq2 = _tp2 + "&" + _cb2 + "&" + _cb12; string _tp3 = TB3.Text.ToString(); string _cb3 = CB3.Checked ? "1" : "0"; string _cb13 = CB13.Checked ? "1" : "0"; string _tssq3 = _tp3 + "&" + _cb3 + "&" + _cb13; string _tp4 = TB4.Text.ToString(); string _cb4 = CB4.Checked ? "1" : "0"; string _cb14 = CB14.Checked ? "1" : "0"; string _tssq4 = _tp4 + "&" + _cb4 + "&" + _cb14; string _tp5 = TB5.Text.ToString(); string _cb5 = CB5.Checked ? "1" : "0"; string _cb15 = CB15.Checked ? "1" : "0"; string _tssq5 = _tp5 + "&" + _cb5 + "&" + _cb15; string _tp6 = TB6.Text.ToString(); string _cb6 = CB6.Checked ? "1" : "0"; string _cb16 = CB16.Checked ? "1" : "0"; string _tssq6 = _tp6 + "&" + _cb6 + "&" + _cb16; string _tp7 = TB7.Text.ToString(); string _cb7 = CB7.Checked ? "1" : "0"; string _cb17 = CB17.Checked ? "1" : "0"; string _tssq7 = _tp7 + "&" + _cb7 + "&" + _cb17; string _tp8 = TB8.Text.ToString(); string _cb8 = CB8.Checked ? "1" : "0"; string _cb18 = CB18.Checked ? "1" : "0"; string _tssq8 = _tp8 + "&" + _cb8 + "&" + _cb18; string _tp9 = TB9.Text.ToString(); string _cb9 = CB9.Checked ? "1" : "0"; string _cb19 = CB19.Checked ? "1" : "0"; string _tssq9 = _tp9 + "&" + _cb9 + "&" + _cb19; string _tp10 = TB10.Text.ToString(); string _cb10 = CB10.Checked ? "1" : "0"; string _cb20 = CB20.Checked ? "1" : "0"; string _tssq10 = _tp10 + "&" + _cb10 + "&" + _cb20; string _tp11 = TB11.Text.ToString(); string _cb111 = CB111.Checked ? "1" : "0"; string _cb21 = CB21.Checked ? "1" : "0"; string _tssq11 = _tp11 + "&" + _cb111 + "&" + _cb21; string str = ""; for (int i = 0; i < CheckBoxList1.Items.Count; i++) { if (CheckBoxList1.Items[i].Selected) { str += CheckBoxList1.Items[i].Value + "&"; } } string _add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_Item where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { string sql2 = "UPDATE [dbo].[Doctor_Item]" + " SET[normalItem1] = '" + _sq1cb + "'" + " ,[normalItem2] = '" + _sq2cb + "'" + " ,[normalItem3] = '" + _sq3cb + "'" + " ,[normalItem4] = '" + _sq4cb + "'" + " ,[normalItem5] = '" + _sq5cb + "'" + " ,[normalItem6] = '" + _sq6cb + "'" + " ,[normalItem7] = '" + _sq7cb + "'" + " ,[normalItem8] = '" + _sq8cb + "'" + " ,[normalItem9] = '" + _sq9cb + "'" + " ,[normalItem10] = '" + _sq10cb + "'" + " ,[normalItem11] = '" + _sq11cb + "'" + " ,[specialItem1] = '" + _tssq1 + "'" + " ,[specialItem2] = '" + _tssq2 + "'" + " ,[specialItem3] = '" + _tssq3 + "'" + " ,[specialItem4] = '" + _tssq4 + "'" + " ,[specialItem5] = '" + _tssq5 + "'" + " ,[specialItem6] = '" + _tssq6 + "'" + " ,[specialItem7] = '" + _tssq7 + "'" + " ,[specialItem8] = '" + _tssq8 + "'" + " ,[specialItem9] = '" + _tssq9 + "'" + " ,[specialItem10] = '" + _tssq10 + "'" + " ,[specialItem11] = '" + _tssq11 + "'" + " ,[UserId] = '" + hrmID + "'" + " ,[otherItem] = '" + str + "'" + " ,[add_time] = '" + _add_time + "'" + " WHERE UserId='" + hrmID + "'"; if (db.DBObj.Exec(sql2)) { Response.Write("<script>javascript:alert( '修改成功');window.location='Doctor1.aspx?hrmID=" + hrmID + "'</script>"); } } else { string sql = "INSERT [Doctor_Item] ([normalItem1],[normalItem2],[normalItem3],[normalItem4],[normalItem5],[normalItem6],[normalItem7],[normalItem8],[normalItem9],[normalItem10],[specialItem1],[specialItem2],[specialItem3],[specialItem4],[specialItem5],[specialItem6],[specialItem7],[specialItem8],[specialItem9],[specialItem10],[UserId],[otherItem],[add_time]) VALUES" + " ( '" + _sq1cb + "','" + _sq2cb + "','" + _sq3cb + "','" + _sq4cb + "','" + _sq5cb + "','" + _sq6cb + "','" + _sq7cb + "','" + _sq8cb + "','" + _sq9cb + "','" + _sq10cb + "'," + " '" + _tssq1 + "','" + _tssq2 + "','" + _tssq3 + "','" + _tssq4 + "','" + _tssq5 + "','" + _tssq6 + "','" + _tssq7 + "','" + _tssq8 + "','" + _tssq9 + "','" + _tssq10 + "'," + " '" + hrmID + "','" + str + "','" + _add_time + "')"; if (db.DBObj.Exec(sql)) { Response.Write("<script>javascript:alert( '保存成功!');window.location='Doctor1.aspx?hrmID=" + hrmID + "'</script>"); } } }
public static void Run() { //Prepare MNIST data Console.WriteLine("MNIST Data Loading..."); MnistData mnistData = new MnistData(); Console.WriteLine("Training Start..."); //Writing the network configuration in FunctionStack FunctionStack Layer1 = new FunctionStack( new Linear(28 * 28, 256, name: "l1 Linear"), new BatchNormalization(256, name: "l1 Norm"), new ReLU(name: "l1 ReLU") ); FunctionStack Layer2 = new FunctionStack( new Linear(256, 256, name: "l2 Linear"), new BatchNormalization(256, name: "l2 Norm"), new ReLU(name: "l2 ReLU") ); FunctionStack Layer3 = new FunctionStack( new Linear(256, 256, name: "l3 Linear"), new BatchNormalization(256, name: "l3 Norm"), new ReLU(name: "l3 ReLU") ); FunctionStack Layer4 = new FunctionStack( new Linear(256, 10, name: "l4 Linear") ); //FunctionStack itself is also stacked as Function FunctionStack nn = new FunctionStack ( Layer1, Layer2, Layer3, Layer4 ); FunctionStack cDNI1 = new FunctionStack( new Linear(256 + 10, 1024, name: "cDNI1 Linear1"), new BatchNormalization(1024, name: "cDNI1 Nrom1"), new ReLU(name: "cDNI1 ReLU1"), new Linear(1024, 256, initialW: new Real[1024, 256], name: "DNI1 Linear3") ); FunctionStack cDNI2 = new FunctionStack( new Linear(256 + 10, 1024, name: "cDNI2 Linear1"), new BatchNormalization(1024, name: "cDNI2 Nrom1"), new ReLU(name: "cDNI2 ReLU1"), new Linear(1024, 256, initialW: new Real[1024, 256], name: "cDNI2 Linear3") ); FunctionStack cDNI3 = new FunctionStack( new Linear(256 + 10, 1024, name: "cDNI3 Linear1"), new BatchNormalization(1024, name: "cDNI3 Nrom1"), new ReLU(name: "cDNI3 ReLU1"), new Linear(1024, 256, initialW: new Real[1024, 256], name: "cDNI3 Linear3") ); //Declare optimizer Layer1.SetOptimizer(new Adam(0.00003f)); Layer2.SetOptimizer(new Adam(0.00003f)); Layer3.SetOptimizer(new Adam(0.00003f)); Layer4.SetOptimizer(new Adam(0.00003f)); cDNI1.SetOptimizer(new Adam(0.00003f)); cDNI2.SetOptimizer(new Adam(0.00003f)); cDNI3.SetOptimizer(new Adam(0.00003f)); for (int epoch = 0; epoch < 10; epoch++) { Console.WriteLine("epoch " + (epoch + 1)); //Total error in the whole Real totalLoss = 0; Real cDNI1totalLoss = 0; Real cDNI2totalLoss = 0; Real cDNI3totalLoss = 0; long totalLossCount = 0; long cDNI1totalLossCount = 0; long cDNI2totalLossCount = 0; long cDNI3totalLossCount = 0; //How many times to run the batch for (int i = 1; i < TRAIN_DATA_COUNT + 1; i++) { //Get data randomly from training data TestDataSet datasetX = mnistData.GetRandomXSet(BATCH_DATA_COUNT); //Run first tier NdArray[] layer1ForwardResult = Layer1.Forward(datasetX.Data); ResultDataSet layer1ResultDataSet = new ResultDataSet(layer1ForwardResult, datasetX.Label); //Get the inclination of the first layer NdArray[] cDNI1Result = cDNI1.Forward(layer1ResultDataSet.GetTrainData()); //Apply the inclination of the first layer layer1ForwardResult[0].Grad = cDNI1Result[0].Data.ToArray(); //Update first layer Layer1.Backward(layer1ForwardResult); layer1ForwardResult[0].ParentFunc = null; Layer1.Update(); //Run Layer 2 NdArray[] layer2ForwardResult = Layer2.Forward(layer1ResultDataSet.Result); ResultDataSet layer2ResultDataSet = new ResultDataSet(layer2ForwardResult, layer1ResultDataSet.Label); //Get inclination of second layer NdArray[] cDNI2Result = cDNI2.Forward(layer2ResultDataSet.GetTrainData()); //Apply the inclination of the second layer layer2ForwardResult[0].Grad = cDNI2Result[0].Data.ToArray(); //Update 2nd tier Layer2.Backward(layer2ForwardResult); layer2ForwardResult[0].ParentFunc = null; //Perform learning of first layer cDNI Real cDNI1loss = new MeanSquaredError().Evaluate(cDNI1Result, new NdArray(layer1ResultDataSet.Result[0].Grad, cDNI1Result[0].Shape, cDNI1Result[0].BatchCount)); Layer2.Update(); cDNI1.Backward(cDNI1Result); cDNI1.Update(); cDNI1totalLoss += cDNI1loss; cDNI1totalLossCount++; //Run Third Tier NdArray[] layer3ForwardResult = Layer3.Forward(layer2ResultDataSet.Result); ResultDataSet layer3ResultDataSet = new ResultDataSet(layer3ForwardResult, layer2ResultDataSet.Label); //Get the inclination of the third layer NdArray[] cDNI3Result = cDNI3.Forward(layer3ResultDataSet.GetTrainData()); //Apply the inclination of the third layer layer3ForwardResult[0].Grad = cDNI3Result[0].Data.ToArray(); //Update third layer Layer3.Backward(layer3ForwardResult); layer3ForwardResult[0].ParentFunc = null; //Perform learning of cDNI for layer 2 Real cDNI2loss = new MeanSquaredError().Evaluate(cDNI2Result, new NdArray(layer2ResultDataSet.Result[0].Grad, cDNI2Result[0].Shape, cDNI2Result[0].BatchCount)); Layer3.Update(); cDNI2.Backward(cDNI2Result); cDNI2.Update(); cDNI2totalLoss += cDNI2loss; cDNI2totalLossCount++; //Run Layer 4 NdArray[] layer4ForwardResult = Layer4.Forward(layer3ResultDataSet.Result); //Get inclination of the fourth layer Real sumLoss = new SoftmaxCrossEntropy().Evaluate(layer4ForwardResult, layer3ResultDataSet.Label); //Update fourth layer Layer4.Backward(layer4ForwardResult); layer4ForwardResult[0].ParentFunc = null; totalLoss += sumLoss; totalLossCount++; //Perform learning of cDNI for the third layer Real cDNI3loss = new MeanSquaredError().Evaluate(cDNI3Result, new NdArray(layer3ResultDataSet.Result[0].Grad, cDNI3Result[0].Shape, cDNI3Result[0].BatchCount)); Layer4.Update(); cDNI3.Backward(cDNI3Result); cDNI3.Update(); cDNI3totalLoss += cDNI3loss; cDNI3totalLossCount++; Console.WriteLine("\nbatch count " + i + "/" + TRAIN_DATA_COUNT); //Result output Console.WriteLine("total loss " + totalLoss / totalLossCount); Console.WriteLine("local loss " + sumLoss); Console.WriteLine("\ncDNI1 total loss " + cDNI1totalLoss / cDNI1totalLossCount); Console.WriteLine("cDNI2 total loss " + cDNI2totalLoss / cDNI2totalLossCount); Console.WriteLine("cDNI3 total loss " + cDNI3totalLoss / cDNI3totalLossCount); Console.WriteLine("\ncDNI1 local loss " + cDNI1loss); Console.WriteLine("cDNI2 local loss " + cDNI2loss); Console.WriteLine("cDNI3 local loss " + cDNI3loss); //Test the accuracy if you move the batch 20 times if (i % 20 == 0) { Console.WriteLine("\nTesting..."); //Get data randomly from test data TestDataSet datasetY = mnistData.GetRandomYSet(TEST_DATA_COUNT); //Run test Real accuracy = Trainer.Accuracy(nn, datasetY.Data, datasetY.Label); Console.WriteLine("accuracy " + accuracy); } } } }
protected void Page_Load(object sender, EventArgs e) { hrmID = Request.QueryString["hrmID"]; if (!IsPostBack) { ResultDataSet Rs = new ResultDataSet(); string strSQL = "select * from Hrms_Department where hrmID=" + int.Parse(hrmID) + ""; db.DBObj.GetRs(strSQL, out Rs); if (Rs.RowCount > 0) { Label1.Text = Rs[0, "departname"].ToString(); Label2.Text = Rs[0, "name"].ToString(); Label3.Text = Rs[0, "workyear"].ToString(); Label4.Text = Rs[0, "techlevel"].ToString(); } ResultDataSet Rs2 = new ResultDataSet(); string strSQL2 = "select *,specialItem1 from Hrms inner join Doctor_Item on Hrms.UserId=Doctor_Item.UserId where Hrms.UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL2, out Rs2); string name = ""; if (Rs2.RowCount > 0) { Label5.Text = Rs2[0, "number"].ToString(); Label6.Text = Rs2[0, "WorkDate"].ToString(); name = Rs2[0, "specialItem1"].ToString().Split('&')[0]; } ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_Special where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { CheckBox1.Checked = Rs3[0, "cb"].ToString() == "1" ? true : false; TB1.Text = String.IsNullOrEmpty(Rs3[0, "name"].ToString())?name: Rs3[0, "name"].ToString(); string[] _rb1 = Rs3[0, "rb1"].ToString().Split('&'); getValue(RB1, _rb1[0]); getValue(RB2, _rb1[1]); string[] _rb2 = Rs3[0, "rb2"].ToString().Split('&'); TB2.Text = _rb2[0]; getValue(RB3, _rb2[1]); string[] _rb3 = Rs3[0, "rb3"].ToString().Split('&'); TB3.Text = _rb3[0]; getValue(RB4, _rb3[1]); getValue(RadioButtonList5, Rs3[0, "rb4"].ToString()); string[] _rb5 = Rs3[0, "rb5"].ToString().Split('&'); TB4.Text = _rb5[0]; TB5.Text = _rb5[1]; getValue(RB5, _rb5[2]); string[] _rb6 = Rs3[0, "rb6"].ToString().Split('&'); TB6.Text = _rb6[0]; TB7.Text = _rb6[1]; getValue(RB6, _rb6[2]); string[] _tb18 = Rs3[0, "tb18"].ToString().Split('&'); TB18.Text = _tb18[0]; getValue(RB18, _tb18[1]); string[] _tb19 = Rs3[0, "tb19"].ToString().Split('&'); TB19.Text = _tb19[0]; getValue(RB19, _tb19[1]); string[] _tb20 = Rs3[0, "tb20"].ToString().Split('&'); TB20.Text = _tb20[0]; getValue(RB20, _tb20[1]); string[] _tb21 = Rs3[0, "tb21"].ToString().Split('&'); TB21.Text = _tb21[0]; getValue(RB21, _tb21[1]); string[] _tb22 = Rs3[0, "tb22"].ToString().Split('&'); TB22.Text = _tb22[0]; getValue(RB22, _tb22[1]); string[] _tb23 = Rs3[0, "tb23"].ToString().Split('&'); TB23.Text = _tb23[0]; getValue(RB23, _tb23[1]); getValue(RB24, Rs3[0, "tb24"].ToString()); mark.Text = Rs3[0, "mark"].ToString(); } } }
protected void Button1_Click(object sender, EventArgs e) { string _department = ""; if (RadioButtonList1.SelectedIndex != -1) { //Response.Write("<script>alert('请选择科室!');</script>"); //Response.End(); //Response.Write("<script>alert('提交成功!" + sBasicTools + "');window.location.href ='Vote.aspx'</script>"); for (int i = 0; i < this.RadioButtonList1.Items.Count; i++) { if (this.RadioButtonList1.Items[i].Selected == true) { _department = this.RadioButtonList1.Items[i].Value; } } } string _A1 = ""; if (A1.SelectedIndex != -1) { for (int i = 0; i < this.A1.Items.Count; i++) { if (this.A1.Items[i].Selected == true) { _A1 = this.A1.Items[i].Value; } } } string _A2 = ""; if (A2.SelectedIndex != -1) { for (int i = 0; i < this.A2.Items.Count; i++) { if (this.A2.Items[i].Selected == true) { _A2 = this.A2.Items[i].Value; } } } string _A3 = ""; if (A3.SelectedIndex != -1) { for (int i = 0; i < this.A3.Items.Count; i++) { if (this.A3.Items[i].Selected == true) { _A3 = this.A3.Items[i].Value; } } } string _A4 = ""; if (A4.SelectedIndex != -1) { for (int i = 0; i < this.A4.Items.Count; i++) { if (this.A4.Items[i].Selected == true) { _A4 = this.A4.Items[i].Value; } } } string _A5 = ""; if (A5.SelectedIndex != -1) { for (int i = 0; i < this.A5.Items.Count; i++) { if (this.A5.Items[i].Selected == true) { _A5 = this.A5.Items[i].Value; } } } string _A6 = ""; if (A6.SelectedIndex != -1) { for (int i = 0; i < this.A6.Items.Count; i++) { if (this.A6.Items[i].Selected == true) { _A6 = this.A6.Items[i].Value; } } } string _B1 = ""; if (B1.SelectedIndex != -1) { for (int i = 0; i < this.B1.Items.Count; i++) { if (this.B1.Items[i].Selected == true) { _B1 = this.B1.Items[i].Value; } } } string _B2 = ""; if (B2.SelectedIndex != -1) { for (int i = 0; i < this.B2.Items.Count; i++) { if (this.B2.Items[i].Selected == true) { _B2 = this.B2.Items[i].Value; } } } string _B3 = ""; if (B3.SelectedIndex != -1) { for (int i = 0; i < this.B3.Items.Count; i++) { if (this.B3.Items[i].Selected == true) { _B3 = this.B3.Items[i].Value; } } } string _B4 = ""; if (B4.SelectedIndex != -1) { for (int i = 0; i < this.B4.Items.Count; i++) { if (this.B4.Items[i].Selected == true) { _B4 = this.B4.Items[i].Value; } } } string _B5 = ""; if (B5.SelectedIndex != -1) { for (int i = 0; i < this.B5.Items.Count; i++) { if (this.B5.Items[i].Selected == true) { _B5 = this.B5.Items[i].Value; } } } string _B6 = ""; if (B6.SelectedIndex != -1) { for (int i = 0; i < this.B6.Items.Count; i++) { if (this.B6.Items[i].Selected == true) { _B6 = this.B6.Items[i].Value; } } } string _B7 = ""; if (B7.SelectedIndex != -1) { for (int i = 0; i < this.B7.Items.Count; i++) { if (this.B7.Items[i].Selected == true) { _B7 = this.B7.Items[i].Value; } } } string _C1 = ""; if (C1.SelectedIndex != -1) { for (int i = 0; i < this.C1.Items.Count; i++) { if (this.C1.Items[i].Selected == true) { _C1 = this.C1.Items[i].Value; } } } string _C2 = ""; if (C2.SelectedIndex != -1) { for (int i = 0; i < this.C2.Items.Count; i++) { if (this.C2.Items[i].Selected == true) { _C2 = this.C2.Items[i].Value; } } } string _C3 = ""; if (C3.SelectedIndex != -1) { for (int i = 0; i < this.C3.Items.Count; i++) { if (this.C3.Items[i].Selected == true) { _C3 = this.C3.Items[i].Value; } } } string _C4 = ""; if (C4.SelectedIndex != -1) { for (int i = 0; i < this.C4.Items.Count; i++) { if (this.C4.Items[i].Selected == true) { _C4 = this.C4.Items[i].Value; } } } string _C5 = ""; if (C5.SelectedIndex != -1) { for (int i = 0; i < this.C5.Items.Count; i++) { if (this.C5.Items[i].Selected == true) { _C5 = this.C5.Items[i].Value; } } } string _D1 = ""; if (D1.SelectedIndex != -1) { for (int i = 0; i < this.D1.Items.Count; i++) { if (this.D1.Items[i].Selected == true) { _D1 = this.D1.Items[i].Value; } } } string _D2 = ""; if (D2.SelectedIndex != -1) { for (int i = 0; i < this.D2.Items.Count; i++) { if (this.D2.Items[i].Selected == true) { _D2 = this.D2.Items[i].Value; } } } string _D3 = ""; if (D3.SelectedIndex != -1) { for (int i = 0; i < this.D3.Items.Count; i++) { if (this.D3.Items[i].Selected == true) { _D3 = this.D3.Items[i].Value; } } } string _D4 = ""; if (D4.SelectedIndex != -1) { for (int i = 0; i < this.D4.Items.Count; i++) { if (this.D4.Items[i].Selected == true) { _D4 = this.D4.Items[i].Value; } } } string _D5 = ""; if (D5.SelectedIndex != -1) { for (int i = 0; i < this.D5.Items.Count; i++) { if (this.D5.Items[i].Selected == true) { _D5 = this.D5.Items[i].Value; } } } string _D6 = ""; if (D6.SelectedIndex != -1) { for (int i = 0; i < this.D6.Items.Count; i++) { if (this.D6.Items[i].Selected == true) { _D6 = this.D6.Items[i].Value; } } } string _D7 = ""; if (C5.SelectedIndex != -1) { for (int i = 0; i < this.D7.Items.Count; i++) { if (this.D7.Items[i].Selected == true) { _D7 = this.D7.Items[i].Value; } } } string _D8 = ""; if (D8.SelectedIndex != -1) { for (int i = 0; i < this.D8.Items.Count; i++) { if (this.D8.Items[i].Selected == true) { _D8 = this.D8.Items[i].Value; } } } string _D9 = ""; if (D9.SelectedIndex != -1) { for (int i = 0; i < this.D9.Items.Count; i++) { if (this.D9.Items[i].Selected == true) { _D9 = this.D9.Items[i].Value; } } } string _D10 = ""; if (D10.SelectedIndex != -1) { for (int i = 0; i < this.D10.Items.Count; i++) { if (this.D10.Items[i].Selected == true) { _D10 = this.D10.Items[i].Value; } } } string _E1 = ""; if (E1.SelectedIndex != -1) { for (int i = 0; i < this.E1.Items.Count; i++) { if (this.E1.Items[i].Selected == true) { _E1 = this.E1.Items[i].Value; } } } string _E2 = ""; if (E2.SelectedIndex != -1) { for (int i = 0; i < this.E2.Items.Count; i++) { if (this.E2.Items[i].Selected == true) { _E2 = this.E2.Items[i].Value; } } } string _E3 = ""; if (E3.SelectedIndex != -1) { for (int i = 0; i < this.E3.Items.Count; i++) { if (this.E3.Items[i].Selected == true) { _E3 = this.E3.Items[i].Value; } } } string _E4 = ""; if (E4.SelectedIndex != -1) { for (int i = 0; i < this.E4.Items.Count; i++) { if (this.E4.Items[i].Selected == true) { _E4 = this.E4.Items[i].Value; } } } string _F1 = ""; if (F1.SelectedIndex != -1) { for (int i = 0; i < this.F1.Items.Count; i++) { if (this.F1.Items[i].Selected == true) { _F1 = this.F1.Items[i].Value; } } } string _F2 = ""; if (F2.SelectedIndex != -1) { for (int i = 0; i < this.F2.Items.Count; i++) { if (this.F2.Items[i].Selected == true) { _F2 = this.F2.Items[i].Value; } } } string _F3 = ""; if (F3.SelectedIndex != -1) { for (int i = 0; i < this.F3.Items.Count; i++) { if (this.F3.Items[i].Selected == true) { _F3 = this.F3.Items[i].Value; } } } string _F4 = ""; if (F4.SelectedIndex != -1) { for (int i = 0; i < this.F4.Items.Count; i++) { if (this.F4.Items[i].Selected == true) { _F4 = this.F4.Items[i].Value; } } } string _G1 = ""; if (G1.SelectedIndex != -1) { for (int i = 0; i < this.G1.Items.Count; i++) { if (this.G1.Items[i].Selected == true) { _G1 = this.G1.Items[i].Value; } } } string _G2 = ""; if (G2.SelectedIndex != -1) { for (int i = 0; i < this.G2.Items.Count; i++) { if (this.G2.Items[i].Selected == true) { _G2 = this.G2.Items[i].Value; } } } string _G3 = ""; if (G3.SelectedIndex != -1) { for (int i = 0; i < this.G3.Items.Count; i++) { if (this.G3.Items[i].Selected == true) { _G3 = this.G3.Items[i].Value; } } } string _G4 = ""; if (G4.SelectedIndex != -1) { for (int i = 0; i < this.G4.Items.Count; i++) { if (this.G4.Items[i].Selected == true) { _G4 = this.G4.Items[i].Value; } } } string _G5 = ""; if (G5.SelectedIndex != -1) { for (int i = 0; i < this.G5.Items.Count; i++) { if (this.G5.Items[i].Selected == true) { _G5 = this.G5.Items[i].Value; } } } string _G6 = ""; if (G6.SelectedIndex != -1) { for (int i = 0; i < this.G6.Items.Count; i++) { if (this.G6.Items[i].Selected == true) { _G6 = this.G6.Items[i].Value; } } } string _G7 = ""; if (G7.SelectedIndex != -1) { for (int i = 0; i < this.G7.Items.Count; i++) { if (this.G7.Items[i].Selected == true) { _G7 = this.G7.Items[i].Value; } } } string _G8 = ""; if (G8.SelectedIndex != -1) { for (int i = 0; i < this.G8.Items.Count; i++) { if (this.G8.Items[i].Selected == true) { _G8 = this.G8.Items[i].Value; } } } string _G9 = ""; if (G9.SelectedIndex != -1) { for (int i = 0; i < this.G9.Items.Count; i++) { if (this.G9.Items[i].Selected == true) { _G9 = this.G9.Items[i].Value; } } } string _G10 = ""; if (G10.SelectedIndex != -1) { for (int i = 0; i < this.G10.Items.Count; i++) { if (this.G10.Items[i].Selected == true) { _G10 = this.G10.Items[i].Value; } } } string _week = ""; if (week.SelectedIndex != -1) { for (int i = 0; i < this.week.Items.Count; i++) { if (this.week.Items[i].Selected == true) { _week += this.week.Items[i].Value + ","; } } } string _mind = ""; if (mind.SelectedIndex != -1) { for (int i = 0; i < this.mind.Items.Count; i++) { if (this.mind.Items[i].Selected == true) { _mind = this.mind.Items[i].Value; } } } string _hour1 = ""; if (hour1.SelectedIndex != -1) { for (int i = 0; i < this.hour1.Items.Count; i++) { if (this.hour1.Items[i].Selected == true) { _hour1 = this.hour1.Items[i].Value; } } } string _hour2 = ""; if (hour2.SelectedIndex != -1) { for (int i = 0; i < this.hour2.Items.Count; i++) { if (this.hour2.Items[i].Selected == true) { _hour2 = this.hour2.Items[i].Value; } } } string _hour3 = ""; if (hour3.SelectedIndex != -1) { for (int i = 0; i < this.hour3.Items.Count; i++) { if (this.hour3.Items[i].Selected == true) { _hour3 = this.hour3.Items[i].Value; } } } string _hour4 = ""; if (hour4.SelectedIndex != -1) { for (int i = 0; i < this.hour4.Items.Count; i++) { if (this.hour4.Items[i].Selected == true) { _hour4 = this.hour4.Items[i].Value; } } } string _hour5 = ""; if (hour5.SelectedIndex != -1) { for (int i = 0; i < this.hour5.Items.Count; i++) { if (this.hour5.Items[i].Selected == true) { _hour5 = this.hour5.Items[i].Value; } } } string _hour6 = ""; if (hour6.SelectedIndex != -1) { for (int i = 0; i < this.hour6.Items.Count; i++) { if (this.hour6.Items[i].Selected == true) { _hour6 = this.hour6.Items[i].Value; } } } string _hour7 = ""; if (hour7.SelectedIndex != -1) { for (int i = 0; i < this.hour7.Items.Count; i++) { if (this.hour7.Items[i].Selected == true) { _hour7 = this.hour7.Items[i].Value; } } } string _sex = ""; if (sex.SelectedIndex != -1) { for (int i = 0; i < this.sex.Items.Count; i++) { if (this.sex.Items[i].Selected == true) { _sex = this.sex.Items[i].Value; } } } string _ages = ""; if (ages.SelectedIndex != -1) { for (int i = 0; i < this.ages.Items.Count; i++) { if (this.ages.Items[i].Selected == true) { _ages = this.ages.Items[i].Value; } } } string _leader = ""; if (leader.SelectedIndex != -1) { for (int i = 0; i < this.leader.Items.Count; i++) { if (this.leader.Items[i].Selected == true) { _leader = this.leader.Items[i].Value; } } } string _dan = ""; if (dan.SelectedIndex != -1) { for (int i = 0; i < this.dan.Items.Count; i++) { if (this.dan.Items[i].Selected == true) { _dan = this.dan.Items[i].Value; } } } string _type = ""; if (type.SelectedIndex != -1) { for (int i = 0; i < this.type.Items.Count; i++) { if (this.type.Items[i].Selected == true) { _type = this.type.Items[i].Value; } } } string _employee = ""; if (employee.SelectedIndex != -1) { for (int i = 0; i < this.employee.Items.Count; i++) { if (this.employee.Items[i].Selected == true) { _employee = this.employee.Items[i].Value; } } } string _workages = ""; if (workages.SelectedIndex != -1) { for (int i = 0; i < this.workages.Items.Count; i++) { if (this.workages.Items[i].Selected == true) { _workages = this.workages.Items[i].Value; } } } string _workagesSelf = ""; if (workagesSelf.SelectedIndex != -1) { for (int i = 0; i < this.workagesSelf.Items.Count; i++) { if (this.workagesSelf.Items[i].Selected == true) { _workagesSelf = this.workagesSelf.Items[i].Value; } } } string _education = ""; if (education.SelectedIndex != -1) { for (int i = 0; i < this.education.Items.Count; i++) { if (this.education.Items[i].Selected == true) { _education = this.education.Items[i].Value; } } } string _patient = ""; if (patient.SelectedIndex != -1) { for (int i = 0; i < this.patient.Items.Count; i++) { if (this.patient.Items[i].Selected == true) { _patient = this.patient.Items[i].Value; } } } string _hard = ""; if (hard.SelectedIndex != -1) { for (int i = 0; i < this.hard.Items.Count; i++) { if (this.hard.Items[i].Selected == true) { _hard = this.hard.Items[i].Value; } } } string _safe = ""; string _advise = ""; string _useID = "8108"; string _add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); _safe = safe.Text.ToString(); _advise = advise.Text.ToString(); string sql = "INSERT INTO [dbo].[Advise]([department],[A1],[A2],[A3],[A4],[A5],[A6],[B1],[B2],[B3],[B4],[B5],[B6],[B7],[C1],[C2],[C3],[C4],[C5],[D1]" + ",[D2],[D3],[D4],[D5],[D6],[D7],[D8],[D9],[D10],[E1],[E2],[E3],[E4],[F1],[F2],[F3],[F4],[G1],[G2],[G3],[G4],[G5],[G6],[G7],[G8]" + ",[G9],[G10],[tb_week],[tb_mind],[hour1],[hour2],[hour3],[hour4],[hour5],[hour6],[hour7],[safe],[sex],[ages],[leader],[dan],[type]" + ",[employee],[workages],[workagesSelf],[education],[patient],[hard],[advise],[useID],[add_time])" + "VALUES" + "('" + _department + "','" + _A1 + "','" + _A2 + "','" + _A3 + "','" + _A4 + "','" + _A5 + "','" + _A6 + "'" + ",'" + _B1 + "','" + _B2 + "','" + _B3 + "','" + _B4 + "','" + _B5 + "','" + _B6 + "','" + _B7 + "','" + _C1 + "','" + _C2 + "','" + _C3 + "','" + _C4 + "','" + _C5 + "'" + ",'" + _D1 + "','" + _D2 + "','" + _D3 + "','" + _D4 + "','" + _D5 + "','" + _D6 + "','" + _D7 + "','" + _D8 + "','" + _D9 + "','" + _D10 + "','" + _E1 + "','" + _E2 + "','" + _E3 + "','" + _E4 + "'" + ",'" + _F1 + "','" + _F2 + "','" + _F3 + "','" + _F4 + "','" + _G1 + "','" + _G2 + "','" + _G3 + "','" + _G4 + "','" + _G5 + "','" + _G6 + "','" + _G7 + "','" + _G8 + "','" + _G9 + "','" + _G10 + "'" + ",'" + _week + "','" + _mind + "','" + _hour1 + "','" + _hour2 + "','" + _hour3 + "','" + _hour4 + "','" + _hour5 + "','" + _hour6 + "','" + _hour7 + "'" + ",'" + _safe + "','" + _sex + "','" + _ages + "','" + _leader + "','" + _dan + "','" + _type + "','" + _employee + "','" + _workages + "','" + _workagesSelf + "','" + _education + "'" + ",'" + _patient + "','" + _hard + "','" + _advise + "','" + _useID + "','" + _add_time + "')"; ResultDataSet Rs2 = new ResultDataSet(); if (db.DBObj.GetRs(sql, out Rs2)) { Response.Write("<script>alert('提交成功!');window.location.href ='Vote.aspx'</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ResultDataSet Rs = new ResultDataSet(); string sql = "select top 1* from Advise where useID='8108' order by id desc"; if (db.DBObj.GetRs(sql, out Rs) && Rs.RowCount > 0) { for (int i = 0; i < this.RadioButtonList1.Items.Count; i++) { if (this.RadioButtonList1.Items[i].Value == Rs[0, "department"].ToString()) { this.RadioButtonList1.Items[i].Selected = true; } } for (int i = 0; i < this.A1.Items.Count; i++) { if (this.A1.Items[i].Value == Rs[0, "A1"].ToString()) { this.A1.Items[i].Selected = true; } } for (int i = 0; i < this.A2.Items.Count; i++) { if (this.A2.Items[i].Value == Rs[0, "A2"].ToString()) { this.A2.Items[i].Selected = true; } } for (int i = 0; i < this.A3.Items.Count; i++) { if (this.A3.Items[i].Value == Rs[0, "A3"].ToString()) { this.A3.Items[i].Selected = true; } } for (int i = 0; i < this.A4.Items.Count; i++) { if (this.A4.Items[i].Value == Rs[0, "A4"].ToString()) { this.A4.Items[i].Selected = true; } } for (int i = 0; i < this.A5.Items.Count; i++) { if (this.A5.Items[i].Value == Rs[0, "A5"].ToString()) { this.A5.Items[i].Selected = true; } } for (int i = 0; i < this.A6.Items.Count; i++) { if (this.A6.Items[i].Value == Rs[0, "A6"].ToString()) { this.A6.Items[i].Selected = true; } } for (int i = 0; i < this.B1.Items.Count; i++) { if (this.B1.Items[i].Value == Rs[0, "B1"].ToString()) { this.B1.Items[i].Selected = true; } } for (int i = 0; i < this.B2.Items.Count; i++) { if (this.B2.Items[i].Value == Rs[0, "B2"].ToString()) { this.B2.Items[i].Selected = true; } } for (int i = 0; i < this.B3.Items.Count; i++) { if (this.B3.Items[i].Value == Rs[0, "B3"].ToString()) { this.B3.Items[i].Selected = true; } } for (int i = 0; i < this.B4.Items.Count; i++) { if (this.B4.Items[i].Value == Rs[0, "B4"].ToString()) { this.B4.Items[i].Selected = true; } } for (int i = 0; i < this.B5.Items.Count; i++) { if (this.B5.Items[i].Value == Rs[0, "B5"].ToString()) { this.B5.Items[i].Selected = true; } } for (int i = 0; i < this.B6.Items.Count; i++) { if (this.B6.Items[i].Value == Rs[0, "B6"].ToString()) { this.B6.Items[i].Selected = true; } } for (int i = 0; i < this.B7.Items.Count; i++) { if (this.B7.Items[i].Value == Rs[0, "B7"].ToString()) { this.B7.Items[i].Selected = true; } } for (int i = 0; i < this.C1.Items.Count; i++) { if (this.C1.Items[i].Value == Rs[0, "C1"].ToString()) { this.C1.Items[i].Selected = true; } } for (int i = 0; i < this.C2.Items.Count; i++) { if (this.C2.Items[i].Value == Rs[0, "C2"].ToString()) { this.C2.Items[i].Selected = true; } } for (int i = 0; i < this.C3.Items.Count; i++) { if (this.C3.Items[i].Value == Rs[0, "C3"].ToString()) { this.C3.Items[i].Selected = true; } } for (int i = 0; i < this.C4.Items.Count; i++) { if (this.C4.Items[i].Value == Rs[0, "C4"].ToString()) { this.C4.Items[i].Selected = true; } } for (int i = 0; i < this.C5.Items.Count; i++) { if (this.C5.Items[i].Value == Rs[0, "C5"].ToString()) { this.C5.Items[i].Selected = true; } } for (int i = 0; i < this.D1.Items.Count; i++) { if (this.D1.Items[i].Value == Rs[0, "D1"].ToString()) { this.D1.Items[i].Selected = true; } } for (int i = 0; i < this.D2.Items.Count; i++) { if (this.D2.Items[i].Value == Rs[0, "D2"].ToString()) { this.D2.Items[i].Selected = true; } } for (int i = 0; i < this.D3.Items.Count; i++) { if (this.D3.Items[i].Value == Rs[0, "D3"].ToString()) { this.D3.Items[i].Selected = true; } } for (int i = 0; i < this.D4.Items.Count; i++) { if (this.D4.Items[i].Value == Rs[0, "D4"].ToString()) { this.D4.Items[i].Selected = true; } } for (int i = 0; i < this.D5.Items.Count; i++) { if (this.D5.Items[i].Value == Rs[0, "D5"].ToString()) { this.D5.Items[i].Selected = true; } } for (int i = 0; i < this.D6.Items.Count; i++) { if (this.D6.Items[i].Value == Rs[0, "D6"].ToString()) { this.D6.Items[i].Selected = true; } } for (int i = 0; i < this.D7.Items.Count; i++) { if (this.D7.Items[i].Value == Rs[0, "D7"].ToString()) { this.D7.Items[i].Selected = true; } } for (int i = 0; i < this.D8.Items.Count; i++) { if (this.D8.Items[i].Value == Rs[0, "D8"].ToString()) { this.D8.Items[i].Selected = true; } } for (int i = 0; i < this.D9.Items.Count; i++) { if (this.D9.Items[i].Value == Rs[0, "D9"].ToString()) { this.D9.Items[i].Selected = true; } } for (int i = 0; i < this.D10.Items.Count; i++) { if (this.D10.Items[i].Value == Rs[0, "D10"].ToString()) { this.D10.Items[i].Selected = true; } } for (int i = 0; i < this.E1.Items.Count; i++) { if (this.E1.Items[i].Value == Rs[0, "E1"].ToString()) { this.E1.Items[i].Selected = true; } } for (int i = 0; i < this.E2.Items.Count; i++) { if (this.E2.Items[i].Value == Rs[0, "E2"].ToString()) { this.E2.Items[i].Selected = true; } } for (int i = 0; i < this.E3.Items.Count; i++) { if (this.E3.Items[i].Value == Rs[0, "E3"].ToString()) { this.E3.Items[i].Selected = true; } } for (int i = 0; i < this.E4.Items.Count; i++) { if (this.E4.Items[i].Value == Rs[0, "E4"].ToString()) { this.E4.Items[i].Selected = true; } } for (int i = 0; i < this.F1.Items.Count; i++) { if (this.F1.Items[i].Value == Rs[0, "F1"].ToString()) { this.F1.Items[i].Selected = true; } } for (int i = 0; i < this.F2.Items.Count; i++) { if (this.F2.Items[i].Value == Rs[0, "F2"].ToString()) { this.F2.Items[i].Selected = true; } } for (int i = 0; i < this.F3.Items.Count; i++) { if (this.F3.Items[i].Value == Rs[0, "F3"].ToString()) { this.F3.Items[i].Selected = true; } } for (int i = 0; i < this.F4.Items.Count; i++) { if (this.F4.Items[i].Value == Rs[0, "F4"].ToString()) { this.F4.Items[i].Selected = true; } } for (int i = 0; i < this.G1.Items.Count; i++) { if (this.G1.Items[i].Value == Rs[0, "G1"].ToString()) { this.G1.Items[i].Selected = true; } } for (int i = 0; i < this.G2.Items.Count; i++) { if (this.G2.Items[i].Value == Rs[0, "G2"].ToString()) { this.G2.Items[i].Selected = true; } } for (int i = 0; i < this.G3.Items.Count; i++) { if (this.G3.Items[i].Value == Rs[0, "G3"].ToString()) { this.G3.Items[i].Selected = true; } } for (int i = 0; i < this.G4.Items.Count; i++) { if (this.G4.Items[i].Value == Rs[0, "G4"].ToString()) { this.G4.Items[i].Selected = true; } } for (int i = 0; i < this.G5.Items.Count; i++) { if (this.G5.Items[i].Value == Rs[0, "G5"].ToString()) { this.G5.Items[i].Selected = true; } } for (int i = 0; i < this.G6.Items.Count; i++) { if (this.G6.Items[i].Value == Rs[0, "G6"].ToString()) { this.G6.Items[i].Selected = true; } } for (int i = 0; i < this.G7.Items.Count; i++) { if (this.G7.Items[i].Value == Rs[0, "G7"].ToString()) { this.G7.Items[i].Selected = true; } } for (int i = 0; i < this.G8.Items.Count; i++) { if (this.G8.Items[i].Value == Rs[0, "G8"].ToString()) { this.G8.Items[i].Selected = true; } } for (int i = 0; i < this.G9.Items.Count; i++) { if (this.G9.Items[i].Value == Rs[0, "G9"].ToString()) { this.G9.Items[i].Selected = true; } } for (int i = 0; i < this.week.Items.Count; i++) { if (this.week.Items[i].Value == Rs[0, "tb_week"].ToString()) { this.week.Items[i].Selected = true; } } for (int i = 0; i < this.mind.Items.Count; i++) { if (this.mind.Items[i].Value == Rs[0, "tb_mind"].ToString()) { this.mind.Items[i].Selected = true; } } for (int i = 0; i < this.hour1.Items.Count; i++) { if (this.hour1.Items[i].Value == Rs[0, "hour1"].ToString()) { this.hour1.Items[i].Selected = true; } } for (int i = 0; i < this.hour2.Items.Count; i++) { if (this.hour2.Items[i].Value == Rs[0, "hour2"].ToString()) { this.hour2.Items[i].Selected = true; } } for (int i = 0; i < this.hour3.Items.Count; i++) { if (this.hour3.Items[i].Value == Rs[0, "hour3"].ToString()) { this.hour3.Items[i].Selected = true; } } for (int i = 0; i < this.hour4.Items.Count; i++) { if (this.hour4.Items[i].Value == Rs[0, "hour4"].ToString()) { this.hour4.Items[i].Selected = true; } } for (int i = 0; i < this.hour5.Items.Count; i++) { if (this.hour5.Items[i].Value == Rs[0, "hour5"].ToString()) { this.hour5.Items[i].Selected = true; } } for (int i = 0; i < this.hour6.Items.Count; i++) { if (this.hour6.Items[i].Value == Rs[0, "hour6"].ToString()) { this.hour6.Items[i].Selected = true; } } for (int i = 0; i < this.hour7.Items.Count; i++) { if (this.hour7.Items[i].Value == Rs[0, "hour7"].ToString()) { this.hour7.Items[i].Selected = true; } } for (int i = 0; i < this.sex.Items.Count; i++) { if (this.sex.Items[i].Value == Rs[0, "sex"].ToString()) { this.sex.Items[i].Selected = true; } } for (int i = 0; i < this.ages.Items.Count; i++) { if (this.ages.Items[i].Value == Rs[0, "ages"].ToString()) { this.ages.Items[i].Selected = true; } } for (int i = 0; i < this.leader.Items.Count; i++) { if (this.leader.Items[i].Value == Rs[0, "leader"].ToString()) { this.leader.Items[i].Selected = true; } } for (int i = 0; i < this.dan.Items.Count; i++) { if (this.dan.Items[i].Value == Rs[0, "dan"].ToString()) { this.dan.Items[i].Selected = true; } } for (int i = 0; i < this.type.Items.Count; i++) { if (this.type.Items[i].Value == Rs[0, "type"].ToString()) { this.type.Items[i].Selected = true; } } for (int i = 0; i < this.employee.Items.Count; i++) { if (this.employee.Items[i].Value == Rs[0, "employee"].ToString()) { this.employee.Items[i].Selected = true; } } for (int i = 0; i < this.workages.Items.Count; i++) { if (this.workages.Items[i].Value == Rs[0, "workages"].ToString()) { this.workages.Items[i].Selected = true; } } for (int i = 0; i < this.workagesSelf.Items.Count; i++) { if (this.workagesSelf.Items[i].Value == Rs[0, "workagesSelf"].ToString()) { this.workagesSelf.Items[i].Selected = true; } } for (int i = 0; i < this.education.Items.Count; i++) { if (this.education.Items[i].Value == Rs[0, "education"].ToString()) { this.education.Items[i].Selected = true; } } for (int i = 0; i < this.patient.Items.Count; i++) { if (this.patient.Items[i].Value == Rs[0, "patient"].ToString()) { this.patient.Items[i].Selected = true; } } for (int i = 0; i < this.hard.Items.Count; i++) { if (this.hard.Items[i].Value == Rs[0, "hard"].ToString()) { this.hard.Items[i].Selected = true; } } safe.Text = Rs[0, "safe"].ToString(); advise.Text = Rs[0, "advise"].ToString(); } } }
public static void Run() { // Prepare MNIST data RILogManager.Default?.SendDebug("MNIST Data Loading..."); MnistData mnistData = new MnistData(28); RILogManager.Default?.SendDebug("Training Start..."); // Write the network configuration in FunctionStack FunctionStack Layer1 = new FunctionStack("Test12 Layer 1", new Linear(true, 28 * 28, 256, name: "l1 Linear"), new BatchNormalization(true, 256, name: "l1 Norm"), new ReLU(name: "l1 ReLU") ); FunctionStack Layer2 = new FunctionStack("Test12 Layer 2", new Linear(true, 256, 256, name: "l2 Linear"), new BatchNormalization(true, 256, name: "l2 Norm"), new ReLU(name: "l2 ReLU") ); FunctionStack Layer3 = new FunctionStack("Test12 Layer 3", new Linear(true, 256, 256, name: "l3 Linear"), new BatchNormalization(true, 256, name: "l3 Norm"), new ReLU(name: "l3 ReLU") ); FunctionStack Layer4 = new FunctionStack("Test12 Layer 4", new Linear(true, 256, 10, name: "l4 Linear") ); // Function stack itself is also stacked as Function FunctionStack nn = new FunctionStack ("Test12", Layer1, Layer2, Layer3, Layer4 ); FunctionStack cDNI1 = new FunctionStack("Test12 DNI 1", new Linear(true, 256 + 10, 1024, name: "cDNI1 Linear1"), new BatchNormalization(true, 1024, name: "cDNI1 Norm1"), new ReLU(name: "cDNI1 ReLU1"), new Linear(true, 1024, 256, initialW: new Real[1024, 256], name: "DNI1 Linear3") ); FunctionStack cDNI2 = new FunctionStack("Test12 DNI 2", new Linear(true, 256 + 10, 1024, name: "cDNI2 Linear1"), new BatchNormalization(true, 1024, name: "cDNI2 Norm1"), new ReLU(name: "cDNI2 ReLU1"), new Linear(true, 1024, 256, initialW: new Real[1024, 256], name: "cDNI2 Linear3") ); FunctionStack cDNI3 = new FunctionStack("Test12 DNI 3", new Linear(true, 256 + 10, 1024, name: "cDNI3 Linear1"), new BatchNormalization(true, 1024, name: "cDNI3 Norm1"), new ReLU(name: "cDNI3 ReLU1"), new Linear(true, 1024, 256, initialW: new Real[1024, 256], name: "cDNI3 Linear3") ); Layer1.SetOptimizer(new Adam("Adam", 0.00003f)); Layer2.SetOptimizer(new Adam("Adam", 0.00003f)); Layer3.SetOptimizer(new Adam("Adam", 0.00003f)); Layer4.SetOptimizer(new Adam("Adam", 0.00003f)); cDNI1.SetOptimizer(new Adam("Adam", 0.00003f)); cDNI2.SetOptimizer(new Adam("Adam", 0.00003f)); cDNI3.SetOptimizer(new Adam("Adam", 0.00003f)); // Describe each function stack; RILogManager.Default?.SendDebug(Layer1.Describe()); RILogManager.Default?.SendDebug(Layer2.Describe()); RILogManager.Default?.SendDebug(Layer3.Describe()); RILogManager.Default?.SendDebug(Layer4.Describe()); RILogManager.Default?.SendDebug(cDNI1.Describe()); RILogManager.Default?.SendDebug(cDNI2.Describe()); RILogManager.Default?.SendDebug(cDNI3.Describe()); for (int epoch = 0; epoch < 10; epoch++) { // Total error in the whole Real totalLoss = 0; Real cDNI1totalLoss = 0; Real cDNI2totalLoss = 0; Real cDNI3totalLoss = 0; long totalLossCount = 0; long cDNI1totalLossCount = 0; long cDNI2totalLossCount = 0; long cDNI3totalLossCount = 0; // how many times to run the batch for (int i = 1; i < TRAIN_DATA_COUNT + 1; i++) { RILogManager.Default?.SendDebug("epoch: " + (epoch + 1) + " of 10, batch iteration: " + i + " of " + TRAIN_DATA_COUNT); RILogManager.Default?.ViewerSendWatch("Epoch", epoch + 1); RILogManager.Default?.ViewerSendWatch("Batch Iteration", i); // Get data randomly from the training data TestDataSet datasetX = mnistData.GetRandomXSet(BATCH_DATA_COUNT, 28, 28); // Run first tier NdArray[] layer1ForwardResult = Layer1.Forward(true, datasetX.Data); ResultDataSet layer1ResultDataSet = new ResultDataSet(layer1ForwardResult, datasetX.Label); // Obtain the slope of the first layer NdArray[] cDNI1Result = cDNI1.Forward(true, layer1ResultDataSet.GetTrainData()); // Apply the slope of the first layer layer1ForwardResult[0].Grad = cDNI1Result[0].Data.ToArray(); //Update first layer Layer1.Backward(true, layer1ForwardResult); layer1ForwardResult[0].ParentFunc = null; Layer1.Update(); // Run Layer 2 NdArray[] layer2ForwardResult = Layer2.Forward(true, layer1ResultDataSet.Result); ResultDataSet layer2ResultDataSet = new ResultDataSet(layer2ForwardResult, layer1ResultDataSet.Label); // Get the inclination of the second layer NdArray[] cDNI2Result = cDNI2.Forward(true, layer2ResultDataSet.GetTrainData()); // Apply the slope of the second layer layer2ForwardResult[0].Grad = cDNI2Result[0].Data.ToArray(); //Update layer 2 Layer2.Backward(true, layer2ForwardResult); layer2ForwardResult[0].ParentFunc = null; //Perform learning of first layer cDNI Real cDNI1loss = new MeanSquaredError().Evaluate(cDNI1Result, new NdArray(layer1ResultDataSet.Result[0].Grad, cDNI1Result[0].Shape, cDNI1Result[0].BatchCount)); Layer2.Update(); cDNI1.Backward(true, cDNI1Result); cDNI1.Update(); cDNI1totalLoss += cDNI1loss; cDNI1totalLossCount++; //Run Third Tier NdArray[] layer3ForwardResult = Layer3.Forward(true, layer2ResultDataSet.Result); ResultDataSet layer3ResultDataSet = new ResultDataSet(layer3ForwardResult, layer2ResultDataSet.Label); //Get the inclination of the third layer NdArray[] cDNI3Result = cDNI3.Forward(true, layer3ResultDataSet.GetTrainData()); //Apply the inclination of the third layer layer3ForwardResult[0].Grad = cDNI3Result[0].Data.ToArray(); //Update third layer Layer3.Backward(true, layer3ForwardResult); layer3ForwardResult[0].ParentFunc = null; //Perform learning of cDNI for layer 2 Real cDNI2loss = new MeanSquaredError().Evaluate(cDNI2Result, new NdArray(layer2ResultDataSet.Result[0].Grad, cDNI2Result[0].Shape, cDNI2Result[0].BatchCount)); Layer3.Update(); cDNI2.Backward(true, cDNI2Result); cDNI2.Update(); cDNI2totalLoss += cDNI2loss; cDNI2totalLossCount++; NdArray[] layer4ForwardResult = Layer4.Forward(true, layer3ResultDataSet.Result); Real sumLoss = new SoftmaxCrossEntropy().Evaluate(layer4ForwardResult, layer3ResultDataSet.Label); Layer4.Backward(true, layer4ForwardResult); layer4ForwardResult[0].ParentFunc = null; totalLoss += sumLoss; totalLossCount++; Real cDNI3loss = new MeanSquaredError().Evaluate(cDNI3Result, new NdArray(layer3ResultDataSet.Result[0].Grad, cDNI3Result[0].Shape, cDNI3Result[0].BatchCount)); Layer4.Update(); cDNI3.Backward(true, cDNI3Result); cDNI3.Update(); cDNI3totalLoss += cDNI3loss; cDNI3totalLossCount++; RILogManager.Default?.SendDebug("\nbatch count " + i + "/" + TRAIN_DATA_COUNT); RILogManager.Default?.SendDebug("total loss " + totalLoss / totalLossCount); RILogManager.Default?.SendDebug("local loss " + sumLoss); RILogManager.Default?.SendDebug("\ncDNI1 total loss " + cDNI1totalLoss / cDNI1totalLossCount); RILogManager.Default?.SendDebug("cDNI2 total loss " + cDNI2totalLoss / cDNI2totalLossCount); RILogManager.Default?.SendDebug("cDNI3 total loss " + cDNI3totalLoss / cDNI3totalLossCount); RILogManager.Default?.SendDebug("\ncDNI1 local loss " + cDNI1loss); RILogManager.Default?.SendDebug("cDNI2 local loss " + cDNI2loss); RILogManager.Default?.SendDebug("cDNI3 local loss " + cDNI3loss); if (i % 20 == 0) { RILogManager.Default?.SendDebug("\nTesting..."); TestDataSet datasetY = mnistData.GetRandomYSet(TEST_DATA_COUNT, 28); Real accuracy = Trainer.Accuracy(nn, datasetY.Data, datasetY.Label); RILogManager.Default?.SendDebug("accuracy " + accuracy); } } } }
public static void Run() { //MNISTのデータを用意する Console.WriteLine("MNIST Data Loading..."); MnistData mnistData = new MnistData(28); Console.WriteLine("Training Start..."); //ネットワークの構成を FunctionStack に書き連ねる FunctionStack Layer1 = new FunctionStack( new Linear(28 * 28, 256, name: "l1 Linear"), new BatchNormalization(256, name: "l1 Norm"), new ReLU(name: "l1 ReLU") ); FunctionStack Layer2 = new FunctionStack( new Linear(256, 256, name: "l2 Linear"), new BatchNormalization(256, name: "l2 Norm"), new ReLU(name: "l2 ReLU") ); FunctionStack Layer3 = new FunctionStack( new Linear(256, 256, name: "l3 Linear"), new BatchNormalization(256, name: "l3 Norm"), new ReLU(name: "l3 ReLU") ); FunctionStack Layer4 = new FunctionStack( new Linear(256, 10, name: "l4 Linear") ); //FunctionStack自身もFunctionとして積み上げられる FunctionStack nn = new FunctionStack ( Layer1, Layer2, Layer3, Layer4 ); FunctionStack cDNI1 = new FunctionStack( new Linear(256 + 10, 1024, name: "cDNI1 Linear1"), new BatchNormalization(1024, name: "cDNI1 Nrom1"), new ReLU(name: "cDNI1 ReLU1"), new Linear(1024, 256, initialW: new Real[1024, 256], name: "DNI1 Linear3") ); FunctionStack cDNI2 = new FunctionStack( new Linear(256 + 10, 1024, name: "cDNI2 Linear1"), new BatchNormalization(1024, name: "cDNI2 Nrom1"), new ReLU(name: "cDNI2 ReLU1"), new Linear(1024, 256, initialW: new Real[1024, 256], name: "cDNI2 Linear3") ); FunctionStack cDNI3 = new FunctionStack( new Linear(256 + 10, 1024, name: "cDNI3 Linear1"), new BatchNormalization(1024, name: "cDNI3 Nrom1"), new ReLU(name: "cDNI3 ReLU1"), new Linear(1024, 256, initialW: new Real[1024, 256], name: "cDNI3 Linear3") ); //optimizerを宣言 Layer1.SetOptimizer(new Adam(0.00003f)); Layer2.SetOptimizer(new Adam(0.00003f)); Layer3.SetOptimizer(new Adam(0.00003f)); Layer4.SetOptimizer(new Adam(0.00003f)); cDNI1.SetOptimizer(new Adam(0.00003f)); cDNI2.SetOptimizer(new Adam(0.00003f)); cDNI3.SetOptimizer(new Adam(0.00003f)); for (int epoch = 0; epoch < 10; epoch++) { Console.WriteLine("epoch " + (epoch + 1)); //全体での誤差を集計 Real totalLoss = 0; Real cDNI1totalLoss = 0; Real cDNI2totalLoss = 0; Real cDNI3totalLoss = 0; long totalLossCount = 0; long cDNI1totalLossCount = 0; long cDNI2totalLossCount = 0; long cDNI3totalLossCount = 0; //何回バッチを実行するか for (int i = 1; i < TRAIN_DATA_COUNT + 1; i++) { //訓練データからランダムにデータを取得 TestDataSet datasetX = mnistData.GetRandomXSet(BATCH_DATA_COUNT, 28, 28); //第一層を実行 NdArray[] layer1ForwardResult = Layer1.Forward(datasetX.Data); ResultDataSet layer1ResultDataSet = new ResultDataSet(layer1ForwardResult, datasetX.Label); //第一層の傾きを取得 NdArray[] cDNI1Result = cDNI1.Forward(layer1ResultDataSet.GetTrainData()); //第一層の傾きを適用 layer1ForwardResult[0].Grad = cDNI1Result[0].Data.ToArray(); //第一層を更新 Layer1.Backward(layer1ForwardResult); layer1ForwardResult[0].ParentFunc = null; Layer1.Update(); //第二層を実行 NdArray[] layer2ForwardResult = Layer2.Forward(layer1ResultDataSet.Result); ResultDataSet layer2ResultDataSet = new ResultDataSet(layer2ForwardResult, layer1ResultDataSet.Label); //第二層の傾きを取得 NdArray[] cDNI2Result = cDNI2.Forward(layer2ResultDataSet.GetTrainData()); //第二層の傾きを適用 layer2ForwardResult[0].Grad = cDNI2Result[0].Data.ToArray(); //第二層を更新 Layer2.Backward(layer2ForwardResult); layer2ForwardResult[0].ParentFunc = null; //第一層用のcDNIの学習を実行 Real cDNI1loss = new MeanSquaredError().Evaluate(cDNI1Result, new NdArray(layer1ResultDataSet.Result[0].Grad, cDNI1Result[0].Shape, cDNI1Result[0].BatchCount)); Layer2.Update(); cDNI1.Backward(cDNI1Result); cDNI1.Update(); cDNI1totalLoss += cDNI1loss; cDNI1totalLossCount++; //第三層を実行 NdArray[] layer3ForwardResult = Layer3.Forward(layer2ResultDataSet.Result); ResultDataSet layer3ResultDataSet = new ResultDataSet(layer3ForwardResult, layer2ResultDataSet.Label); //第三層の傾きを取得 NdArray[] cDNI3Result = cDNI3.Forward(layer3ResultDataSet.GetTrainData()); //第三層の傾きを適用 layer3ForwardResult[0].Grad = cDNI3Result[0].Data.ToArray(); //第三層を更新 Layer3.Backward(layer3ForwardResult); layer3ForwardResult[0].ParentFunc = null; //第二層用のcDNIの学習を実行 Real cDNI2loss = new MeanSquaredError().Evaluate(cDNI2Result, new NdArray(layer2ResultDataSet.Result[0].Grad, cDNI2Result[0].Shape, cDNI2Result[0].BatchCount)); Layer3.Update(); cDNI2.Backward(cDNI2Result); cDNI2.Update(); cDNI2totalLoss += cDNI2loss; cDNI2totalLossCount++; //第四層を実行 NdArray[] layer4ForwardResult = Layer4.Forward(layer3ResultDataSet.Result); //第四層の傾きを取得 Real sumLoss = new SoftmaxCrossEntropy().Evaluate(layer4ForwardResult, layer3ResultDataSet.Label); //第四層を更新 Layer4.Backward(layer4ForwardResult); layer4ForwardResult[0].ParentFunc = null; totalLoss += sumLoss; totalLossCount++; //第三層用のcDNIの学習を実行 Real cDNI3loss = new MeanSquaredError().Evaluate(cDNI3Result, new NdArray(layer3ResultDataSet.Result[0].Grad, cDNI3Result[0].Shape, cDNI3Result[0].BatchCount)); Layer4.Update(); cDNI3.Backward(cDNI3Result); cDNI3.Update(); cDNI3totalLoss += cDNI3loss; cDNI3totalLossCount++; Console.WriteLine("\nbatch count " + i + "/" + TRAIN_DATA_COUNT); //結果出力 Console.WriteLine("total loss " + totalLoss / totalLossCount); Console.WriteLine("local loss " + sumLoss); Console.WriteLine("\ncDNI1 total loss " + cDNI1totalLoss / cDNI1totalLossCount); Console.WriteLine("cDNI2 total loss " + cDNI2totalLoss / cDNI2totalLossCount); Console.WriteLine("cDNI3 total loss " + cDNI3totalLoss / cDNI3totalLossCount); Console.WriteLine("\ncDNI1 local loss " + cDNI1loss); Console.WriteLine("cDNI2 local loss " + cDNI2loss); Console.WriteLine("cDNI3 local loss " + cDNI3loss); //20回バッチを動かしたら精度をテストする if (i % 20 == 0) { Console.WriteLine("\nTesting..."); //テストデータからランダムにデータを取得 TestDataSet datasetY = mnistData.GetRandomYSet(TEST_DATA_COUNT, 28); //テストを実行 Real accuracy = Trainer.Accuracy(nn, datasetY.Data, datasetY.Label); Console.WriteLine("accuracy " + accuracy); } } } }
protected void Page_Load(object sender, EventArgs e) { hrmID = Request.QueryString["hrmID"]; if (!IsPostBack) { ResultDataSet Rs = new ResultDataSet(); string strSQL = "select * from Hrms_Department where hrmID=" + int.Parse(hrmID) + ""; db.DBObj.GetRs(strSQL, out Rs); if (Rs.RowCount > 0) { Label1.Text = Rs[0, "departname"].ToString(); Label2.Text = Rs[0, "name"].ToString(); Label3.Text = Rs[0, "workyear"].ToString(); Label4.Text = Rs[0, "techlevel"].ToString(); } ResultDataSet Rs2 = new ResultDataSet(); string strSQL2 = "select * from Hrms where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL2, out Rs2); if (Rs2.RowCount > 0) { Label5.Text = Rs2[0, "number"].ToString(); Label6.Text = Rs2[0, "WorkDate"].ToString(); } ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_First where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { string[] _tb1 = Rs3[0, "tb1"].ToString().Split('&'); TB1.Text = _tb1[0]; getValue(RB1, _tb1[1]); string[] _tb2 = Rs3[0, "tb2"].ToString().Split('&'); TB21.Text = _tb2[0]; TB22.Text = _tb2[1]; getValue(RB2, _tb2[2]); string[] _tb3 = Rs3[0, "tb3"].ToString().Split('&'); TB31.Text = _tb3[0]; TB32.Text = _tb3[1]; TB33.Text = _tb3[2]; getValue(RB3, _tb3[3]); string[] _tb4 = Rs3[0, "tb4"].ToString().Split('&'); TB41.Text = _tb4[0]; TB42.Text = _tb4[1]; getValue(RB4, _tb4[2]); string[] _tb5 = Rs3[0, "tb5"].ToString().Split('&'); TB51.Text = _tb5[0]; TB52.Text = _tb5[1]; TB53.Text = _tb5[2]; getValue(RB5, _tb5[3]); string[] _tb6 = Rs3[0, "tb6"].ToString().Split('&'); TB61.Text = _tb6[0]; TB62.Text = _tb6[1]; TB63.Text = _tb6[2]; getValue(RB6, _tb6[3]); string[] _tb7 = Rs3[0, "tb7"].ToString().Split('&'); TB71.Text = _tb7[0]; TB72.Text = _tb7[1]; TB73.Text = _tb7[2]; getValue(RB7, _tb7[3]); string[] _tb8 = Rs3[0, "tb8"].ToString().Split('&'); TB81.Text = _tb8[0]; TB82.Text = _tb8[1]; getValue(RB8, _tb8[2]); string[] _rb1 = Rs3[0, "rb1"].ToString().Split('&'); TB10.Text = _rb1[0]; getValue(RB10, _rb1[1]); string[] _rb2 = Rs3[0, "rb2"].ToString().Split('&'); TB11.Text = _rb2[0]; getValue(RB11, _rb2[1]); string[] _rb3 = Rs3[0, "rb3"].ToString().Split('&'); TB12.Text = _rb3[0]; getValue(RB12, _rb3[1]); string[] _rb4 = Rs3[0, "rb4"].ToString().Split('&'); TB13.Text = _rb4[0]; getValue(RB13, _rb4[1]); string[] _rb5 = Rs3[0, "rb5"].ToString().Split('&'); TB14.Text = _rb5[0]; getValue(RB14, _rb5[1]); string[] _rb6 = Rs3[0, "rb6"].ToString().Split('&'); TB15.Text = _rb6[0]; getValue(RB15, _rb6[1]); string[] _rb7 = Rs3[0, "rb7"].ToString().Split('&'); TB16.Text = _rb7[0]; getValue(RB16, _rb7[1]); string[] _rb8 = Rs3[0, "rb8"].ToString().Split('&'); TB17.Text = _rb8[0]; getValue(RB17, _rb8[1]); string[] _rb9 = Rs3[0, "rb9"].ToString().Split('&'); TB18.Text = _rb9[0]; getValue(RB18, _rb9[1]); string[] _rb10 = Rs3[0, "rb10"].ToString().Split('&'); TB19.Text = _rb10[0]; getValue(RB19, _rb10[1]); string[] _pass1 = Rs3[0, "pass1"].ToString().Split('&'); TB20.Text = _pass1[0]; TB30.Text = _pass1[1]; getValue(RB20, _pass1[2]); string[] _pass2 = Rs3[0, "pass2"].ToString().Split('&'); TBS1.Text = _pass2[0]; TBS2.Text = _pass2[1]; getValue(RB30, _pass2[2]); string[] _pass3 = Rs3[0, "pass3"].ToString().Split('&'); TBS3.Text = _pass3[0]; TBS4.Text = _pass3[1]; getValue(RB40, _tb2[2]); string _rb11 = Rs3[0, "rb11"].ToString(); getValue(RB50, _rb11); mark.Text = Rs3[0, "mark"].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { string content = ""; string keyword = Request.QueryString["id"]; if (!String.IsNullOrEmpty(keyword)) { string sql = "select top 1.* from DrugInfo where id=" + keyword + ""; ResultDataSet Rs = new ResultDataSet(); db.DB4Obj.GetRs(sql, out Rs); if (Rs.RowCount > 0) { content = "<h2>" + Rs[0, "药品名称"] + "(" + Rs[0, "规格"] + ")</h2>" + "<h4>适应症:</h4>" + "<p>" + Rs[0, "适应症"] + "</p>" + "<h4>用法用量</h4>" + "<p>" + Rs[0, "用法用量"] + "</p>" + "<h4>不良反应</h4>" + "<p>" + Rs[0, "不良反应"] + "</p>" + "<h4>禁忌</h4>" + "<p>" + Rs[0, "禁忌"] + "</p>" + "<h4>注意事项</h4>" + "<p>" + Rs[0, "注意事项"] + "</p>" + "<h4>妊娠期妇女用药</h4>" + "<p>" + Rs[0, "妊娠期妇女用药"] + "</p>" + "<h4>哺乳期妇女用药</h4>" + "<p>" + Rs[0, "哺乳期妇女用药"] + "</p>" + "<h4>儿童用药</h4>" + "<p>" + Rs[0, "儿童用药"] + "</p>" + "<h4>老年用药</h4>" + "<p>" + Rs[0, "老年用药"] + "</p>" + "<h4>药物相互作用中西</h4>" + "<p>" + Rs[0, "药物相互作用中西"] + "</p>" + "<h4>贮藏</h4>" + "<p>" + Rs[0, "贮藏"] + "</p>" + "<h4>食物药物交互作用</h4>" + "<p>" + Rs[0, "食物药物交互作用"] + "</p>" + "<h4>溶媒</h4>" + "<p>" + Rs[0, "溶媒"] + "</p>" + "<h4>滴速</h4>" + "<p>" + Rs[0, "滴速"] + "</p>" + "<h4>备注参考依据非说明书上内容请注明</h4>" + "<p>" + Rs[0, "备注参考依据非说明书上内容请注明"] + "</p>"; } ul.InnerHtml = content; Label1.Text = "西药"; Label1.ForeColor = System.Drawing.Color.Green; } string ids = Request.QueryString["ids"]; if (!String.IsNullOrEmpty(ids)) { string sql = "select top 1.* from DrugInfo_C where ids=" + ids + ""; ResultDataSet Rs = new ResultDataSet(); db.DB4Obj.GetRs(sql, out Rs); if (Rs.RowCount > 0) { content = "<h2>" + Rs[0, "药品名称"] + "(" + Rs[0, "规格"] + ")</h2>" + "<h4>功效分类:</h4>" + "<p>" + Rs[0, "功效分类"] + "</p>" + "<h4>来源</h4>" + "<p>" + Rs[0, "来源"] + "</p>" + "<h4>药性</h4>" + "<p>" + Rs[0, "药性"] + "</p>" + "<h4>功效</h4>" + "<p>" + Rs[0, "功效"] + "</p>" + "<h4>应用</h4>" + "<p>" + Rs[0, "应用"] + "</p>" + "<h4>用法用量</h4>" + "<p>" + Rs[0, "用法用量"] + "</p>" + "<h4>使用注意</h4>" + "<p>" + Rs[0, "使用注意"] + "</p>" + "<h4>贮藏</h4>" + "<p>" + Rs[0, "贮藏"] + "</p>" + "<h4>现代研究</h4>" + "<p>" + Rs[0, "现代研究"] + "</p>" + "<h4>不良反应</h4>" + "<p>" + Rs[0, "不良反应"] + "</p>" + "<h4>禁忌</h4>" + "<p>" + Rs[0, "禁忌"] + "</p>" + "<h4>妊娠期妇女用药</h4>" + "<p>" + Rs[0, "妊娠期妇女用药"] + "</p>" + "<h4>哺乳期妇女用药</h4>" + "<p>" + Rs[0, "哺乳期妇女用药"] + "</p>" + "<h4>儿童用药</h4>" + "<p>" + Rs[0, "儿童用药"] + "</p>" + "<h4>老年用药</h4>" + "<p>" + Rs[0, "老年用药"] + "</p>" + "<h4>药物相互作用中西</h4>" + "<p>" + Rs[0, "药物相互作用中西"] + "</p>" + "<h4>食物药物交互作用</h4>" + "<p>" + Rs[0, "食物药物交互作用"] + "</p>"; } ul.InnerHtml = content; Label1.Text = "中药"; Label1.ForeColor = System.Drawing.Color.Green; } }
protected void Page_Load(object sender, EventArgs e) { hrmID = Request.QueryString["hrmID"]; if (!IsPostBack) { ResultDataSet Rs = new ResultDataSet(); string strSQL = "select * from Hrms_Department where hrmID=" + int.Parse(hrmID) + ""; db.DBObj.GetRs(strSQL, out Rs); if (Rs.RowCount > 0) { Label1.Text = Rs[0, "departname"].ToString(); Label2.Text = Rs[0, "name"].ToString(); Label3.Text = Rs[0, "workyear"].ToString(); Label4.Text = Rs[0, "techlevel"].ToString(); } ResultDataSet Rs2 = new ResultDataSet(); string strSQL2 = "select * from Hrms where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL2, out Rs2); if (Rs2.RowCount > 0) { Label5.Text = Rs2[0, "number"].ToString(); Label6.Text = Rs2[0, "WorkDate"].ToString(); } ResultDataSet Rs3 = new ResultDataSet(); string strSQL3 = "select * from Doctor_Item where UserId='" + hrmID + "'"; db.DBObj.GetRs(strSQL3, out Rs3); if (Rs3.RowCount > 0) { string[] normalItem1Array = Rs3[0, "normalItem1"].ToString().Split('&'); if (normalItem1Array.Length == 3) { SQ1.Text = normalItem1Array[0]; CBS1.Checked = normalItem1Array[1] == "1" ? true:false; CBQ1.Checked = normalItem1Array[2] == "1" ? true : false; } string[] normalItem2Array = Rs3[0, "normalItem2"].ToString().Split('&'); if (normalItem1Array.Length == 3) { SQ2.Text = normalItem2Array[0]; CBS2.Checked = normalItem2Array[1] == "1" ? true : false; CBQ2.Checked = normalItem2Array[2] == "1" ? true : false; } string[] normalItem3Array = Rs3[0, "normalItem3"].ToString().Split('&'); if (normalItem3Array.Length == 3) { SQ3.Text = normalItem3Array[0]; CBS3.Checked = normalItem3Array[1] == "1" ? true : false; CBQ3.Checked = normalItem3Array[2] == "1" ? true : false; } string[] normalItem4Array = Rs3[0, "normalItem4"].ToString().Split('&'); if (normalItem4Array.Length == 3) { SQ4.Text = normalItem4Array[0]; CBS4.Checked = normalItem4Array[1] == "1" ? true : false; CBQ4.Checked = normalItem4Array[2] == "1" ? true : false; } string[] normalItem5Array = Rs3[0, "normalItem5"].ToString().Split('&'); if (normalItem5Array.Length == 3) { SQ5.Text = normalItem5Array[0]; CBS5.Checked = normalItem5Array[1] == "1" ? true : false; CBQ5.Checked = normalItem5Array[2] == "1" ? true : false; } string[] normalItem6Array = Rs3[0, "normalItem6"].ToString().Split('&'); if (normalItem6Array.Length == 3) { SQ6.Text = normalItem6Array[0]; CBS6.Checked = normalItem6Array[1] == "1" ? true : false; CBQ6.Checked = normalItem6Array[2] == "1" ? true : false; } string[] normalItem7Array = Rs3[0, "normalItem7"].ToString().Split('&'); if (normalItem7Array.Length == 3) { SQ7.Text = normalItem7Array[0]; CBS7.Checked = normalItem7Array[1] == "1" ? true : false; CBQ7.Checked = normalItem7Array[2] == "1" ? true : false; } string[] normalItem8Array = Rs3[0, "normalItem8"].ToString().Split('&'); if (normalItem8Array.Length == 3) { SQ8.Text = normalItem8Array[0]; CBS8.Checked = normalItem8Array[1] == "1" ? true : false; CBQ8.Checked = normalItem8Array[2] == "1" ? true : false; } string[] normalItem9Array = Rs3[0, "normalItem9"].ToString().Split('&'); if (normalItem9Array.Length == 3) { SQ9.Text = normalItem9Array[0]; CBS9.Checked = normalItem9Array[1] == "1" ? true : false; CBQ9.Checked = normalItem9Array[2] == "1" ? true : false; } string[] normalItem10Array = Rs3[0, "normalItem10"].ToString().Split('&'); if (normalItem10Array.Length == 3) { SQ10.Text = normalItem10Array[0]; CBS10.Checked = normalItem10Array[1] == "1" ? true : false; CBQ10.Checked = normalItem10Array[2] == "1" ? true : false; } string[] normalItem11Array = Rs3[0, "normalItem11"].ToString().Split('&'); if (normalItem11Array.Length == 3) { SQ11.Text = normalItem11Array[0]; CBS11.Checked = normalItem11Array[1] == "1" ? true : false; CBQ11.Checked = normalItem11Array[2] == "1" ? true : false; } //特殊授权 string[] specialItem1Array = Rs3[0, "specialItem1"].ToString().Split('&'); if (specialItem1Array.Length == 3) { TB1.Text = specialItem1Array[0]; CB1.Checked = specialItem1Array[1] == "1" ? true : false; CB11.Checked = specialItem1Array[2] == "1" ? true : false; } string[] specialItem2Array = Rs3[0, "specialItem2"].ToString().Split('&'); if (specialItem2Array.Length == 3) { TB2.Text = specialItem2Array[0]; CB2.Checked = specialItem2Array[1] == "1" ? true : false; CB12.Checked = specialItem2Array[2] == "1" ? true : false; } string[] specialItem3Array = Rs3[0, "specialItem3"].ToString().Split('&'); if (specialItem3Array.Length == 3) { TB3.Text = specialItem3Array[0]; CB3.Checked = specialItem3Array[1] == "1" ? true : false; CB13.Checked = specialItem3Array[2] == "1" ? true : false; } string[] specialItem4Array = Rs3[0, "specialItem4"].ToString().Split('&'); if (specialItem4Array.Length == 3) { TB4.Text = specialItem4Array[0]; CB4.Checked = specialItem4Array[1] == "1" ? true : false; CB14.Checked = specialItem4Array[2] == "1" ? true : false; } string[] specialItem5Array = Rs3[0, "specialItem5"].ToString().Split('&'); if (specialItem1Array.Length == 3) { TB5.Text = specialItem5Array[0]; CB5.Checked = specialItem5Array[1] == "1" ? true : false; CB15.Checked = specialItem5Array[2] == "1" ? true : false; } string[] specialItem6Array = Rs3[0, "specialItem6"].ToString().Split('&'); if (specialItem6Array.Length == 3) { TB6.Text = specialItem6Array[0]; CB6.Checked = specialItem6Array[1] == "1" ? true : false; CB16.Checked = specialItem6Array[2] == "1" ? true : false; } string[] specialItem7Array = Rs3[0, "specialItem7"].ToString().Split('&'); if (specialItem7Array.Length == 3) { TB7.Text = specialItem7Array[0]; CB7.Checked = specialItem7Array[1] == "1" ? true : false; CB17.Checked = specialItem7Array[2] == "1" ? true : false; } string[] specialItem8Array = Rs3[0, "specialItem8"].ToString().Split('&'); if (specialItem8Array.Length == 3) { TB8.Text = specialItem8Array[0]; CB8.Checked = specialItem8Array[1] == "1" ? true : false; CB18.Checked = specialItem8Array[2] == "1" ? true : false; } string[] specialItem9Array = Rs3[0, "specialItem9"].ToString().Split('&'); if (specialItem9Array.Length == 3) { TB9.Text = specialItem9Array[0]; CB9.Checked = specialItem9Array[1] == "1" ? true : false; CB19.Checked = specialItem9Array[2] == "1" ? true : false; } string[] specialItem10Array = Rs3[0, "specialItem10"].ToString().Split('&'); if (specialItem10Array.Length == 3) { TB10.Text = specialItem10Array[0]; CB10.Checked = specialItem10Array[1] == "1" ? true : false; CB20.Checked = specialItem10Array[2] == "1" ? true : false; } string[] specialItem11Array = Rs3[0, "specialItem11"].ToString().Split('&'); if (specialItem11Array.Length == 3) { TB11.Text = specialItem11Array[0]; CB111.Checked = specialItem11Array[1] == "1" ? true : false; CB21.Checked = specialItem11Array[2] == "1" ? true : false; } string[] str = Rs3[0, "otherItem"].ToString().Split('&'); for (int i = 0; i < CheckBoxList1.Items.Count; i++) { for (int j = 0; j < str.Length; j++) { if (CheckBoxList1.Items[i].Value == str[j]) { CheckBoxList1.Items[i].Selected = true; } } } } } }