示例#1
0
 /// <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;
 }
示例#2
0
        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();
            }
        }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tsyssessionhis EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotsyssessionhis(tsyssessionhis tsyssessionhis)
 {
     base.AddObject("tsyssessionhis", tsyssessionhis);
 }