コード例 #1
0
 public override string ToString()
 {
     return(string.Format("[{0} WorkItem Name={1}, Ctx={2}]",
                          GetType().Name,
                          Name ?? string.Empty,
                          GrainContext?.ToString() ?? "null"
                          ));
 }
コード例 #2
0
        public ClassUser Login(string username, string password)
        {
            ClassUser us = new ClassUser();

            try
            {
                using (var ctx = new GrainContext())
                {
                    us = ctx.Database.SqlQuery <ClassUser>("SELECT dbo.[User].UserId, dbo.[User].Name, dbo.[User].CountryId, dbo.[User].UserTypeId, dbo.[User].MailId, dbo.[User].PhoneId " +
                                                           "FROM dbo.Access LEFT OUTER JOIN dbo.[User] ON dbo.Access.UserId = dbo.[User].UserId " +
                                                           "WHERE (dbo.Access.passWord = N'" + password + "') AND (dbo.Access.cprNr = N'" + username + "')").FirstOrDefault <ClassUser>();
                    if (us == null)
                    {
                        us = new ClassUser();
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }
            return(us);
        }