Beispiel #1
0
    private void Test_User()
    {
        JASIT.DAL.ClearCache();
        Response.Write("---------------------------------------------<br />");
        Response.Write("<h3>Checking User class</h3><br />");

        JASIT.ORM.User TestUser = new JASIT.ORM.User();

        TestUser = JASIT.ORM.User.Register("Test.User", "Test.Password", "*****@*****.**");
        Response.Write("New user registered<br />");
        Response.Write(TestUser.UserID + " - " + TestUser.UserName);
        Response.Write("<br />");

        TestUser = JASIT.ORM.User.Login("Test.User", "Test.Password");
        Response.Write("New user login<br />");
        Response.Write(TestUser.UserID + " - " + TestUser.UserName);
        Response.Write("<br />");

        TestUser.UserName = "******";
        TestUser.Save();
        TestUser = new JASIT.ORM.User(TestUser.UserID);
        Response.Write("Change user name<br />");
        Response.Write(TestUser.UserID + " - " + TestUser.UserName);
        Response.Write("<br />");

        Response.Write("---------------------------------------------<br />");
    }
Beispiel #2
0
 public Issue(DataRow dr)
 {
     _issueID = (int)dr["IssueID"];
     _title = dr["Title"].ToString();
     _reportedBy = new User((int)dr["ReportedBy"]);
     _reportedTime = DateTime.Now;
     _priority = (int)dr["Priority"];
     _type = (int)dr["Type"];
     _assignedTo = new User((int)dr["AssignedTo"]);
     _status = (int)dr["Status"];
     Datarow = dr;
     New = false;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the Issue class.
 /// </summary>
 /// <param name="issueID"></param>
 public Issue(int issueID)
 {
     DataRow[] dr = DAL.Database.Tables["Issues"].Select("IssueID = " + issueID);
     if (dr.Length > 0)
     {
         _issueID = (int)dr[0]["IssueID"];
         _title = dr[0]["Title"].ToString();
         _reportedBy = new User((int)dr[0]["ReportedBy"]);
         _reportedTime = DateTime.Now;
         _priority = (int)dr[0]["Priority"];
         _type = (int)dr[0]["Type"];
         _assignedTo = new User((int)dr[0]["AssignedTo"]);
         _status = (int)dr[0]["Status"];
         Datarow = dr[0];
         New = false;
     }
 }
Beispiel #4
0
 public static Issue NewIssue(string title, string detail, int priority, int type, User assignedTo, int status)
 {
     Issue newIssue = new Issue();
     newIssue.Title = title;
     newIssue.Detail = detail;
     newIssue.ReportedBy = User.Current;
     newIssue.ReportedTime = DateTime.Now;
     newIssue.Priority = priority;
     newIssue.Type = type;
     newIssue.AssignedTo = assignedTo;
     newIssue.Status = status;
     newIssue.Save();
     return newIssue;
 }
Beispiel #5
0
 public static User Register(string userName, string password, string email)
 {
     User newUser = new User();
     newUser.UserName = userName;
     newUser.Password = password;
     newUser.Email = email;
     newUser.RegisteredTime = DateTime.Now;
     newUser.LastLogin = DateTime.Now;
     newUser.Save();
     return newUser;
 }
Beispiel #6
0
 public static User Login(string userName, string password)
 {
     DataRow[] dr = JASIT.DAL.Database.Tables[0].Select(string.Format("UserName='******' AND Password='******'", userName, password));
     if (dr.Length > 0)
     {
         User LoginUser = new User((int)dr[0]["UserID"]);
         return LoginUser;
     }
     return null;
 }