protected void Page_Load(object sender, EventArgs e) { ManageHelper.CheckAdminLogin(); ManageHelper.CheckAdminPower("system_databasebackup"); if (ManageHelper.PageAct() != "bak") { return; } WebConfig.SetString("DatabaseBackupPath", DatabaseBackupPath); var db = new Sys.BLL.Common(); try { var bakfile = db.DatabaseBackup(DatabaseBackupPath); Response.Write("yes"); ManageHelper.AddLog("system_databasebackup", "数据库备份成功,路径:" + bakfile); } catch (Exception ex) { Response.Write(ex.Message); ManageHelper.AddLog("system_databasebackup", "数据库备份失败,路径:" + DatabaseBackupPath); Response.End(); } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { ManageHelper.CheckAdminLogin(); ManageHelper.CheckAdminPower("system_databasedellog"); if (ManageHelper.PageAct() != "del") { return; } ManageHelper.CheckAdminPower("system_databasedellog"); var db = new Sys.BLL.Common(); try { db.DatabaseLogDel(); Response.Write("yes"); ManageHelper.AddLog("system_databasedellog", "清除数据库日志成功"); } catch (Exception ex) { Response.Write(ex.Message); ManageHelper.AddLog("system_databasedellog", "清除数据库日志失败"); Response.End(); } Response.End(); }
/// <summary> /// 查询 /// </summary> public void SearchData() { //查询条件 var key = Utils.SqlStringFormat(PageRequest.GetString("key"), 2); var userType = PageRequest.GetString("userType"); //分页 var pageIndex = PageRequest.GetInt("pageIndex", 1) + 1; var pageSize = PageRequest.GetInt("pageSize", 1); //字段排序 var sortField = PageRequest.GetString("sortField"); var sortOrder = PageRequest.GetString("sortOrder"); var order = ""; if (String.IsNullOrEmpty(sortField) == false) { if (sortOrder != "desc") { sortOrder = "asc"; } order = " u." + sortField + " " + sortOrder; } else { order += " u.createtime desc"; } var strWhere = "1=1"; if (!string.IsNullOrEmpty(userType)) { strWhere += " and u.RoleId=" + userType; } if (!string.IsNullOrEmpty(key)) { strWhere += " and charIndex('" + key + "',u.UserName) > 0"; } if (pageSize == 1) { pageSize = 100; } var dt = new Sys.BLL.UserInfo().GetListForMoreTable(pageSize, pageIndex, strWhere, order); var dataAll = MyDBUtils.DataTable2ArrayList(dt); var result = new Hashtable(); result["data"] = dataAll; var total = new Sys.BLL.Common().GetCount("UserInfo u", strWhere); result["total"] = total; //JSON var json = PluSoft.Utils.JSON.Encode(result); Response.Write(json); }
/// <summary> /// 查询 /// </summary> public void SearchData() { //查询条件 var orderStatus = PageRequest.GetString("orderStatus"); var projectName = PageRequest.GetString("projectName"); var cmbDate = PageRequest.GetString("cmbDate"); //分页 var pageIndex = PageRequest.GetInt("pageIndex", 1) + 1; var pageSize = PageRequest.GetInt("pageSize", 1); //字段排序 var sortField = PageRequest.GetString("sortField"); var sortOrder = PageRequest.GetString("sortOrder"); var order = ""; if (String.IsNullOrEmpty(sortField) == false) { if (sortOrder != "desc") { sortOrder = "asc"; } order = " u." + sortField + " " + sortOrder; } else { order += " CreateDate desc"; } var strWhere = "1=1"; if (!string.IsNullOrEmpty(orderStatus)) { if (orderStatus.Equals("0")) { strWhere += " and OrderStatus is null"; } else { strWhere += " and OrderStatus=" + orderStatus; } } if (!string.IsNullOrEmpty(projectName)) { strWhere += string.Format(" and ProjectName like '%{0}%' ", DataSecurity.FilterBadChar(projectName)); } if (!string.IsNullOrEmpty(cmbDate)) { //1day,3day,1week,1month,halfyear,oneyear if (cmbDate.Equals("1day")) { strWhere += " and CreateDate>=DATEADD(DAY,-1,GETDATE())"; } else if (cmbDate.Equals("3day")) { strWhere += " and CreateDate>=DATEADD(DAY,-3,GETDATE())"; } else if (cmbDate.Equals("1week")) { strWhere += " and CreateDate>=DATEADD(DAY,-7,GETDATE())"; } else if (cmbDate.Equals("1month")) { strWhere += " and CreateDate>=DATEADD(DAY,-30,GETDATE())"; } else if (cmbDate.Equals("halfyear")) { strWhere += " and CreateDate>=DATEADD(DAY,-180,GETDATE())"; } else if (cmbDate.Equals("oneyear")) { strWhere += " and CreateDate>=DATEADD(DAY,-365,GETDATE())"; } } if (pageSize == 1) { pageSize = 100; } var dt = new Sys.BLL.Orders().GetListForMoreTable(pageSize, pageIndex, strWhere, order); var dataAll = MyDBUtils.DataTable2ArrayList(dt); var result = new Hashtable(); result["data"] = dataAll; var total = new Sys.BLL.Common().GetCount("Orders o", strWhere); result["total"] = total; //JSON var json = PluSoft.Utils.JSON.Encode(result); Response.Write(json); }