Exemple #1
0
        public void UpdateLogonTime(string sessionid,string userid, string machine, string ipaddress, string shift)
        {
            try
            {
                List<MESParameterInfo> lstParameter = new List<MESParameterInfo>() {
                new MESParameterInfo()
                {
                    ParamName="userid",
                    ParamValue = userid.Trim(),
                    ParamType="string"
                }
            };

                dbInstance.BeginTransaction();

                tsecuser user = GetSingleObject<tsecuser>(lstParameter);

                if (user != null)
                {
                    user.lastlogontime = Function.GetCurrentTime();

                    localDal.DoUpdate<tsecuser>(user);

                    tsyssession syssession = new tsyssession();
                    syssession.sessionid = sessionid;
                    syssession.userid = userid;
                    syssession.machine = machine;
                    syssession.terminal = string.Empty;
                    syssession.ipaddress = ipaddress;
                    syssession.logontime = Function.GetCurrentTime();
                    syssession.shift = shift;
                    syssession.islocked = MES_Misc.N.ToString();
                    syssession.iskilled = MES_Misc.N.ToString();
                    syssession.modulename = CurrentContextInfo.MiscValue1;
                    syssession.systemname = string.Empty;

                    sessionDal.DoInsert<tsyssession>(syssession);

                    string config = GetSystemConfig("SYS_ENABLE_ACCESSCONTROL");
                    if (config == MES_Misc.Y.ToString())
                    {
                        if (Parameter.CURRENT_SESSIONS == null)
                            Parameter.CURRENT_SESSIONS = new List<tsyssession>() { };

                        (Parameter.CURRENT_SESSIONS as List<tsyssession>).Add(syssession);
                    }
                }

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
Exemple #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tsyssession EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotsyssession(tsyssession tsyssession)
 {
     base.AddObject("tsyssession", tsyssession);
 }
Exemple #3
0
 /// <summary>
 /// Create a new tsyssession object.
 /// </summary>
 /// <param name="sessionid">Initial value of the sessionid property.</param>
 public static tsyssession Createtsyssession(global::System.String sessionid)
 {
     tsyssession tsyssession = new tsyssession();
     tsyssession.sessionid = sessionid;
     return tsyssession;
 }
Exemple #4
0
 public void DoUpdateSession(ContextInfo contextInfo, tsyssession session)
 {
     contextInfo.Action = MES_ActionType.Update;
     SessionBll bll = new SessionBll(contextInfo);
     bll.CallAccessControl();
     bll.DoUpdate<tsyssession>(session);
     GC.Collect();
 }