/// <summary> /// 保存数据到文件 /// </summary> /// <param name="bmk"></param> private void Save2File(Bmk bmk) { string filepath = "~/Data/BmkHistory/" + bmk.RecordGuid.ToString() + ".txt"; filepath = Server.MapPath(filepath); if (!File.Exists(filepath)) { FileHelper.CreateFile(filepath); } FileHelper.WriteLine(filepath, bmk.Json()); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { long id = (long)this.GridView1.DataKeys[e.RowIndex].Value; Bmk stu = Bmk.FindById(id); if (stu != null) { Leafing.Core.Logging.Logger.Default.Info(string.Format("{0}删除了报考学生信息{1}", this.User.Identity, stu.Json())); stu.Delete(); } this.BindData(); }
/// <summary> /// 保存数据到文件 /// </summary> /// <param name="bmk"></param> private void Save2File(Bmk bmk) { string filepath = "~/Data/BmkHistory/" + bmk.RecordGuid.ToString() + ".txt"; filepath = Server.MapPath(filepath); if(!File.Exists(filepath)) FileHelper.CreateFile(filepath); FileHelper.WriteLine(filepath,bmk.Json()); }