Click here to Skip to main content
15,066,505 members

Comments by Member 7870345 (Top 18 by date)

Member 7870345 1-Aug-18 16:00pm View
You are ok, MAX(COALESCE(age,1)) it was a mistake.
It must be MAX(COALESCE(age,0))
Member 7870345 4-May-18 6:02am View
In theory there is no problem.
Can you send me the text of your query with the joins with customer?
Member 7870345 2-Mar-18 4:16am View
Please replace CAST( purdate as date ) with CONVERT(date, purdate,105)
and replace CAST( sd.SaleInvdt as date ) with CONVERT(date, sd.SaleInvdt,105).
In general dont use the function CAST to convert to date instead use the CONVERT function with tree parameters to control how the string must be interpreted.
Member 7870345 22-Feb-18 10:21am View
I´ve made a correction in my previous response in hope can help you
Member 7870345 8-Jan-18 7:53am View
In you could see information about that.
Member 7870345 13-Oct-17 7:07am View
Try that:

IF EXISTS(SELECT 1 FROM HRM.tbAttendanceTimeSlots WHERE (@FromMinutes BETWEEN FromMinutes AND Tominutes) OR (@ToMinutes BETWEEN FromMinutes AND Tominutes))
RETURN -1 --clashing
IF EXISTS(SELECT 1 FROM HRM.tbAttendanceTimeSlots WHERE (FromMinutes BETWEEN @FromMinutes AND @Tominutes) OR (ToMinutes BETWEEN @FromMinutes AND @Tominutes))

INSERT INTO HRM.tbAttendanceTimeSlots
FromMinutes, ToMinutes
Member 7870345 10-Oct-17 3:04am View
Please put a breakpoint in the sentence "if (Url.IsLocalUrl(ReturnUrl))" and another breakpoint "public ActionResult Nerd()".
Then execute the code, and watch what is the value of "ReturnUrl" (please tell in a message this value). Let the code continue executing and watch if the second breakpoint (in the public ActionResult Nerd()) is executed or not.
Member 7870345 9-Oct-17 7:16am View
I am sorry, but I dont understand what do you mean.
Reading the code there are several case:
a) is a invalid user then ViewBag.Message = "Invalid credential provided" and the Login view is showed again (with ViewBag.Message == "Invalid credential provided")
b) is a valid user and the email is not verified then ViewBag.Message = "Please verify your email first" and the Login view is showed again (with ViewBag.Message == "Please verify your email first")
c) is a valid user and then email is verified and the password is ok, then the cookie with the identification is set and
c.1) if the returnUrl is local then the user is redirected to returnUrl
c.2) if the returnUrl is not local then the user is redirected to RedirectToAction("Nerd", "Home");
d) is a valid user and then email is verified and the password is not ok, then ViewBag.Message = "Invalid credential provided" and the Login view is showed again (with ViewBag.Message == "Invalid credential provided").

Wich is the behavior that do you want? Wich are the diferences between your requeriments and the code?
Member 7870345 7-Jul-17 5:39am View
If Model is null, its imposible to enumerate Model (basically what foreach does).
Conceptually it has no sense
How to iterate, enumerate somethis that not exists?

In my opinion there is a previous error that makes the Model null (perhaps a bad parameter in the call)
Member 7870345 3-Apr-17 2:33am View
Just a suggest:
Does your controller have the [Authorize] attribute? It that case automatically it will be redirect to the Login page whenever its logout.
I hope this will help you.
Member 7870345 1-Mar-17 8:22am View
You are wellcome!
Member 7870345 27-Feb-17 2:26am View
In wich line the exception ocurrs?
Member 7870345 30-Jan-17 2:30am View
I think that to redirect in the _layout.cshtml is imposible. But in your controllers methods you can use the attribute [Authorize] that cause that is the user is not autorized to execute that method he will redirect to the login page.

If you google "authorize attribute mvc example" you can see examples of how to use.
Member 7870345 24-Jan-17 10:56am View
Sorry, i've forgot something else that i need to help you.
Could you send me the result (as text) of the query when is executed in the Sql Server Management Studio?
(please leave the headers in the text)
Thank you.
Member 7870345 24-Jan-17 10:47am View
Could you send me the schema of the tables that appear on the query (that is, CssRplOutboundPackageInfo, UsrMain and csslogicalunit)?
Member 7870345 24-Jan-17 9:04am View
Sorry but perhaps i dont understand the question then.
If you type the query (just you have written) as a "new query" in the "Sql Server Management Studio"? What do you get for the "Initial Package Count"
a) 0
c) an empty column?
Member 7870345 3-Jan-17 11:02am View
I´m sorry, but i don´t understand the code.
Perhaps this will help you: The controller must have a parameter that conforms the model of the data corresponding to the form submited

Try with this: declare your controller:
Function ProdView(listProd as ProduitViewModel) As ActionResult
and delete the declaration of 'Dim listProd As New ProduitViewModel' in the body of the function

Hope that it will help you.
Member 7870345 2-Jan-17 6:33am View
Could you include the code in the view/html concernig to the form that relates to ProdView?
Without this, I can´t figure what could happen?
Thank yoy