コード例 #1
0
ファイル: cmbAuditLog.cs プロジェクト: tbedi/ShippingFerguson
        /// <summary>
        /// UserLogs table Save method
        /// </summary>
        /// <param name="lsUserLog">list Of user Information(UserCustom)</param>
        /// <returns>Boolen true on success else false</returns>
        public Boolean SaveUserLog(List <cstAutditLog> lsUserLog)
        {
            Boolean _return = false;

            try
            {
                if (lsUserLog.Count > 0)
                {
                    foreach (var _UserLogitem in lsUserLog)
                    {
                        Audit _Userlog = new Audit();
                        _Userlog.UserLogID   = Guid.NewGuid();
                        _Userlog.UserID      = _UserLogitem.UserID;
                        _Userlog.ActionType  = _UserLogitem.ActionType;
                        _Userlog.ActionTime  = Convert.ToDateTime(_UserLogitem.ActionTime);
                        _Userlog.ActionValue = _UserLogitem.ActionValue;
                        x3v6.AddToAudits(_Userlog);
                    }
                    x3v6.SaveChanges();
                    _return = true;
                }
            }
            catch (Exception Ex)
            {
                Error_Loger.elAction.save("UserLogAction.SaveUserLog()", Ex.Message.ToString());
            }
            return(_return);
        }