Change Login Date  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Change Login Date

Postby SBarnes » Thu Apr 04, 2019 3:33 pm

How do you change the login date in code so that any business objects will process / save at that date?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Change Login Date

Postby Scott.Pearce » Fri Apr 05, 2019 9:21 am

Code: Select all
Manager.Database.SysDateTime = CDate(NewLoginDate.ToShortDateString & " " & Manager.Database.SysDateTime.ToLongTimeString)
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Change Login Date

Postby SBarnes » Fri Apr 05, 2019 9:38 am

Sorry I should have mentioned how to do it in c#
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Change Login Date  Topic is solved

Postby Scott.Pearce » Fri Apr 05, 2019 9:43 am

Code: Select all
Manager.Database.SysDateTime = (DateTime)NewLoginDate.ToShortDateString + " " + Manager.Database.SysDateTime.ToLongTimeString;


Mike insists we avoid mucking around with strings, so here are some further examples:

Code: Select all
Manager.Database.SysDateTime = DateTime.Now;

Code: Select all
Manager.Database.SysDateTime = DateTime.Now.AddDays(1);
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Change Login Date

Postby Mike.Sheen » Fri Apr 05, 2019 9:44 am

Scott.Pearce wrote:Mike insists we avoid mucking around with strings


And don't you forget it!
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Change Login Date

Postby SBarnes » Fri Apr 05, 2019 9:48 am

Thanks Scott but also sorry as I am with Mike on this one your further examples were a lot more intuitive than the strings.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Change Login Date

Postby Scott.Pearce » Fri Apr 05, 2019 10:06 am

Ironically, the first example is from our source code :-/
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Change Login Date

Postby SBarnes » Fri Apr 05, 2019 10:11 am

Yes but it was also VB, still it could have been worse it could have been CIL :lol:
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Change Login Date

Postby Mike.Sheen » Fri Apr 05, 2019 10:12 am

Scott.Pearce wrote:Ironically, the first example is from our source code :-/


Not anymore it isn't.
It's now:
Code: Select all
Manager.Database.SysDateTime = NewLoginDate.Date.Add(Manager.Database.SysDateTime.TimeOfDay)
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Change Login Date

Postby Scott.Pearce » Fri Apr 05, 2019 10:12 am

lol
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Next

Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests