public bool UpdatePlan(Plan plan) { SqlParameter[] para = { new SqlParameter("@PlanDateChange",SqlDbType.DateTime), new SqlParameter("@PlanStartTimeChange",SqlDbType.DateTime), new SqlParameter("@PlanEndTimeChange",SqlDbType.DateTime), new SqlParameter("@ChangeDate",SqlDbType.DateTime), }; para[0].Value = Convert.ToDateTime(plan.PlanDateChange); para[1].Value = Convert.ToDateTime(DateTime.Parse(plan.PlanDateChange).ToShortDateString() + " " + plan.PlanStartTimeChange); para[2].Value = Convert.ToDateTime(DateTime.Parse(plan.PlanDateChange).ToShortDateString() + " " + plan.PlanEndTimeChange); para[3].Value = Convert.ToDateTime(plan.ChangeDate); string sql = string.Format( "update DownPlan " + "set BGBanID = '{0}'," + "PlanDateChange = {1}," + "PlanStartTimeChange = {2}," + "PlanEndTimeChange = {3}," + "PlanChangeReason = '{4}'," + "ChangeDate = {5} " + "where Recordid = '{6}' " , plan.BGBanName, "@PlanDateChange", "@PlanStartTimeChange", "@PlanEndTimeChange", plan.PlanChangeReason, "@ChangeDate", plan.RID ); int i = db.ExecuteSql(sql, para); if (i == 0) { return false; } else { return true; } }
public bool UpdatePlan(Plan plan) { return DAL.UpdatePlan(plan); }