« first day (2355 days earlier)      last day (2588 days later) » 

9:07 PM
i am building a order portal where customers can submit orders (and see previous/open orders for editing).
should my api have a separate "summary" endpoint where it only sends data that summarized each order -> then the user can call the API with a particular order number where the API then loads that entire order
OR... should i just send over all the complete order objects at the beginning.
i feel like... yes it would be more data to delivery over the wire, but not a TON.
 
user7480455
Hi J... not an expert or a very good programmer... but I did not want your post to go ignored... I'm sure some of the gurus will pop back in!
 
i mean ultimately the answer will be "it depends"
but it would be nice to talk thru it a bit
i work independently :)
but i appreciate you chiming in :) @007
and i appreciate all your fuckin movies. they are good.
 
user7480455
Sure thing!
 
@007 crap, I forgot the syntax for string templates in javascript
 
user7480455
LOL!!
 
9:12 PM
that's my bad
was using the syntax for c#
 
user7480455
Hi Tyler for some reason it now makes the call
 
user7480455
  url: '@(Url.Action("UpdateAvailVehicles", "VRS_REQUEST"))',
 
user7480455
this now works
 
edc
@JzInqXc9Dg Do you need to worry about security? As in, is it OK for every person that accesses the API to be able to see another order?
 
It's:
url: `~/VRS_REQUEST/UpdateAvailVehicles/${data.StartDate},${data.EndDate},${data.StartTi‌​me},${data.EndTime}`
 
user7480455
9:13 PM
it goes to my break points and it passes data back
 
Do the variables actually have data?
 
edc
@JzInqXc9Dg And how big is the full order detail? How big is the summary?
 
user7480455
the way I posted yes
 
user7480455
there is data going to the controller
 
@edc oh, when i said "complete order objects" i at least meant they are filtered by the user that is logged in. they would only see their own orders regardless
i mean... the summary is a list of like 7 columns.
 
9:14 PM
What did you change in your views?
 
user7480455
nothing
 
edc
@JzInqXc9Dg vs. the full detail is like... how many columns?
 
the full order object is a header with 12 or so fields, and an "infinite" list of line items, each with 8 or so fields. in reality there might be 1- 30 line items on an order
 
user7480455
jI think adding that tradtional thing must of did the trick
 
user7480455
sorry though that was a questio to me
 
edc
9:15 PM
@JzInqXc9Dg Ah, does it make sense that you want a separate API call to just get the order without getting the line items? I think that's a good design
 
you do?
i honestly wasn't sure if that was a good design or bad. lol
especially when we're talking about editing line items. should i only send the line items to be saved and not the whole order?
(and if they edit something in the header, i could only send the header object of the order)
 
I am not sure how you are getting the parameters to go through.
From what I have seen it doesn't seem like they should
 
edc
I would set up one call to grab the order (without line items), then a different call to grab specific line item of an order
if you need a call to grab all line items of an order, maybe you could optimize that...
 
