/// <summary> /// Create a new tsyssessionhis object. /// </summary> /// <param name="sessionid">Initial value of the sessionid property.</param> public static tsyssessionhis Createtsyssessionhis(global::System.String sessionid) { tsyssessionhis tsyssessionhis = new tsyssessionhis(); tsyssessionhis.sessionid = sessionid; return tsyssessionhis; }
public void Logout(string sessionid) { try { List<MESParameterInfo> lstParameter = new List<MESParameterInfo>() { new MESParameterInfo() { ParamName="sessionid", ParamValue = sessionid.Trim(), ParamType="string" } }; dbInstance.BeginTransaction(); tsyssession syssession = sessionDal.GetSingleObject<tsyssession>(lstParameter,string.Empty,false); if (syssession != null) { tsyssessionhis syssessionhis = new tsyssessionhis(); syssessionhis.sessionid = syssession.sessionid; syssessionhis.userid = syssession.userid; syssessionhis.machine = syssession.machine; syssessionhis.terminal = syssession.terminal; syssessionhis.ipaddress = syssession.ipaddress; syssessionhis.logontime = syssession.logontime; syssessionhis.shift = syssession.shift; syssessionhis.systemname = syssession.systemname; syssessionhis.modulename = syssession.modulename; syssessionhis.logonuser = string.Empty; sessionhisDal.DoInsert<tsyssessionhis>(syssessionhis); string config = GetSystemConfig("SYS_ENABLE_ACCESSCONTROL"); if (config == MES_Misc.Y.ToString()) (Parameter.CURRENT_SESSIONS as List<tsyssession>).Remove(syssession); sessionDal.DoDelete<tsyssession>(lstParameter); } dbInstance.Commit(); } catch (Exception ex) { dbInstance.Rollback(); throw ex; } finally { dbInstance.CloseConnection(); } }
/// <summary> /// Deprecated Method for adding a new object to the tsyssessionhis EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotsyssessionhis(tsyssessionhis tsyssessionhis) { base.AddObject("tsyssessionhis", tsyssessionhis); }