protected void Button2_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string fileName = FileUpload1.FileName.ToString(); string uploadFolderPath = "~/img/"; string filePath = HttpContext.Current.Server.MapPath(uploadFolderPath); FileUpload1.SaveAs(filePath + "\\" + fileName); int a = 0; mydb db = new mydb(); cmd = new SqlCommand(); cmd.CommandText = "INSERT INTO Travel(ItemCode,Vehicle,Name,Bustype,Noofseats,Duration,Price,Description,Image)VALUES (@ItemCode,@Vehicle,@Name,@Bustype,@Noofseats,@Duration,@Price,@Description,@Image)"; cmd.Parameters.Add("@ItemCode", TextBox3.Text); cmd.Parameters.Add("@Vehicle", DropDownList4.Text); cmd.Parameters.Add("@Name", TextBox5.Text); cmd.Parameters.Add("@Bustype", DropDownList5.Text); cmd.Parameters.Add("@Noofseats", DropDownList1.Text); cmd.Parameters.Add("@Duration", TextBox2.Text); cmd.Parameters.Add("@Price", TextBox1.Text); cmd.Parameters.Add("@Description", TextBox4.Text); cmd.Parameters.Add("@Image", "~/img/" + fileName); a = db.insert(cmd); if (a == 1) { Response.Redirect("./addsuccess.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { SqlDataReader datar = SqlHelper.ExecuteReader("SELECT A.*,B.MC FROM HK_QYGG A LEFT OUTER JOIN HK_ZDYLX B ON(A.GGFL=B.ID) WHERE A.GGID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { ggflmc.Text = datar["mc"].ToString(); kssj.Text = string.Format("{0:d}", datar["kssj"]) + " 至 " + string.Format("{0:d}", datar["jssj"]); ggzt.Text = datar["ggzt"].ToString(); ggnr.Text = datar["ggnr"].ToString(); fqsj.Text = string.Format("{0:d}", datar["lrsj"]); Number.Text = datar["ggfj"].ToString(); datar.Close(); //附件 bd.GetAtt(Number.Text, "p02", "portal/gg", fujian); } else { datar.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("2"); if (!IsPostBack) { DataBindToDownList(); rqstr.Text = Server.UrlDecode(Request.QueryString["rqstr"].ToString()); str1 = "" + rqstr.Text + ""; ArrayList myarr = new ArrayList(); string[] mystr = str1.Split(','); for (int s = 0; s < mystr.Length; s++) { strlist += "'" + mystr[s] + "',"; } strlist += "'0'"; if (Request.QueryString["rqstr"] != null) { SqlDataReader datar = SqlHelper.ExecuteReader("SELECT role_id,role_name FROM JS WHERE role_id IN (" + strlist + ")"); while (datar.Read()) { ListItem theItem = new ListItem(); theItem.Text = datar["role_name"].ToString(); theItem.Value = datar["role_id"].ToString(); SelectedListBox.Items.Add(theItem); } datar.Close(); } } }
protected void Button2_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string fileName = FileUpload1.FileName.ToString(); string uploadFolderPath = "~/img/"; string filePath = HttpContext.Current.Server.MapPath(uploadFolderPath); FileUpload1.SaveAs(filePath + "\\" + fileName); int a = 0; mydb db = new mydb(); cmd = new SqlCommand(); cmd.CommandText = "INSERT INTO Decoration(Itemcode,Pandaltype,Sqfeet,Noofchair,Price,Description,Nooffans,Nooflights,Image)VALUES (@Itemcode,@Pandaltype,@Sqfeet,@Noofchair,@Price,@Description,@Nooffans,@Nooflights,@Image)"; cmd.Parameters.Add("@Itemcode", TextBox9.Text); cmd.Parameters.Add("@Pandaltype", TextBox10.Text); cmd.Parameters.Add("@Sqfeet", TextBox11.Text); cmd.Parameters.Add("@Noofchair", TextBox12.Text); cmd.Parameters.Add("@Price", TextBox13.Text); cmd.Parameters.Add("@Description", TextBox14.Text); cmd.Parameters.Add("@Nooffans", TextBox15.Text); cmd.Parameters.Add("@Nooflights", TextBox16.Text); cmd.Parameters.Add("@Image", "~/img/" + fileName); a = db.insert(cmd); if (a == 1) { Response.Redirect("./addsuccess.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("10202", "0"); SqlDataReader dr = SqlHelper.ExecuteReader("select gzzt,gznr,jhkssj,jhwcsj,yqjg,sjwcsj,sjwcqk,cyz from oa_gzjh02 where id='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (dr.Read()) { gzzt.Text = dr["gzzt"].ToString(); gznr.Text = dr["gznr"].ToString(); jhkssj.Text = string.Format("{0:d}", dr["jhkssj"]); jhwcsj.Text = string.Format("{0:d}", dr["jhwcsj"]); yqjg.Text = dr["yqjg"].ToString(); sjwcsj.Text = dr["sjwcsj"].ToString(); sjwcjg.Text = dr["sjwcqk"].ToString(); //参与者 SendTo = dr["cyz"].ToString() + ","; SendToRealName = Convert.ToString(SqlHelper.ExecuteScalar("exec sp_IdToName '" + dr["cyz"].ToString() + "','1'")); dr.Close(); } else { dr.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } txtSendTo.Text = SendToRealName; hdnTxtSendTo.Text = SendTo; }
public static string checkevents() { mydb db = new mydb(); string st = "select event_id from tbl_events where event_date between dateadd(MINUTE,-1,GETDATE()) and dateadd(MINUTE,1,GETDATE()) and is_displayed = 0"; return(db.read_val(st)); }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { qy_fjylurl.Text = Convert.ToString(SqlHelper.ExecuteScalar("SELECT qy_fjylurl FROM qy WHERE qy_id='001'")); SqlDataReader datar = SqlHelper.ExecuteReader("select a.*,b.flmc from OA_XWNR a,oa_xwfl b where a.fl=b.flid and xwid='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { lblxwbt.Text = datar["xwbt"].ToString(); lblxwzy.Text = datar["xwzy"].ToString(); lblxwly.Text = datar["xwly"].ToString(); lblxwfl.Text = datar["flmc"].ToString(); lblxwzz.Text = datar["xwzz"].ToString(); lblnr.Text = datar["xwnr"].ToString(); lblxwsj.Text = hkdb.GetDate(datar["xwsj"].ToString()); savefj.Text = datar["fjmc"].ToString(); savelj.Text = datar["fjlj"].ToString(); savefj.NavigateUrl = (datar["fjlj"] == System.DBNull.Value ? "" : "../.." + datar["fjlj"].ToString()) + datar["fjmc"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert("此记录不存在,可能已被删除!"); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("9"); if (!IsPostBack) { SqlDataReader dr = SqlHelper.ExecuteReader("SELECT UI_ID,UI_DESC,UI_SEX,UI_BGDH,UI_YDDH,UI_CZDH,UI_MAIL,UI_CSRQ,UI_RZRQ,B.BM_MC,C.ZWMC,D.QY_QC FROM YH A LEFT OUTER JOIN BM B ON(A.UI_SSBM=B.BM_ID) LEFT OUTER JOIN ZW C ON(A.UI_ZW=C.ZWID) LEFT OUTER JOIN QY D ON (A.UI_SSGS=D.QY_ID) WHERE UI_ID='" + this.Session["userid"] + "'"); if (dr.Read()) { txtyhbm.Text = dr["ui_id"].ToString(); txtxm.Text = dr["ui_desc"].ToString(); xb.Text = dr["ui_sex"].ToString(); bgdh.Text = dr["ui_bgdh"].ToString(); yddh.Text = dr["ui_yddh"].ToString(); czdh.Text = dr["ui_czdh"].ToString(); mail.Text = dr["ui_mail"].ToString(); //csrq.Text = hkdb.GetDate(dr["ui_csrq"].ToString()); txtbm.Text = dr["bm_mc"].ToString(); txtzw.Text = dr["zwmc"].ToString(); txtssgs.Text = dr["qy_qc"].ToString(); txtrzrq.Text = hkdb.GetDate(dr["ui_rzrq"].ToString()); } dr.Close(); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("11506", "0"); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { lbltitle.Text = "查看"; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { SqlDataReader datar = SqlHelper.ExecuteReader("select * from OA_XMGL where xmid='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { xmid.Text = datar["xmid"].ToString(); xmmc.Text = datar["xmmc"].ToString(); sssf.Text = datar["sssf"].ToString(); xmjd.SelectedValue = datar["xmjd"].ToString(); sscs.Text = datar["sscs"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("11714", "0"); SqlDataReader datar = SqlHelper.ExecuteReader("select * from OA_KQ_AttenTime where CHARINDEX('" + this.Session["UserID"] + "',SyUsername)>0 AND QyType='正常' "); if (datar.Read()) { lblPbType.Text = datar["PbType"].ToString(); lblQyType.Text = datar["QyType"].ToString(); lblDjType_1.Text = datar["DjType_1"].ToString(); lblDjType_2.Text = datar["DjType_2"].ToString(); lblDjType_3.Text = datar["DjType_3"].ToString(); lblDjType_4.Text = datar["DjType_4"].ToString(); lblDjType_5.Text = datar["DjType_5"].ToString(); lblDjType_6.Text = datar["DjType_6"].ToString(); lblDjTime_1.Text = datar["DjTime_1"].ToString(); lblDjTime_2.Text = datar["DjTime_2"].ToString(); lblDjTime_3.Text = datar["DjTime_3"].ToString(); lblDjTime_4.Text = datar["DjTime_4"].ToString(); lblDjTime_5.Text = datar["DjTime_5"].ToString(); lblDjTime_6.Text = datar["DjTime_6"].ToString(); datar.Close(); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); usname = this.Session["username"].ToString(); this.SaveBtn.Attributes.Add("onclick", "javascript: SaveFile();"); if (!IsPostBack) { adfile = Request.QueryString["file"].ToString(); number = Request.QueryString["number"].ToString(); SqlDataReader dr = SqlHelper.ExecuteReader("SELECT attName FROM hk_AttUpload WHERE attNewName='" + hkdb.GetStr(Request.QueryString["file"]) + "' AND attClass='w01'"); if (dr.Read()) { adname = dr["attName"].ToString(); } dr.Close(); if (Request.QueryString["filetype"].ToString() == ".doc" || Request.QueryString["filetype"].ToString() == ".DOC") { prnBtn.Visible = true; clrTrkBtn.Visible = true; TrkBtn.Visible = true; unTrkBtn.Visible = true; dp_admindoc.Visible = true; Button3.Visible = true; } if (Request.QueryString["filetype"].ToString() == ".xls" || Request.QueryString["filetype"].ToString() == ".XLS") { prnBtn.Visible = false; clrTrkBtn.Visible = false; TrkBtn.Visible = false; unTrkBtn.Visible = false; dp_admindoc.Visible = false; Button3.Visible = false; } if (Request.QueryString["filetype"].ToString() == ".ppt" || Request.QueryString["filetype"].ToString() == ".PPT") { prnBtn.Visible = true; clrTrkBtn.Visible = false; TrkBtn.Visible = false; unTrkBtn.Visible = false; dp_admindoc.Visible = false; Button3.Visible = false; } string sql_admindoc = "SELECT * FROM hk_AdminDoc WHERE adType='" + hkdb.GetStr(Request.QueryString["filetype"].ToString()) + "' AND (CHARINDEX('," + this.Session["userid"].ToString() + ",',','+adUserIDs+',') > 0)"; bd.Bind_DropDownList(dp_admindoc, sql_admindoc, "adNewName", "adName", "请选择", "请选择"); } string fileName = System.IO.Path.GetFileName(Request.QueryString["file"].ToString()); extfilename = System.IO.Path.GetExtension(fileName); }
protected void Button2_Click(object sender, EventArgs e) { int r; mydb db = new mydb(); com = new SqlCommand(); com.CommandText = "SELECT FirstName,LastName,Address,Mobile,Email FROM Register where Email = @Email AND Password = @Password "; com.Parameters.Add("@Email", TextBox3.Text); com.Parameters.Add("@Password", TextBox4.Text); dt = db.gettable(com); if (dt.Rows.Count == 1) { //gen.apwd = "" + TextBox4.Text; gen.name = dt.Rows[0][0].ToString().Trim() + " " + dt.Rows[0][1].ToString().Trim(); gen.add = dt.Rows[0][2].ToString().Trim(); gen.ph = dt.Rows[0][3].ToString().Trim(); gen.email = dt.Rows[0][4].ToString().Trim(); gen.vcode = ""; gen.vtype = ""; gen.vprice = "" + 0; gen.scode = ""; gen.stype = ""; gen.sprice = "" + 0; gen.pcode = ""; gen.ptype = ""; gen.pprice = "" + 0; gen.ccode = ""; gen.ctype = ""; gen.cprice = "" + 0; gen.tcode = ""; gen.ttype = ""; gen.tprice = "" + 0; gen.fcode = ""; gen.ftype = ""; gen.fprice = "" + 0; gen.sgcode = ""; gen.sgtype = ""; gen.sgprice = "" + 0; Response.Redirect("pgm.aspx"); } else { Label1.Text = "Login Failed...."; } }
protected string outdaycolor; //休息日 protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("3"); indaycolor = "red"; outdaycolor = "#ffff00"; if (!IsPostBack) { hkdb.PassTo("11712", "0"); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { year.SelectedValue = string.Format("{0:yyyy}", DateTime.Now); string begintime = year.SelectedValue + "-01-01"; string endtime = year.SelectedValue + "-12-31"; //页面绑定 BindData(Request.QueryString["id"].ToString(), begintime, endtime); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { qy_fjylurl.Text = Convert.ToString(SqlHelper.ExecuteScalar("SELECT qy_fjylurl FROM qy WHERE qy_id='001'")); if (!string.IsNullOrEmpty(Request.QueryString["id"].ToString())) { SqlDataReader datar = SqlHelper.ExecuteReader("SELECT A.*,B.MC FROM HK_SPDB A LEFT OUTER JOIN HK_ZDYLX B ON (A.SPLX=B.ID) WHERE A.SPID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { spmc.Text = datar["spmc"].ToString(); sply.Text = datar["sply"].ToString(); splx.Text = datar["mc"].ToString(); spjj.Text = datar["spjj"].ToString(); savefj1.Text = datar["jmmc"].ToString(); savelj.Text = datar["jmlj"].ToString(); savefj1.NavigateUrl = (datar["jmlj"] == System.DBNull.Value ? "" : "../.." + datar["jmlj"].ToString()) + datar["jmmc"].ToString(); savefj.MediaUrl = (datar["jmlj"] == System.DBNull.Value ? "" : "../.." + datar["jmlj"].ToString()) + datar["jmmc"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("3"); if (!IsPostBack) { hkdb.PassTo("11306", "11306"); //类型 if (this.Session["systype"].ToString() == "A") //主登录页 { SqlDataReader datar1 = SqlHelper.ExecuteReader("SELECT xh FROM hk_Init WHERE produID IN('M','V','F')"); if (datar1.Read()) { lx.Visible = true; } datar1.Close(); } else //子登录页 { if (this.Session["systype"].ToString() == "M" | this.Session["systype"].ToString() == "V" | this.Session["systype"].ToString() == "F") { lx.Visible = true; } } AspNetPager1.PageSize = int.Parse(Request.Cookies["haoke"].Values["pagecount"]); //页面绑定 LabelBind(); GridViewBind(); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("11724", "0"); if (!string.IsNullOrEmpty(Request.QueryString["id"])) { SqlDataReader datar = SqlHelper.ExecuteReader("select * from OA_QXDJ where djid='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { bt.Text = datar["bt"].ToString(); kssj.Text = datar["kssj"].ToString(); jzsj.Text = datar["jzsj"].ToString(); UserName.Text = datar["wcrNames"].ToString(); lxff.Text = datar["lxff"].ToString(); sm.Text = datar["sm"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("10111", "0"); SqlDataReader datar = SqlHelper.ExecuteReader("select * from OA_KnowLedge where ID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { LittleName.Text = datar["LittleName"].ToString(); TitleName.Text = datar["Title"].ToString(); Content.Text = datar["Content"].ToString(); AthourSay.Text = datar["AthourSay"].ToString(); KeyWord.Text = datar["KeyWord"].ToString(); UserName.Text = datar["QxYdRealname"].ToString(); Settime.Text = datar["Settime"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { DropDownListBind(); SqlDataReader dr = SqlHelper.ExecuteReader("select ui_csrq,ui_desc,ui_zw,ui_ssbm,ui_id,ui_desc,ui_sex,ui_bgdh,ui_yddh,ui_czdh,ui_mail from yh where ui_id='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (dr.Read()) { yhbm.Text = dr["ui_id"].ToString(); xm.Text = dr["ui_desc"].ToString(); xb.SelectedValue = dr["ui_sex"].ToString(); bgdh.Text = dr["ui_bgdh"].ToString(); yddh.Text = dr["ui_yddh"].ToString(); czdh.Text = dr["ui_czdh"].ToString(); mail.Text = dr["ui_mail"].ToString(); ssbm.SelectedValue = dr["ui_ssbm"].ToString(); zw.SelectedValue = dr["ui_zw"].ToString(); xmxm.Text = dr["ui_desc"].ToString(); csrq.Text = string.Format("{0:d}", dr["ui_csrq"]); } dr.Close(); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("10109", "0"); } //获取参数 if (Request.Params["DirID"] != null) { if (Int32.TryParse(Request.Params["DirID"].ToString(), out nFileID) == false) { return; } } if (!IsPostBack) { if (nFileID > -1) { BindFileData(nFileID); } } }
private void LOGIN_Click(object sender, EventArgs e) { mydb db = new mydb(); bool b; Utulisateur newusers = new Utulisateur(); droitacces droit = new droitacces(); db.Chargerlesinfos(newusers); string nom = username.Text.ToString(); string password = this.password.Text.ToString(); Utulisateur newuser = newusers.Session(newusers, nom, password); if (newuser == null) { b = false; } else { b = true; } if (b) { session session = new session(newuser, this); username.Text = ""; this.password.Text = ""; this.Visible = false; session.Visible = true; } else { MessageBox.Show("wrong passwordor username !"); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); int i = 0; int NodeId; if (!IsPostBack) { hkdb.PassTo("11307", "0"); SqlDataReader dataR = SqlHelper.ExecuteReader("SELECT ID,PROJECTNAME,PROJECTTYPE FROM HK_POLL_PROJECT ORDER BY PROJECTTYPE,ID"); TreeNode[] menuNodes = new TreeNode[1001]; for (i = 0; i <= menuNodes.Length - 1; i++) { menuNodes[i] = new TreeNode(); } while (dataR.Read()) { NodeId = (int)dataR["id"]; menuNodes[NodeId].Text = "[" + dataR["ProjectType"].ToString() + "]" + dataR["ProjectName"].ToString(); menuNodes[NodeId].NavigateUrl = "tmsz_r.aspx?ClassID=" + dataR["ProjectName"].ToString() + "&id=" + NodeId + ""; menuNodes[NodeId].Target = "rframe11307"; TreeView1.Nodes.Add(menuNodes[NodeId]); } dataR.Close(); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("3"); if ((Request["ListType"] != null)) { ListType = Int32.Parse(Request["ListType"].ToString()); } else { ListType = 1; } if (!IsPostBack) { hkdb.PassTo("11003", "11003"); AspNetPager1.PageSize = int.Parse(Request.Cookies["haoke"].Values["pagecount"]); //页面绑定 GridViewBind(); } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("10109", "0"); AspNetPager1.PageSize = int.Parse(Request.Cookies["haoke"].Values["pagecount"]); //判断文件夹 string sql = "SELECT * FROM hk_NetDisk_Dir WHERE UserID='" + this.Session["userid"] + "'"; if (bd.CheckRepeat(sql) == "true") { DelBtn.Enabled = true; //UpBtn.Enabled = true; DropDownListBind(); GridViewBind(); } else { DelBtn.Enabled = false; //UpBtn.Enabled = false; } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"].ToString())) { SqlDataReader datar = SqlHelper.ExecuteReader("SELECT * FROM HK_DWML WHERE ID='" + hkdb.GetStr(Request.QueryString["id"].ToString()) + "'"); if (datar.Read()) { dwmc.Text = datar["dwmc"].ToString(); dwdz.Text = datar["dwdz"].ToString(); dwlx.Text = datar["dwlx"].ToString(); dwjb.Text = datar["dwjb"].ToString(); sjbm.Text = datar["sjbm"].ToString(); fzr.Text = datar["fzr"].ToString(); yzbm.Text = datar["yzbm"].ToString(); dwdh.Text = datar["dwdh"].ToString(); czhm.Text = datar["czhm"].ToString(); dzyj.Text = datar["dzyj"].ToString(); jdjs.Text = datar["jdjs"].ToString(); bz.Text = datar["bz"].ToString(); datar.Close(); } else { datar.Close(); mydb.Alert_Close("此记录不存在,可能已被删除!"); } } } }
protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string fileName = FileUpload1.FileName.ToString(); string uploadFolderPath = "~/img/"; string filePath = HttpContext.Current.Server.MapPath(uploadFolderPath); FileUpload1.SaveAs(filePath + "\\" + fileName); int a = 0; mydb db = new mydb(); cmd = new SqlCommand(); cmd.CommandText = "INSERT INTO Food(ItemCode,Name,Price,Receipe,Description,Image)VALUES (@ItemCode,@Name,@Price,@Receipe,@Description,@Image)"; cmd.Parameters.Add("@ItemCode", TextBox6.Text); cmd.Parameters.Add("@Name", TextBox7.Text); cmd.Parameters.Add("@Price", TextBox8.Text); cmd.Parameters.Add("@Receipe", TextBox9.Text); cmd.Parameters.Add("@Description", TextBox10.Text); cmd.Parameters.Add("@Image", "~/img/" + fileName); a = db.insert(cmd); if (a == 1) { Response.Redirect("./addsuccess.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("3"); if (!IsPostBack) { string b = ""; if (Request.QueryString["i"] != "2") { b = "10103"; } else { b = "0"; } hkdb.PassTo("10103", b); AspNetPager1.PageSize = int.Parse(Request.Cookies["haoke"].Values["pagecount"]); GridViewBind(); } }
public static string isClosed(string orderid) { mydb db = new mydb(); string st = ""; st = "select isClosed from tbl_orders where order_id=" + orderid; return(db.read_val(st)); }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("1"); SqlHelper.ExecuteSql("UPDATE YH SET LASTTIME=GETDATE() WHERE UI_ID='" + this.Session["userid"] + "'"); }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("1"); BindTree(ListTreeView.Nodes, 0); }
protected void Page_Load(object sender, EventArgs e) { mydb hkdb = new mydb(); hkdb.VeriSess("4"); if (!IsPostBack) { hkdb.PassTo("60101", "0"); string Sql = " where modu_lx<>'G'"; if (this.Session["systype"].ToString() == "A") //主登录页 { string str = null; SqlDataReader datar1 = SqlHelper.ExecuteReader("SELECT ProduID FROM hk_Init"); while (datar1.Read()) { str = str + "','" + datar1["ProduID"].ToString(); } datar1.Close(); Sql = Sql + " and modu_lx in ('" + str + "')"; } else //子登录页 { Sql = Sql + " and (modu_lx='" + this.Session["systype"] + "' or modu_lx='P')"; } int i = 0; int ParentNode; int NodeId; SqlDataReader datar = SqlHelper.ExecuteReader("SELECT MODU_ID,MODU_MC,MODU_UPID FROM hk_Modu " + Sql + " ORDER BY ORDERID"); TreeNode[] menuNodes = new TreeNode[100001]; for (i = 0; i <= menuNodes.Length - 1; i++) { menuNodes[i] = new TreeNode(); } while (datar.Read()) { ParentNode = Convert.ToInt32(datar["modu_upid"]); NodeId = Convert.ToInt32(datar["modu_id"]); menuNodes[NodeId].Text = (string)datar["modu_mc"]; menuNodes[NodeId].NavigateUrl = "mk_r.aspx?ClassID=" + NodeId; menuNodes[NodeId].Target = "rframe60101"; if (ParentNode != 0) { menuNodes[ParentNode].ChildNodes.Add(menuNodes[NodeId]); } else { TreeView1.Nodes.Add(menuNodes[NodeId]); } } datar.Close(); } }