|
Check out the first three answers here[^].
|
|
|
|
|
I would use some version of SQL Server (Management Studio) to import the DBF, or even into Excel and then export as CSV, etc. Then you can use "native" tools and API's.
That's if you want to skip having to deal with the DBF's directly.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
you will need an event target (e.g. a button), az event list, and events. To solve this problem, create the required data structures for event management, and test every required functionality. For optimal testability, every registered anonymous function must write different text on the console.
Base structure:
Event class, which stores the event function registered by the user (anonymous function). It gives two arguments to the listener function: the event's target (need to use base class, see later), and itself. It stores a public bool member, which if set true, the event chain stops, and further events are not run. This member has a default value of false and can be set from the listener function.
Event list class, which stores events. It can add and remove events. When adding new events, a bool argument defines if the event goes to the beginning or the end of the list. It can run every list in it sequentially with a method, and in the method, it uses a custom iterator for iteration.
Event target class. It has an event list, which gets the event target. It has a method for registering new events.
Button class. Inherits from the event target class. Has a click method, which runs the registered events.
Test cases:
1. Register an event to a new button. See if the button object is available from the event listener function.
2. Register two events to a new button in a way that the events are appended to the end of the list. Register a third event to the beginning of the list. See if they are in correct order.
3. Register three events to a new button. In the second event listener function stop the event chain. Make sure that the third listener function does not run.
|
|
|
|
|
Is there a reason you are posting your homework on the web?
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Because i want to know how it works. For me it is difficult.
|
|
|
|
|
Life is difficult. The challenge is to use your skills, and learn new ones, to overcome its challenges. Start by reading through the assignment a few times. Make some notes about what specific items need to be addressed, as mentioned in the section headed "Base structure:".
|
|
|
|
|
if i could do it, i would have done it sir.
|
|
|
|
|
Yes, but just dumping your assignment here and saying, "please do my work for me", will not help you move forward. If you do not understand the question, or where to start, then you need to discuss the problem with your teacher. Maybe you missed some lessons, or need some extra teaching.
|
|
|
|
|
please solve it for now for me next time i`m gonna do it by my self
|
|
|
|
|
No, I am sorry, but no one here is going to do your work for you.
|
|
|
|
|
No, you won't - because the next exercise is going to harder: it assumes that you can do the "easier" task you have here. If you can't do this, you have no chance whatsoever of doing the next one - and when you get to the exams, you will have no-one to write it for you and will fail the course.
That's why you are given homework, that's why it's important to do it: it teaches you skills (which you only ever develop by using them) which you are going to need.
So pull your finger out, stop trying to get others to do your homework for you, and try it yourself. We can't do it for you as it's:
1) Not fair on you as you don't develop the skills you need.
2) Not fair on your classmates who do put in the effort.
3) Not fair on your teacher who is trying to help you improve.
4) Not fair on us: we do the work, you get the credit.
Your inability to do this exercise - or even try it yourself - strongly suggests that you haven't done your earlier homework yourself either. In which case you need to rethink your priorities: when you get out of school there will be no "cheat safety net" to help you in the real world. And there, you don't get a "fail" on your grades, you get to eat or you starve. Think about it for a bit, why don't you?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Maybe you should consider taking a job where you run the machine that puts ridges on the sides of checkers.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You need to create a foormglogle project with craplestobs, wire up the fodgetra to the kladrop and trap the bandersnatcth as it passes through the quantum girdle. Once you have the bandersnatch in the wompon you need to beat it with the fraglerot till it tells you where it came from. After that is it a simple excercise of doing you schoolwork like everyone else.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
It seems to me that if your instructor assigned you homework, then he must have covered the necessary info in class. It might just be me, but maybe you should have taken better notes during the lecture(s).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Think "delegates". "Events" are "similar", though represent an "older" thought pattern.
c# - How to store delegates in a List - Stack Overflow
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
good evening
I have a little problem with the rdlc (report) in my application. When I start printing a receipt with my thermal printer I have cut text!
I wanted to know is there a way to set the margins so that it is printed on roll paper?
If possible help me with a solution.
thank you in advance for your help
|
|
|
|
|
Member 14192216 wrote: If possible help me with a solution. You need to define a 'page' size that is large enough to hold all the data. See rdlc set margins - Google Search[^].
|
|
|
|
|
I'm working on a WPF app that hits SQL on a network. Next year I will be adding in a tablet app which will include adding in a WebAPI and hosting the BL & DAL on a server, probably in IIS.
In each table I have the following columns
CreatedById INT NOT NULL FOREIGN KEY REFERENCES Users(UserId),
CreatedDT DATETIME NOT NULL,
LastModifiedById INT NULL FOREIGN KEY REFERENCES Users(UserId),
LastModifiedDT DATETIME NULL,
DeletedById INT NULL FOREIGN KEY REFERENCES Users(UserId),
DeletedDT DATETIME NULL
The question is this.... How would I pass the PK of the logged in user to the back end? Right now, with the WPF app, once the user logs in, I know their PK but I don't do anything with it.
My app has VM's which call the BL, which calls the DAL. Would you pass the User's PK to each method??
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
While that is common to do, it would be more appropriate to have that in a separate table and link to it from the tables that require the fields.
Kevin Marois wrote: How would I pass the PK of the logged in user to the back end? From where? A sproc, inline SQL? The UI should know the username, so fetching the key and getting/using the pk in the backend should be straightforward.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Yes, but pass what from the UI? Being stateless t seems like I'd have to pass that along with every call
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You DAL should have a "common point" for adding user ids, etc. to anything it passes along. The foreign key references are an unnecessary overhead for basic "audit" data that never changes.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Based on your response, as well as Eddy's, I'm going to assume that my question wasn't clear. So let me clarify.
I need to write out the ID of the logged in user to records that are added, marked as deleted, or modified. There are probably over 50 methods in the DAL. The Create and Update methods take an entity, and the Delete methods take an int Id of the record to mark as deleted.
So, in the UI, the user clicks Add, fills out the data, then clicks Save. or makes changes to an existing record:...
Company ViewModel
public void SaveChanges()
{
if (Company.Id == 0)
{
Company.CreatedById = CurrentUser.Id;
Company.Id = AppCore.BizObject.AddCompanyAsync(Company);
}
else
{
Company.LastModifiedById = CurrentUser.Id;
AppCore.BizObject.UpdateCompanyAsync(Company);
}
}
Again, the question is, how or where does the ID of the user get assigned to EVERY entity being passed to the back end?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Lots of options.
The constructors of the entities could set the information; calling a "shared" user "lookup".
Maybe user ids and actions should be logged; with only a reference to the entity id and a timestamp column value.
You could "crawl" the entities waiting to be committed and apply your "auditing" then.
Maybe you're tracking too many entities and only need to consider the parent / root of an object graph.
A combination of audit techniques that work well with the least fuss. Can you determine if someone is fudging with the data? Then your controls are adequate.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I have tried unit testing before, but I have only worked with very simple strings where I inserted some values. I wanted to try something different, so I found this template which is made for practising. It has a class containing an empty linked list.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace UnitListX
{
public class ListXwithErrors
{
private Node list;
private int size;
public static object Add;
public static int Size;
public ListXwithErrors()
{
list = null;
size = 0;
}
}
}
I have not gotten very far with the test code.
I would appreciate if anyone could provide me with an example of how to make a unit test of this kind of code.
My test code.
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitListX;
namespace UnitTestProject1
{
[TestClass]
public class ListTestClass
{
[TestMethod]
public void TestList()
{
ListXwithErrors node = new ListXwithErrors();
}
}
}
modified 13-Dec-19 14:40pm.
|
|
|
|
|
Okay, so I tried this.
I am not sure if this is the correct way to write it.
ListXwithErrors node = new ListXwithErrors();
node = null;
Assert.IsNull(node);
|
|
|
|