protected void Button2_Click(object sender, EventArgs e) { int amount = Convert.ToInt32(this.TextBox2.Text); int tagindex = -1; foreach (GridViewRow GR in this.GridView1.Rows) { CheckBox CB = (CheckBox)GR.FindControl("CheckBox1"); if (CB.Checked) { tagindex = GR.RowIndex; } } int bookamount = Convert.ToInt32(this.GridView1.Rows[tagindex].Cells[5].Text); int decrease = bookamount - amount; DataManage dm = new DataManage(); if (decrease > 0) { string sql = "update [Library].[library].[Book] set [Bamount] =" + decrease + "where [Bname] like '" + this.GridView1.Rows[tagindex].Cells[1].Text + "' and [Btype] like '" + this.GridView1.Rows[tagindex].Cells[2].Text + "' and [Bwriter] like '" + this.GridView1.Rows[tagindex].Cells[3].Text + "' and [Bpublish] like '" + this.GridView1.Rows[tagindex].Cells[4].Text + "'"; dm.ExecuteSql(sql); } else { string sql = "delete from [Library].[library].[Book] where [Bname] like '" + this.GridView1.Rows[tagindex].Cells[1].Text + "' and [Btype] like '" + this.GridView1.Rows[tagindex].Cells[2].Text + "' and [Bwriter] like '" + this.GridView1.Rows[tagindex].Cells[3].Text + "' and [Bpublish] like '" + this.GridView1.Rows[tagindex].Cells[4].Text + "'"; dm.ExecuteSql(sql); } Response.Write("<script>alert('出库成功!')</script>"); databind(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <ApplicationDbContext>(options => options.UseNpgsql( DataManage.GetConnectionString(Configuration))); services.AddDatabaseDeveloperPageExceptionFilter(); services.AddIdentity <ApplicationUser, IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true) .AddDefaultUI() .AddDefaultTokenProviders() .AddEntityFrameworkStores <ApplicationDbContext>(); services.AddIdentityServer() .AddApiAuthorization <ApplicationUser, ApplicationDbContext>(); services.AddAuthentication() .AddIdentityServerJwt(); services.AddControllersWithViews(); services.AddRazorPages(); // In production, the Angular files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/dist"; }); }
private void databind() { string tag = this.DropDownList1.Text; int tagindex = (int)this.DropDownList1.SelectedIndex; string keyword = TextBox1.Text; string sql = " "; DataManage dm = new DataManage(); if (tagindex == 0) { sql = "select * from [Library].[library].[Book] where [Bname] like '" + keyword + "'"; } else if (tagindex == 1) { sql = "select * from [Library].[library].[Book] where [Bwriter] like '" + keyword + "'"; } else { sql = "select * from [Library].[library].[Book] where [Bpublish] like '" + keyword + "'"; } DataSet ds = dm.ReadSet(sql); this.GridView1.DataSource = ds; this.GridView1.DataBind(); }
private void hotdata(int bookid, string bookname) //hot表插数据 { int id = bookid; string name = bookname; string sql_book_search = "select * from [Library].[library].[Book] where [Bid] like " + id; DataManage dm = new DataManage(); DataTable dt = dm.ReadTable(sql_book_search); string Hbname = dt.Rows[0][1].ToString(); string Hbwriter = dt.Rows[0][3].ToString(); string Hbpublisher = dt.Rows[0][4].ToString(); string Hbtype = dt.Rows[0][2].ToString(); string sql_hot_search = "select * from [Library].[library].[Hot] where [Hbname] like '" + name + "'"; string sql_hot_insert = "insert into [Library].[library].[Hot] ([Hbname],[Hbwriter],[Hbpublisher],[Hbtype],[Hot]) values ('" + Hbname + "','" + Hbwriter + "','" + Hbpublisher + "','" + Hbtype + "',1)"; string sql_hot_update = string.Empty; DataTable dt_2 = dm.ReadTable(sql_hot_search); if (dt_2.Rows.Count > 0) { int count = Convert.ToInt32(dt_2.Rows[0][5].ToString()) + 1; sql_hot_update = "update [Library].[library].[Hot] set [Hot] = " + count + " where [Hbname] like '" + name + "'"; dm.ExecuteSql(sql_hot_update); } else { dm.ExecuteSql(sql_hot_insert); } }
protected void Button1_Click(object sender, EventArgs e) { string tag = this.DropDownList1.Text; int tagindex = (int)this.DropDownList1.SelectedIndex; string keyword = this.TextBox1.Text; string sql = " "; DataManage dm = new DataManage(); if (tagindex == 0) { sql = "select [Adminid],[Adminname],[Adminnum] from [Library].[library].[Admin] where [Adminname] like '" + keyword + "'"; } else if (tagindex == 1) { sql = "select [Adminid],[Adminname],[Adminnum] from [Library].[library].[Admin] where [Adminnum] like '" + keyword + "'"; } else { Response.Write("<script>alert('找不到该用户!')</script>"); } DataSet ds = dm.ReadSet(sql); this.GridView1.DataSource = ds; this.GridView1.DataBind(); }
protected void Button4_Click(object sender, EventArgs e) { DataTable dt = getGridviewTable(); DataManage dm = new DataManage(); //string insql = "insert into [Library].[library].[Book] ([Bname], [Btype],[Bwriter],[Bpublish],[Bamount],[Bprice]) VALUES('{0}','{1}','{2}','{3}',{4},{5})"; int dtcount = dt.Rows.Count; for (int i = 0; i < dtcount; i++) { string selectsql = "select * from [Library].[library].[Book] where [Bname] like '" + dt.Rows[i][0] + "' and [Bwriter] like '" + dt.Rows[i][2] + "'"; int amount; DataTable table = dm.ReadTable(selectsql); if (table.Rows.Count > 0) { amount = Convert.ToInt32(dt.Rows[i][4]) + (int)table.Rows[0][5]; string updatesql = "update [Library].[library].[Book] set [Bamount] =" + amount + "where [Bname] like '" + dt.Rows[i][0] + "' and [Bwriter] like '" + dt.Rows[i][2] + "'"; dm.ExecuteSql(updatesql); } else { //insql = string.Format(insql, dt.Rows[i][0], dt.Rows[i][1], dt.Rows[i][2], dt.Rows[i][3], dt.Rows[i][4], dt.Rows[i][5]); string insql = "insert into [Library].[library].[Book] ([Bname], [Btype],[Bwriter],[Bpublish],[Bamount],[Bprice]) VALUES('" + dt.Rows[i][0] + "','" + dt.Rows[i][1] + "','" + dt.Rows[i][2] + "','" + dt.Rows[i][3] + "'," + dt.Rows[i][4] + "," + dt.Rows[i][5] + ")"; dm.ExecuteSql(insql); } } Response.Write("<script>alert('导入成功!')</script>"); }
private void databind() { DataManage dm = new DataManage(); int id = Convert.ToInt32(Request.QueryString["id"]); string sql_1 = "select * from [Library].[library].[Book] where [Bid] like " + id; DataTable dt_1 = dm.ReadTable(sql_1); int numall = Convert.ToInt32(dt_1.Rows[0][5]); //总数量 string sql_2 = "select count(*) from [Library].[library].[Borrow] where [BorrowBid] like " + id + " and [Bookstate] like 'Unreturn'"; DataTable dt_2 = dm.ReadTable(sql_2); int numout = Convert.ToInt32(dt_2.Rows[0][0]); //外借数量 int remains = numall - numout; if (remains > 0) { this.Button1.Visible = false; } else { this.Button1.Visible = true; } this.Label1.Text = dt_1.Rows[0][0].ToString(); this.Label2.Text = dt_1.Rows[0][1].ToString(); this.Label3.Text = dt_1.Rows[0][2].ToString(); this.Label4.Text = dt_1.Rows[0][3].ToString(); this.Label5.Text = dt_1.Rows[0][4].ToString(); this.Label6.Text = remains.ToString(); this.Label7.Text = dt_1.Rows[0][6].ToString(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <ApplicationDbContext>(options => options.UseNpgsql( DataManage.GetConnectionString(Configuration))); services.AddDatabaseDeveloperPageExceptionFilter(); services.AddIdentity <CustomUser, IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true) .AddDefaultUI() .AddDefaultTokenProviders() .AddEntityFrameworkStores <ApplicationDbContext>(); services.AddControllersWithViews(); services.AddRazorPages(); services.AddMvc().AddNewtonsoftJson(); services.AddScoped <IImageService, ImageService>(); services.TryAddSingleton <IHttpContextAccessor, HttpContextAccessor>(); services.AddScoped <IHttpConnectionFeature, HttpConnectionFeature>(); services.Configure <MailSettings>(Configuration.GetSection("MailSettings")); services.AddScoped <IEmailSender, EmailService>(); services.AddSingleton <IActionContextAccessor, ActionContextAccessor>(); services.AddScoped <IUserDetector, UserDetector>(); services.AddScoped <ICreateTemporaryUser, CreateTemporaryUser>(); services.AddScoped <ISlugService, SlugService>(); services.AddScoped <ICanUserComment, CanUserComment>(); }
DataManage dataManage; //数据管理类 protected void GetSelfData() //获取自身数据 { dataManage = FindObjectOfType <DataManage>(); JsonData data = dataManage.allDate; data = dataManage.GetDataByName(name);//根据名字获取数据 CharacterName = data["CharacterName"].ToString(); hp = float.Parse(data["Hp"].ToString()); //生命值 ad = float.Parse(data["Ad"].ToString()); //攻击力 ap = float.Parse(data["Ap"].ToString()); //法强 adr = float.Parse(data["Adr"].ToString()); //物理抗性 apr = float.Parse(data["Apr"].ToString()); //魔法抗性 attackSpeed = float.Parse(data["AttackSpeed"].ToString()); //攻速 cc = float.Parse(data["Cc"].ToString()); //暴击率 cm = float.Parse(data["Cm"].ToString()); //暴击倍数 adp = float.Parse(data["Adp"].ToString()); //物理穿透 app = float.Parse(data["App"].ToString()); //法术穿透 moveSpeed = float.Parse(data["MoveSpeed"].ToString()); //移动速度 rotateSpeed = float.Parse(data["RotateSpeed"].ToString()); //转身速度 attackRange = float.Parse(data["AttackRange"].ToString()); //攻击范围 viewRange = float.Parse(data["ViewRange"].ToString()); //视野范围 waterConsume = float.Parse(data["WaterConsume"].ToString()); //圣水消耗 spiritConsume = float.Parse(data["SpiritConsume"].ToString()); //精魄消耗 }
protected void Button1_Click(object sender, EventArgs e) { string keyword = this.TextBox1.Text; DataManage dm = new DataManage(); string sql_1 = "select * from [Library].[library].[Book] where [Bname] like '" + keyword + "'"; string sql_2 = "select * from [Library].[library].[Book] where [Bwriter] like '" + keyword + "'"; DataTable dt_1 = dm.ReadTable(sql_1); DataTable dt_2 = dm.ReadTable(sql_2); if (dt_1.Rows.Count > 0) { string url_1 = "SearchResult.aspx?Bookname=" + keyword; Response.Redirect(url_1, true); } else if (dt_2.Rows.Count > 0) { string url_2 = "SearchResult.aspx?BookWriter=" + keyword; Response.Redirect(url_2, true); } else { Response.Redirect("NotFound.aspx", true); } }
private void databind() { DataManage dm = new DataManage(); DataTable dt = new DataTable(); string bookname = Request.QueryString["Bookname"]; string bookwriter = Request.QueryString["BookWriter"]; if (bookname != null) { //Response.Write("<script>alert('书名不空')</script>"); string sql_1 = "select * from [Library].[library].[Book] where [Bname] like '" + bookname + "'"; dt = dm.ReadTable(sql_1); } else if (bookwriter != null) { //Response.Write("<script>alert('作者不空')</script>"); string sql_2 = "select * from [Library].[library].[Book] where [Bwriter] like '" + bookwriter + "'"; dt = dm.ReadTable(sql_2); } else { Response.Write("<script>alert('查找失败!')</script>"); } PagedDataSource pds = new PagedDataSource(); pds.DataSource = dt.DefaultView; DataList1.DataSource = pds; DataList1.DataBind(); }
public void Save(int ID) { _Id = transform.Find("Scroll/Viewport/Content/obj" + ID + "/Id").GetComponent <InputField>(); _Type = transform.Find("Scroll/Viewport/Content/obj" + ID + "/Type").GetComponent <Dropdown>(); _IsDispel = transform.Find("Scroll/Viewport/Content/obj" + ID + "/IsDispel").GetComponent <Dropdown>(); _IsSuperposition = transform.Find("Scroll/Viewport/Content/obj" + ID + "/IsSuperposition").GetComponent <Dropdown>(); _TimeDuration = transform.Find("Scroll/Viewport/Content/obj" + ID + "/TimeDuration").GetComponent <InputField>(); _Explain = transform.Find("Scroll/Viewport/Content/obj" + ID + "/Explain").GetComponent <InputField>(); try { talentSkill_Buff[ID].Id = int.Parse(_Id.text); talentSkill_Buff[ID].Type = _Type.value; talentSkill_Buff[ID].IsSuperposition = _IsSuperposition.value; talentSkill_Buff[ID].TimeDuration = int.Parse(_TimeDuration.text); talentSkill_Buff[ID].Explain = _Explain.text; } catch (Exception ex) { WindowControl.SetConsole("输入类型不对,详细:" + ex); return; } if (DataManage.SavetalentSkill_Buff(talentSkill_Buff, ID)) { talentSkill_Buff[ID].IsJson = true; } }
public void Save(int ID) { _HeroID = transform.Find("Viewport/Content/obj" + ID + "/HeroID").GetComponent <InputField>(); _FetterID = transform.Find("Viewport/Content/obj" + ID + "/FetterID").GetComponent <InputField>(); _NeedHeroPlan = transform.Find("Viewport/Content/obj" + ID + "/NeedHeroPlan"); _PropertyAddPlan = transform.Find("Viewport/Content/obj" + ID + "/PropertyAddPlan"); try { Fetters[ID].HeroID = int.Parse(_HeroID.text); Fetters[ID].FrtterId = int.Parse(_FetterID.text); for (int i = 0; i < _NeedHeroPlan.childCount; i++) { Fetters[ID].NeedHeroList.Add(transform.Find("Viewport/Content/obj" + ID + "/NeedHeroPlan/Hero" + (i + 1))); } for (int i = 0; i < _PropertyAddPlan.childCount; i++) { Fetters[ID].PropertyAddList.Add(transform.Find("Viewport/Content/obj" + ID + "/PropertyAddPlan/Property" + (i + 1))); } } catch (Exception ex) { // 错误处理代码 WindowControl.SetConsole("保存失败,你填写的数据类型不对,详细:" + ex.Message); //transform.parent.Find("Console/Text").GetComponent<Text>().text = "保存失败,你填写的数据类型不对,详细:"+ex.Message+"--------------时间:"+DateTime.Now.ToString(); return; } if (DataManage.SaveFetterData(Fetters, ID)) { Fetters[ID].IsJson = true; } Fetters[ID].NeedHeroList.Clear(); Fetters[ID].PropertyAddList.Clear(); //transform.parent.Find("Console/Text").GetComponent<Text>().text = "保存成功-----------------时间"+DateTime.Now.ToString(); }
public void Save(int ID) { Level = transform.Find("Scroll/Viewport/Content/obj" + ID + "/Level").GetComponent <InputField>(); BreakNum = transform.Find("Scroll/Viewport/Content/obj" + ID + "/BreakNum").GetComponent <InputField>(); ConsumptionGold = transform.Find("Scroll/Viewport/Content/obj" + ID + "/ConsumptionGold").GetComponent <InputField>(); ConsumptionBG = transform.Find("Scroll/Viewport/Content/obj" + ID + "/ConsumptionBG").GetComponent <InputField>(); ConsumptionEssence = transform.Find("Scroll/Viewport/Content/obj" + ID + "/ConsumptionEssence").GetComponent <InputField>(); try { breakGrows[ID].Level = int.Parse(Level.text); breakGrows[ID].BreakNum = int.Parse(BreakNum.text); breakGrows[ID].ConsumptionGold = int.Parse(ConsumptionGold.text); breakGrows[ID].ConsumptionBG = int.Parse(ConsumptionBG.text); breakGrows[ID].ConsumptionEssence = int.Parse(ConsumptionEssence.text); } catch (Exception ex) { WindowControl.SetConsole("输入类型不对,详细:" + ex); return; } if (DataManage.SaveBreakGrowsJson(breakGrows, ID)) { breakGrows[ID].IsJson = true; } }
public void BaseChangSave() { int id = -1; for (int i = 0; i < HeroData.heroData.Count; i++) { if (HeroData.heroData[i + 1].ID == heroMessage.HeroID) { HeroData.heroData[i + 1].Vitality = int.Parse(_Test_Base_Vitality.text); HeroData.heroData[i + 1].Attack = int.Parse(_Test_Base_ATK.text); HeroData.heroData[i + 1].AttackSpeed = int.Parse(_Test_Base_Speed.text); HeroData.heroData[i + 1].Skill = int.Parse(_Test_Base_Skill.text); HeroData.heroData[i + 1].HitRate = int.Parse(_Test_Base_HitRate.text); HeroData.heroData[i + 1].Dodge = int.Parse(_Test_Base_Dodge.text); HeroData.heroData[i + 1].CriticalStrike = int.Parse(_Test_Base_Crit.text); HeroData.heroData[i + 1].Tenacity = int.Parse(_Test_Base_Tenacity.text); HeroData.heroData[i + 1].Defense = int.Parse(_Test_Base_Defense.text); HeroData.heroData[i + 1].ActGrow = int.Parse(_Test_Base_AttacksGrow.text); HeroData.heroData[i + 1].VitalityGrow = int.Parse(_Test_Base_VitalityGrow.text); HeroData.heroData[i + 1].ActSpeedGrow = int.Parse(_Test_Base_SpeedGrow.text); HeroData.heroData[i + 1].TowerActFrequency = int.Parse(_Test_Base_TowerATKFrequency.text); id = i + 1; break; } } if (DataManage.HeroDataSave(HeroData.heroData, id)) { WindowControl.SetConsole("保存成功"); } else { WindowControl.SetConsole("保存失败"); } }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <ApplicationDbContext>(options => options.UseNpgsql( DataManage.GetConnectionString(Configuration))); services.AddDatabaseDeveloperPageExceptionFilter(); services.AddIdentity <CustomUser, IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true) .AddDefaultUI() .AddDefaultTokenProviders() .AddEntityFrameworkStores <ApplicationDbContext>(); services.AddControllersWithViews(); services.AddRazorPages(); services.AddTransient <IImageService, BasicImageService>(); services.AddTransient <IEmailSender, EmailService>(); services.Configure <MailSettings>(Configuration.GetSection("MailSettings")); services.AddScoped <ICustomRoleService, CustomRoleService>(); services.AddScoped <ICustomProjectService, CustomProjectService>(); services.AddScoped <ICustomHistoryService, CustomHistoryService>(); services.AddScoped <ICustomFileService, CustomFileService>(); services.AddScoped <ICustomNotificationService, CustomNotificationService>(); services.AddScoped <IListDeveloperAndProject, ListDeveloperandProject>(); }
public static async Task Main(string[] args) { var host = CreateHostBuilder(args).Build(); await DataManage.ManageDataAsync(host); host.Run(); }
private string SendLendMsg() //借阅查询菜单发送消息 { //session引入 string username = HttpContext.Current.Session["UserName"].ToString(); string userid = HttpContext.Current.Session["UserNumber"].ToString(); string text = String.Empty; if (username == null || userid == null) { text = "请先登录!"; } else { //查询数据 DataManage dm = new DataManage(); string sql = "select * from [Library].[library].[Borrow] where [BorrowRname] like '" + username + "' and [BorrowRnum] like '" + userid + "' and [Bookstate] like 'Unreturn'"; DataTable dt = dm.ReadTable(sql); string lendmsg = String.Empty; foreach (DataRow dr in dt.Rows) { lendmsg = lendmsg + "图书名称:" + dr[3].ToString() + ", 借书日期:" + dr[6].ToString() + ", 应还日期:" + dr[7].ToString() + ";" + System.Environment.NewLine; } text = lendmsg; } return(text); }
public SQLCon CreateCommand() { if (transaction != null) { return(transaction.GetSQLCon()); } return(DataManage.GetSQLCon()); }
PlayerContorller pc; //主角控制脚本 public void OnEnable() { //初始化时根据自身名字从数据管理类中领取自己的数据 dataManage = FindObjectOfType <DataManage>(); selfData = dataManage.GetDataByName(name); //先找到信息面板的父物体,再获取隐藏的信息栏 dataPanel = GameObject.Find("DataPanel").transform.Find("CardData"); pc = FindObjectOfType <PlayerContorller>(); }
private void gridbind_1(string name, string id) //gridview_1绑定 { string sql = "select * from [Library].[library].[Borrow] where [BorrowRname] like '" + name + "' and [BorrowRnum] like '" + id + "' and [Bookstate] like 'Unreturn'"; DataManage dm = new DataManage(); DataTable dt = dm.ReadTable(sql); this.GridView1.DataSource = dt; this.GridView1.DataBind(); }
private void VerifiyUser() { if (CompanySyncProcess.GetSyncProcessEnum(CompanySyncProcess.NoCompany, EnumSyncType.System) != EnumSyncProcess.NotSyncing) { GuiCommon.ShowMessage("First time use or sync broken, need to Sync Users."); btnSync.Focus(); return; } if (teUsername.EditValue == null) { GuiCommon.ShowMessage("Please enter a user name."); return; } if (tePassword.EditValue == null) { GuiCommon.ShowMessage("Please enter a password."); return; } IntPtr userHandle = IntPtr.Zero; bool winValid = LogonUser(teUsername.EditValue.ToString(), System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName, tePassword.EditValue.ToString(), 2, 0, ref userHandle); if (!winValid) { GuiCommon.ShowMessage("Failed in windows authentication. Incorrect Username/Password."); return; } int?id = LoginUser.ValidUser(teUsername.EditValue.ToString()); if (id == null) { GuiCommon.ShowMessage("Cannot find this user."); return; } else { LoginUser.CurrUser = LoginUser.GetUser(id.Value); DataManage.UpdateCodeVersion(); if (LoginUser.MaxCodeVersion() != LoginUser.CurrUser.CodeVersion) { GuiCommon.ShowMessage("Code verion is not correct, please log out and restart."); return; } luCompany.Properties.DataSource = Company.List.Where(x => LoginUser.CurrUser.AccessList.Select(a => a.CompanyId).Contains(x.MatchId)).Select(x => new { CompanyID = x.MatchId, CompanyName = x.CompanyName }); if (LoginUser.CurrUser.AccessList.Count == 1) { luCompany.ItemIndex = 0;//autoload the only company } } }
public SQLTrans BeginTransaction() { if (transaction == null) { transaction = DataManage.GetSQLTrans(); cacheStartsWithToClear = new List <string>(); } return(transaction); }
public static void LoadDoc() { AddRunMessage(">Load document...", OutputLevel.Trace); HardwareManage.LoadDoc(); TableManage.LoadDoc(); DataManage.LoadData(); IOManage.LoadObj(); VisionManage.LoadDoc(); alarmManage.LoadDoc(); }
public void ProcessRequest(HttpContext context) { var orderId = int.Parse(context.Request.Form["orderId"]); var infos = DataManage.GetInfo(orderId); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); var json = serializer.Serialize(infos); context.Response.Write(json); }
private void gridBind() //gridview数据绑定 { string rid = this.TextBox1.Text; string sql = "select * from [Library].[library].[Borrow] where [BorrowRnum] like '" + rid + "' and [Bookstate] like 'Unreturn'"; DataManage dm = new DataManage(); DataSet ds = dm.ReadSet(sql); this.GridView1.DataSource = ds; this.GridView1.DataBind(); }
private void databind() { DataManage dm = new DataManage(); string sql = "select top 20 * from [Library].[library].[Hot] order by [Hot] desc"; DataTable dt = dm.ReadTable(sql); PagedDataSource pds = new PagedDataSource(); pds.DataSource = dt.DefaultView; DataList1.DataSource = pds; DataList1.DataBind(); }
protected void Button3_Click(object sender, EventArgs e) { string sql = "delete from [Library].[library].[Reader] where [Rid] = " + Label1.Text; DataManage dm = new DataManage(); if (this.TextBox1.ReadOnly == true) { dm.ExecuteSql(sql); Response.Write("<script>删除成功!</script>"); } }
public void Save(int ID) { SkillId = transform.Find("Viewport/Content/obj" + ID + "/SkillId").GetComponent <InputField>(); HeroId = transform.Find("Viewport/Content/obj" + ID + "/HeroId").GetComponent <InputField>(); SkillName = transform.Find("Viewport/Content/obj" + ID + "/SkillName").GetComponent <InputField>(); ATKType = transform.Find("Viewport/Content/obj" + ID + "/ATKType").GetComponent <Dropdown>(); DamageCoefficient = transform.Find("Viewport/Content/obj" + ID + "/DamageCoefficient").GetComponent <InputField>(); Effect1 = transform.Find("Viewport/Content/obj" + ID + "/Effect1").GetComponent <Dropdown>(); SpecialCase1 = transform.Find("Viewport/Content/obj" + ID + "/SpecialCase1").GetComponent <InputField>(); Target1 = transform.Find("Viewport/Content/obj" + ID + "/Target1").GetComponent <Dropdown>(); Dispose1 = transform.Find("Viewport/Content/obj" + ID + "/Dispose1").GetComponent <InputField>(); Effect2 = transform.Find("Viewport/Content/obj" + ID + "/Effect2").GetComponent <Dropdown>(); SpecialCase2 = transform.Find("Viewport/Content/obj" + ID + "/SpecialCase2").GetComponent <InputField>(); Target2 = transform.Find("Viewport/Content/obj" + ID + "/Target2").GetComponent <Dropdown>(); Dispose2 = transform.Find("Viewport/Content/obj" + ID + "/Dispose2").GetComponent <InputField>(); RelevantTalentId1 = transform.Find("Viewport/Content/obj" + ID + "/RelevantTalentId1").GetComponent <InputField>(); RelevantTalentId2 = transform.Find("Viewport/Content/obj" + ID + "/RelevantTalentId2").GetComponent <InputField>(); RelevantTalentId3 = transform.Find("Viewport/Content/obj" + ID + "/RelevantTalentId3").GetComponent <InputField>(); SkillDescribe = transform.Find("Viewport/Content/obj" + ID + "/SkillDescribe").GetComponent <InputField>(); try { fightSkills[ID].SkillId = int.Parse(SkillId.text); fightSkills[ID].HeroId = int.Parse(HeroId.text); fightSkills[ID].SkillName = SkillName.text; fightSkills[ID].ATKType = ATKType.value; fightSkills[ID].DamageCoefficient = int.Parse(DamageCoefficient.text); fightSkills[ID].Effect1 = Effect1.value + 1; fightSkills[ID].SpecialCase1 = SpecialCase1.text; fightSkills[ID].Target1 = Target1.value + 1; fightSkills[ID].Dispose1 = Dispose1.text; fightSkills[ID].Effect2 = Effect2.value + 1; fightSkills[ID].SpecialCase2 = SpecialCase2.text; fightSkills[ID].Target2 = Target2.value + 1; fightSkills[ID].Dispose2 = Dispose2.text; fightSkills[ID].RelevantTalentId1 = int.Parse(RelevantTalentId1.text); fightSkills[ID].RelevantTalentId2 = int.Parse(RelevantTalentId2.text); fightSkills[ID].RelevantTalentId3 = int.Parse(RelevantTalentId3.text); fightSkills[ID].SkillDescribe = SkillDescribe.text; } catch (Exception ex) { // 错误处理代码 WindowControl.SetConsole("保存失败,你填写的数据类型不对,详细:" + ex.Message); //transform.parent.Find("Console/Text").GetComponent<Text>().text = "保存失败,你填写的数据类型不对,详细:"+ex.Message+"--------------时间:"+DateTime.Now.ToString(); return; } if (DataManage.SaveFightSkill(fightSkills, ID)) { fightSkills[ID].IsJson = true; } //transform.parent.Find("Console/Text").GetComponent<Text>().text = "保存成功-----------------时间"+DateTime.Now.ToString(); }
private void databind(string name, string id) //table绑定 { string sql = "select * from [Library].[library].[Reader] where [Rname] = '" + name + "' and [Rnumber]='" + id + "'"; DataManage dm = new DataManage(); DataTable dt = dm.ReadTable(sql); this.Label1.Text = dt.Rows[0][0].ToString(); this.Label2.Text = dt.Rows[0][1].ToString(); this.Label3.Text = dt.Rows[0][2].ToString(); this.Label4.Text = dt.Rows[0][3].ToString(); this.Label5.Text = dt.Rows[0][4].ToString(); }