public ActionResult Delete(string id) { UserLoginLogModel.Delete(" where ID in ('@0')", id); LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(UserLoginLogModel)); return(JsonSuccess(DeleteSuccess)); }
public ActionResult DeleteForWhere(string Where) { UserLoginLogModel.Delete(Where); LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(UserLoginLogModel)); return(JsonSuccess(DeleteSuccess)); }
public ActionResult UserLoginLogDetails(object id) { ViewData[EditFlag] = true; var item = UserLoginLogModel.SingleOrDefault(id); return(View(item)); }
/// <summary> /// 添加用户登录日记 /// </summary> /// <param name="model">用户登录日记模型</param> /// <returns>是否成功</returns> public ResultModel AddUserLoginLog(UserLoginLogModel model) { var result = new ResultModel { Data = _database.Db.UserLoginLog.Insert(model) }; return(result); }
/// <summary> /// 删除用户登录日记 /// </summary> /// <param name="model">用户登录日记模型</param> /// <returns>是否删除成功</returns> public ResultModel DeleteUserLoginLog(UserLoginLogModel model) { var result = new ResultModel { Data = _database.Db.UserLoginLog.Delete(ID: model.ID) }; result.IsValid = result.Data > 0 ? true : false; return(result); }
/// <summary> /// 更新用户登录日记 /// </summary> /// <param name="model">用户登录日记模型</param> /// <returns>是否修改成功</returns> public ResultModel UpdateUserLoginLog(UserLoginLogModel model) { var result = new ResultModel { Data = _database.Db.UserLoginLog.Update(model) }; result.IsValid = result.Data > 0 ? true : false; return(result); }
public string DeleteUserLoginLogLog(int?ID) { UserLoginLogModel model = new UserLoginLogModel(); if (ID.HasValue) { model.ID = ID.Value; var result = this._userLoginLogService.DeleteUserLoginLog(model).Data; return(result == true ? "Delete success!" : "Delete failed!"); } return("Delete failed!"); }
public ActionResult UserLoginLogEdit(object id, int actiontype = 0) { ViewData[EditFlag] = true; if (actiontype == 1) { UserLoginLogModel model = new UserLoginLogModel(); return(View(model)); } else { UserLoginLogModel model = UserLoginLogModel.SingleOrDefault(id); return(View(model)); } }
public ActionResult UserLoginLogIndex(Page <UserLoginLogModel> model) { if (model.CurrentPage <= 0) { model.CurrentPage = 1; } StringBuilder where = new StringBuilder("where 1=1 "); if (model.Item != null) { if (model.Item.ID != null) { where.AppendFormat(" and ID = {0} ", model.Item.ID); } if (model.Item.UserID != null) { where.AppendFormat(" and UserID = {0} ", model.Item.UserID); } if (model.Item.LoginTime != null) { where.AppendFormat(" and LoginTime = {0} ", model.Item.LoginTime); } if (!string.IsNullOrEmpty(model.Item.LoginIp)) { where.AppendFormat(" and LoginIp like '%{0}%' ", model.Item.LoginIp.Trim()); } if (!string.IsNullOrEmpty(model.Item.DeviceID)) { where.AppendFormat(" and DeviceID like '%{0}%' ", model.Item.DeviceID.Trim()); } if (!string.IsNullOrEmpty(model.Item.DeviceOS)) { where.AppendFormat(" and DeviceOS like '%{0}%' ", model.Item.DeviceOS.Trim()); } if (!string.IsNullOrEmpty(model.Item.AppVersion)) { where.AppendFormat(" and AppVersion like '%{0}%' ", model.Item.AppVersion.Trim()); } } var page = UserLoginLogModel.Page(model.CurrentPage, MTConfig.ItemsPerPage, where.ToString(), model.Item); page.Item = model.Item; LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(UserLoginLogModel)); return(View(page)); }
public ActionResult UserLoginLogEdit(UserLoginLogModel model) { if (string.IsNullOrEmpty(model.ID)) { ViewData[EditFlag] = true; if (model.Insert() != null) { LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(UserLoginLogModel)); return(JsonSuccess("")); } return(JsonError("")); } else { ViewData[EditFlag] = true; if (model.Update() > 0) { LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(UserLoginLogModel)); return(JsonSuccess("")); } return(JsonError("")); } }
public void UserLoginLogService_GetUserLoginLogById_Test() { UserLoginLogModel resultModel = this._userLoginLogService.GetUserLoginLogById(1).Data; Assert.IsTrue(true); }
public static UserLoginLog ToEntity(this UserLoginLogModel model) { return(Mapper.Map <UserLoginLog>(model)); }