/// <summary> /// 更新一条数据 /// </summary> public bool Update(Sys_DailyCheck model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Sys_DailyCheck set "); strSql.Append(" TaskStatus = @TaskStatus , "); strSql.Append(" TaskName = @TaskName , "); strSql.Append(" IsRepeat = @IsRepeat , "); strSql.Append(" RepeatType = @RepeatType , "); strSql.Append(" RepeatTime = @RepeatTime , "); strSql.Append(" RemindTime = @RemindTime , "); strSql.Append(" Reminder = @Reminder , "); strSql.Append(" Recorder = @Recorder , "); strSql.Append(" RecordTime = @RecordTime "); strSql.Append(" where Id=@Id "); int row = DapperHelper.Execute(strSql.ToString(), model); if (row > 0) { return(true); } else { return(false); } }
public string AddTask(string taskName, int repeatType, string repeatTime, string reminder) { Sys_DailyCheck dailyModel = new Sys_DailyCheck(); dailyModel.TaskName = taskName; dailyModel.RepeatType = repeatType; if (repeatTime.Length > 0) { if (repeatType == 1) { dailyModel.RemindTime = Convert.ToDateTime(repeatTime); dailyModel.IsRepeat = 0; } else { dailyModel.RepeatTime = "," + repeatTime + ","; dailyModel.IsRepeat = 1; } } else { return("-2");//请选择提醒 时间 } if (reminder.Length > 0) { dailyModel.Reminder = "," + reminder.ToString() + ","; } else { return("-1");//请选择提醒 人 } ManageUserModel uM = (ManageUserModel)Session["logUser"]; dailyModel.Recorder = uM.Name; dailyModel.RecordTime = DateTime.Now; return(DailyCheck.AddTask(dailyModel).ToString()); }
/// <summary> /// 新增加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public int Add(Sys_DailyCheck model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Sys_DailyCheck("); strSql.Append("TaskStatus,TaskName,IsRepeat,RepeatType,RepeatTime,RemindTime,Reminder,Recorder,RecordTime"); strSql.Append(") values ("); strSql.Append("@TaskStatus,@TaskName,@IsRepeat,@RepeatType,@RepeatTime,@RemindTime,@Reminder,@Recorder,@RecordTime"); strSql.Append(") "); strSql.Append(";select @@IDENTITY"); object obj = DapperHelper.ExecuteScalar(strSql.ToString(), model); if (obj != null) { return(Convert.ToInt32(obj)); } else { return(0); } }
/// <summary> /// 新增加 /// </summary> /// <param name="dailyModel"></param> /// <returns></returns> public static int AddTask(Sys_DailyCheck dailyModel) { return(Sys_DailyCheckBLL.AddTask(dailyModel)); }
/// <summary> /// 更新一条数据 /// </summary> public static bool Update(Sys_DailyCheck model) { Sys_DailyCheckBaseDAL dal = new Sys_DailyCheckBaseDAL(); return(dal.Update(model)); }
/// <summary> /// 新增加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public static int Add(Sys_DailyCheck model) { Sys_DailyCheckBaseDAL dal = new Sys_DailyCheckBaseDAL(); return(dal.Add(model)); }
/// <summary> /// 增加 /// </summary> /// <param name="dailyModel"></param> /// <returns></returns> public static int AddTask(Sys_DailyCheck dailyModel) { Sys_DailyCheckDAL dal = new Sys_DailyCheckDAL(); return(dal.AddTask(dailyModel)); }