/// <summary> /// 寫Log /// </summary> /// <param name="insureLog"></param> /// <returns></returns> public static void WriteLog(InsurePointLog insureLog) { using (InsuranceWebEntities context = new InsuranceWebEntities()) { context.InsurePointLog.Add(insureLog); context.SaveChanges(); } }
/// <summary> /// 把InsurePointModel轉成Log架購並寫入Log /// </summary> /// <param name="insurePoint"></param> /// <param name="action"></param> public static void changeToLogAndWrite(InsurePoint insurePoint, string action, int point) { InsurePointLog newLog = new InsurePointLog(); newLog.ApplicantId = insurePoint.ApplicantId; newLog.Content = action; newLog.Point = point; //註銷:傳進來已是減項 newLog.CreateDate = DateTime.Now; //insurePoint.CreateDate ?? null; newLog.Memo = ""; InsurePointEFRepository.WriteLog(newLog); }