user7480455
$('#RES_VEH_ID').focus(function () {


// TODO: Validate input


var data = {
StartDate: $('#RES_START_DATE').val().trim(),
EndDate: $('#RES_THRU_DATE').val().trim(),
StartTime: $('#RES_START_TIME').val().trim(),
EndTime: $('#RES_END_TIME').val().trim()
};
debugger;
$.ajax({
type: "POST",
url: '@(Url.Action("UpdateAvailVehicles", "VRS_REQUEST"))',
contentType: 'application/json',
traditional: true,
data: JSON.stringify(data),
success: function (data) {
var ddl_Veh = $('#RES_VEH_ID');
$.each(data, function (val, text) {
 
i wanted to at least send an object for all line items. then in my API i could have a sql transaction with a loop inside it for the insert to the DB. that way i could roll back ALL line items instead of just getting a few committed in the case somethign went wrong half way thru.
does that make sense?
 
user7480455
9:18 PM
damn sorry it just will not format
 
user7480455
so now this sends data to my controller action
 
regardless - having the header vs line items separate is something i will do. just also wondering if i will ever run the risk these two objects can/will become "out of sync" (whatever that means.... thinking out loud)
 
user7480455
in the controller data is in the json list return Json(ViewBag.VehList, JsonRequestBehavior.AllowGet);
 
user7480455
but now the question will this guy update the drop list... as I just found that code for using the return data
 
edc
@JzInqXc9Dg ya that does make sense
 
9:21 PM
cool
 
edc
well if you want to update a line item, you should lock the parent order too
that's how I think about it conceptually
 
@007 What is the [Route] attribute on the action set to?
 
edc
Oh I see what you mean, because you want to add line items in one atomic action, that's why you want an API call to accept all line items.
 
user7480455
Hi Tyler nothing I don;t think
 
user7480455
I had this at first
 
user7480455
9:24 PM
//[Route("VRS_REQUEST/UpdateAvailVehicles/{StartDate},{EndDate},{StartTime},{End‌​Time}")]
 
user7480455
do I need to have something like that?
 
@edc yes, correct!
locking the parent order.... that would simply be something done in the UI, yea?
and it only unlocks when the API returns some kind of success (or maybe complete, rather) message from a call that does something with the line items
 
@007 No, I didn't realize that was commented out. It makes a bit more sense now.
 
user7480455
should it not be?
 
user7480455
its odd that the ajax never shows that it makes it to the sucess or fail
 
user7480455
9:29 PM
how do you know if it work even with alerts It not firing
 
user7480455
but it is passing data to my controller and hitting the break points thee
 
user7480455
there.. .so odd
 
user7480455
Is that indication that it's not really working LOL ?
 
Which browser are you using?
 
user7480455
I am using the google browser
 
9:38 PM
Ultron?
 
user7480455
the odd thing is when I Uncomment that route thing it stops hitting the controller breakpoint
 
user7480455
maybe what I am trying to can't be done
 
@mikeTheLiar Ultron browser is a real man's browser
 
user7480455
realtime updating of a dropdownlist that is in use my not be possible
 
@007 That's what I was trying to solve with my url comment. The route you have in that comment will not work
 
user7480455
9:40 PM
I ma asking it to switch before the list is rendered
 
hehehe
 
You want a downdown list to pull the items when they click on it?
 
user7480455
yeah
 
user7480455
it has a default list of values
 
@TylerStahlhuth that route will but he shouldn't use it, because it's goofy af
 
user7480455
9:42 PM
but when the user starts adding time and date I need that same list to filter the reults
 
user7480455
that might not be something mvc can do
 
user7480455
most folks seem to be using other drop list to drill down
 
Why not just pull the data when the page loads? Do you really need to update the DDList everytime they click it? Cause that seems screwy.
 
user7480455
and not filter based on when the ddl gets focus
 
user7480455
yes I do
 
user7480455
9:43 PM
sadly
 
user7480455
if this was a webforms I could build a user control I think
 
user7480455
and that would handle it
 
user7480455
i read today some one on another from said maybe a partial view
 
@SteveG Well, that route would work (kinda, baring locale issues) if he used the url I gave him. But yeah, no, he really should avoid that. It's just wrong.
 
lol yea
 
user7480455
9:44 PM
would work then I could just make it visible
 
user7480455
I am shock something so simple is not really that simple
 
so simple
 
@Html.DropDownFor....
 
user7480455
thats what i use
 
user7480455
but I use a view bag to populate it
 
user7480455
9:46 PM
I was hoping all needed to do was update the view bad
 
user7480455
bag
 
user7480455
but nope
 
No, use the controller to populate the model when the page is loaded.
 
he wants to use a drop down, and update another drop down once the first one has <something> selected, and then he needs to populate the 2nd drop down with two datetimes as the predicate
 
user7480455
no
 
user7480455
9:46 PM
that's not what I'm doing steve
 
user7480455
I only have one drop dowb
 
you've been talking about it for 2 weeks
 
user7480455
n
 
if thats not it, you're just terrible at explaining things
2
 
user7480455
yes one drop down and 4 fields
 
user7480455
9:47 PM
the user populates the 4 fields
 
user7480455
data
 
that explains everything, thanks
 
Do you mean he types into the dropdown list the items he wants?
 
user7480455
I have 4 textboxes 2 with date pickers two with time pickers
 
user7480455
not guys
 
user7480455
9:48 PM
I have these 4 text boxes
 
user7480455
the user types in there
 
user7480455
times and dates
 
Are you trying to have a thing that searches records based on two dates?
Cause I wrote a control that does just that
 
user7480455
the drop down that is tied to a stored procedure
 
I think I even turned it into a helper method.
 
user7480455
9:49 PM
that stored proc takes the time and date and returns a new list
 
user7480455
let me screen shot my demo app
 
how do you share screenshots, you don't have an upload button
 
He uploads them to a sketchy website with what looks like porn game ads.
 
lmao
 
I think I have his problem though. I don't have enough rep for the image upload I guess.
 
9:52 PM
@007 do you know what an update panel is?
oh, i didn't know that was rep based
 
Seems that way. All I have is send.
 
it never used to be that way i don't think
 
According to the help, the image should be inlined if you enter just the url
unless I am misunderstanding what they mean
Didn't work when I tried it though
Let's try this again
Well, nvm
 
lol
 
Must have been where I got the image i guess
 
9:57 PM
1 message moved to Trash can
 
user7480455
ok guys here is a visual aid of what Iam trying to do
 
user7480455
some one told me about this cool site to post pics to
 
user7480455
yeah I only have a send button
 
i just want to tell 007 this, but he won't know what it means:
on button click, convert what the user entered into GMT (hopefully thats how it's stored in db), convert it to a time stamp / secs since epoch, hit an mvc endpoint, convert time stamp to datetime, filter on ef context, return list, clear the drop down list, and append the list items from the endpoint to the drop down list
 
10:00 PM
Okay, you need an update panel
 
handle status codes, show errors if endpoint returns bad status code
@TylerStahlhuth nah an update panel is webforms, he's doing mvc
 
Concept is the same
 
user7480455
sadly Iam doing mvc
 
yes
same concept
 
user7480455
I made a bad choice I should have done more reseach
 
user7480455
10:01 PM
but now I'm stuck lol
 
easiest thing to do would be to make an action that returns a partial view and just stick the result in a update div
 
user7480455
ok I like that
 
user7480455
how would I trigger the switch
 
There is even an Ajax helper method that handles to update.
 
user7480455
at that point the drop list will not be visible right
 
10:03 PM
On lose focus, check all the boxes.
 
user7480455
if I can do it with out ajax I would be happy
 
if the boxes have valid data, make the request
you are going to need ajax
 
user7480455
on lose focus of which box
 
user7480455
ok
 
you aren't getting around that
all the boxes
 
user7480455
10:03 PM
I ll ajax it
 
user7480455
you can do that?
 
thank god tyler knows mvc :p
 
user7480455
would I need to store the status of each box some how?
 
user7480455
I guess I could make each box visible when they click on the box above
 
user7480455
or maybe I can just make a button that says check
 
10:05 PM
Sure, just attach a handler to all the boxes. OnBlur fire an event for each of the boxes. If all the boxes are filled and valid, fire off the ajax call. On success, take the result of the call and stick it into an update div.
 
user7480455
after they click it teh get a list of stuff... no default list
 
oh thats how that works
that makes sense
 
user7480455
ok well I have a new path to try
 
user7480455
I wish I would have known two weeks ago that I was doing this wrong... you you live and you die
 
you weren't doing it wrong
 
user7480455
10:07 PM
and some where in between u learn
 
neither ways are wrong
 
user7480455
well if I was not wrong... why am I swtiching mo's bro lol
 
user7480455
something not right lol
 
mo's?
 
user7480455
is
 
10:08 PM
Modus Operadii
 
user7480455
modus operandi
 
user7480455
yeah
 
I think that's how you spell it
 
ah
 
Nope, single i
lol
 
10:09 PM
either way, you're going to run into the same problems doing it that way that you're running into now
one returns data and you handle it with js, one returns html
 
user7480455
I think my cool click as you type would have been cool but now that I am desperate to move on Iam just going to make the user click a button and flash up a search box old school style
 
user7480455
what you mean stever
 
user7480455
-r
 
If you return html and insert it into the form element, if you need to post the form later, the default binder can actually handle it for the most part.
 
user7480455
I don't wantto be here another 2 weeks if I am going to run into the same issue
 
10:10 PM
Unless you are doing some werid crap like I had to do
 
user7480455
that would make a full month on the same issue
 
i mean
 
user7480455
what it seems like you are typing to me is that updating drop list
 
user7480455
is something that no matter what I do I'm doomed
 
Umm... no, it's easy
 
10:13 PM
his way and my way are the exact same, you're going to be doing the same thing, the only difference is that you return html following his way (which is more mvc-ish) instead of returning a list
 
user7480455
but what I have done so far is not salvageable
 
so, before you switch, know that you'll be running into most of the same issues you're facing now
 
user7480455
jesus christi!
 
user7480455
well that's a kick in the teeth
 
user7480455
a round house kick to the teeth and I dont even have that many left
 
10:14 PM
i'm not saying his way won't be easier, just that you're not getting rid of all the ajax problems you're having
 
user7480455
maybe time time to hire a consultant to do this project or at least this part.. at 65 euro's an hour... this should not take an experienced programmer more than an hour right?
 
i'll do it for 100 usd
 
lol what
 
Either of us could
 
user7480455
10:16 PM
hmmm you think I'm kidding...
 
user7480455
lol
 
i'd do it in 15 minutes
 
user7480455
you say that...
 
1 hour min tho
 
He's not kidding
 
user7480455
10:17 PM
ha!
 
i do this all the time, i just use web api and js
 
user7480455
yeah but we are not
 
user7480455
we are just using a stored proc and a drop list
 
it's the same thing
 
user7480455
oh
 
10:18 PM
I personally think would be easier to maintain and understand, but we both have the same fix just in different ways.
 
yep
 
user7480455
I am just blow away that this is this hard
 
user7480455
for me to get
 
if i were to do it his way it'd take me 30 minutes cuz i've never done it that way before
 
user7480455
I have all the pieces
 
user7480455
10:19 PM
I can;t do that... j
 
Here's a hint:
1 View,
1 Partial View,
2 Controller methods
 
user7480455
but it's tempting
 
user7480455
lots of paper work to bring people in
 
user7480455
yeah Iam using partial views in other parts of the app
 
user7480455
I am using ajax and json and js in other parts of the app
 
user7480455
10:20 PM
for some reason this stupid thing is not working
 
[HttpGet]
public ActionResult MyAmazeballsSearch()
{
     return View();
}

[HttpPost]
public ActionResult AhYeahGimmeThatDDBaby(MyAmazeballsModel model)
{
    return PartialView("DatPartialDoe");
}
 
user7480455
iLOL!!!
 
aw shift-enter fail :(
 
fixed it
lol
 
:p
 
user7480455
10:23 PM
why do you have a get post
 
That's your view
 
user7480455
my view?
 
user7480455
not the controller?
 
you'd have one extra which is the final submit or whatever
 
user7480455
10:23 PM
you have gets and post in mvc views?
 
The controller handles requests.
The get means it only handles GET requests
 
user7480455
you know that Im doing microsoft stuff right
 
007 what does get, post, put, delete mean?
 
user7480455
I don;t think we can have } in chtml
 
user7480455
10:25 PM
Not sure on the mvc world
 
Yes you can
 
@007 thats obviously the controllers action methods
 
user7480455
clearly it means anything it wants to mean
 
user7480455
he said view
 
user7480455
that what I was asking T
 
10:25 PM
look at the code, do you think he meant View :p
 
user7480455
no
 
user7480455
that's why I ask
 
user7480455
ed
 
whats get, post, put delete mean, they're http verbs which are independent of any technology
 
@{ Model.ImmaCallAMethodInMyModelCauseIMakeBadModels(Model.TerribleDescisions); }
 
10:26 PM
lmao
 
user7480455
my take away is that I have reached a point where I am not able to go on
 
6 hours ago, by Steve G
shut up and do it or i'll gut you like a fish
 
user7480455
so I think I will just report that to the PM and get a new assignment...
 
user7480455
it's cool as I said I am not a programmer full time and I thought I can make this app
 
the only reason you can't do it is because you convinced yourself that you can't, so you sit in C# chat all day, vaguely explaining your problems
 
user7480455
10:28 PM
thanks again guys... I so aprreiciate everything
 
user7480455
no it's not that
 
if you told yourself that you could do it, i bet you could finish it by the end of the day
dude, it's all in your head, your self doubt
 
user7480455
its like making a jump... you look you scan.. either you jump or you do not.. you know your limitations...
 
I'm this close to just sending you the code. I have practically written it for you -- barring stupid names.
 
user7480455
thanks though
 
user7480455
10:29 PM
dont
 
user7480455
that will not help
 
user7480455
I'm getting off the project.
 
user7480455
thanks you guys
 
user7480455
im out!
 
...
buh bye
 
10:30 PM
 
lmao
!!steve
 
i wish i had a cookie
 
Most anti-climactic conversation I've ever had.
 
Hello all, I am really confused on something and turning to all you more experienced people to guide me on this. When an application has a method that needs to flow very synchronously way because of operational flow, checking conditions and variables, etc.. but on one of the conditional checks I determine that I need to show a ListView, how do I pause execution on my method while I wait for the SelectionChanged event handler to return from the user selecting an item in the ListView?
In other words, on a message dialog, you could do something like await messageDialog.ShowAsync
and it would await on that line until the message dialog is closed by the user. I need something similar but with an external event handler.
 
10:43 PM
I remember that the MVC Dialog started up it's own message queue and blocked the thread it was on. Does the C# one not do the same?
 
I should point out that while I am using C#, it is UWP/.NetCore
I have not looked into MVC Dialog
 
Sorry, meant MFC
 
Ah, you mean like a modal window?
 
Because from what I am reading, modal windows do not exist in UWP. It seems there are hacks or workarounds. But I just saw this thread from MSDN
Just like Grace Feng's thread mentioned, the answer from Rob is telling us that we cannot directly use MFC(MFC UI code) in UWP.
That was a quote from a thread
 
10:49 PM
Weird. Haven't messed with UWP yet. I guess it kinda makes sense to remove the modal window blocking the thread since that caused issues with the message queue, but it would be nice to have a blocking one i would think
 
This is what I need to learn, in the new world of UWP and relying heavily on async patterns and events, how do you block when you need/want to? In the past you would have used modal windows. They have converted some windows to awaitable (such as the message and content dialogs) but there is still a gap, in my case, that would be external events (buttons, list view, etc...).
 
15
A: How to show a modal window in windows 10 universal app?

LieroI haven't used it myself yet but i believe you're looking for ContentDialog api. var dialog = new ContentDialog() { Title = "Lorem Ipsum", MaxWidth = this.ActualWidth // Required for Mobile! Content = YourXamlContent }; dialog.PrimaryButtonText = "OK"; dialog.IsPrimaryButtonEnabled...

Have you tried that?
ContentDialog?
 
I do use ContentDialogs throughout my app, yes. They are nice. However, I need to show a ListView. The ListView has a SelectionChanged event that is raised when the user selects an item in the list.
Maybe I can embed the ListView in the ContentDialog?
But if I do, will it still want to raise an external event for SelectionChanged?
 
I would guess no, since I imagine it starts it's own message loop.
 
So, I see this post
0
Q: How to use ListView inside of ContentDialog

Nathiel PaulinoI'm trying to use a ContentDialog by "HardCode" not in XAML page,i have a lot TextBlocks to use so, maybe i need to use a ScrollView or ListView inside of ContentDialog,this is my Code! TextBlock txt = new TextBlock(); txt.Text = "TI Cajueiro Seco / Rua do Sol"; txt.FontS...

 
10:55 PM
hmmm ContentDialog :O why i never used such a thing !
 
But in looking at the very last post at the bottom from Alexey, you see that number 5 he had to wire up an event handler for SelectionChanged.
 
Yeah, saw that right away.
 
seems very usefull :| good thing my SO C# chat is always open :D
 
It should still fire off events in it's own message loop, but I would imagine you would need to bind the handlers to the ContentDialog.
 
But this is interesting, wonder what happens on number 4 when you say dialog.ShowAsync(); It should block on that line. It would be nice if the SelectionChanged event can callback to this line.
 
10:58 PM
So, why would you do that?
Why are you trying to resume after selecting but not closing?
Couldn't you select a value, fire off an event on the ContentDialog, wait for that event to finish, then enable the close button after?
 
Let me explain, let's say my method wants to validate a product from the database. The user can type in search criteria in a textbox and click search. I would then query the db for all matches. The matches is a List<myProducts>. Ideally, this would be one match. But it could be null, zero, 1 or many. So, I check these conditions. If we are null or 0, this would be a MessageDialog to let them know, no matches. If it is 1, we are good and can continue execution. However, if multiple,
I want to pop a ListView so they can select the one match
And then continue execution much like I do if there is only one match.
When I show the ListView, execution wants to continue even though ListView is now showing and waiting for user. This is because the ListView then has a SelectionChanged event that will fire when they do select the item and the window will close.
So, one thought is that I could split my method in two. The second half if where execution would have continued and it gets called by either count being 1 or from the event handler for SelectionChanged if there are multiple. This could work but the whole feature of blocking or using modals is if you have alot of local variables, etc... in the first half, you don't have to pass them around to the second half. Not to mention the fact that I don't think you can pass them through the event handler.
Then, the other thought is to use a flag, with a while loop to force it to block. The flag would be set when I call to show the ListView and cleared on the SelectionChanged event handler. BUT, this feels clunky and scary.
If the community though feels this is an acceptable approach, I am certainly willing to try it.
 
11:13 PM
Ehhh, without a wait in that loop I could see that eating a thread, which is not the best idea.
Using the list view in a modal should still work
You can fire off the database request from the context dialog I would imagine
 
I agree, the while loop is not the best idea in the world. Especially when we are trying to do things in a non-blocking way these days.
I am writing a little test app right now to see how the method flows if I follow the SO posts that you pasted and I pasted (combined). I will know in a few.
I don't know about firing off the db request from the content dialog because I would need to have queried the db before, to know if I even need to show the dialog.
 
11:32 PM
Missed that part, but regardless you should be able to add the results of the Db call to the list before showing the ContentMenu
 

« first day (2355 days earlier)      last day (2588 days later) »