15,867,568 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10754595 (Top 18 by date)
Member 10754595
26-Mar-19 9:13am
View
Hi David,
Thanks for your reply. I have created one task scheduler which was running fine with vb script. and that script i am using to send email reminder. which is connecting with MVC controller. I did not change anything in the code.The MVC is using SQL Database.
Now the problem is I created one test database from production database backup. when I am connecting with my test database the script runs fine it sends email notification but with production database it is not doing anything script is running successfully but not sending any notifications.
here is my script...
Call ScheduleTask()
Sub ScheduleTask()
On Error Resume Next
Dim objRequest
Dim URL
Set objRequest = CreateObject("Microsoft.XMLHTTP")
URL = "http://localhost:59409/ScheduledJobs/CheckIncompleteDocuments"
objRequest.open "GET", URL , false
objRequest.Send
Set objRequest = Nothing
End Sub
Please let me know if you would like to see my MVC code.
thanks
Member 10754595
29-Nov-17 14:06pm
View
Now it did work (DepartmentID ?? 1) with 1 not with 0
Thanks a lot for your help! it saves my day.
Member 10754595
29-Nov-17 13:32pm
View
sorry did not work
got an error below.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.Documents_dbo.Departments_DepartmentID". The conflict occurred in database "ABC", table "dbo.Departments", column 'ID'.
The statement has been terminated.
Member 10754595
16-Nov-17 14:21pm
View
Deleted
FirstName LastNameEmployee_IDDocument_IDComplete
Patricia Kelly 3 256 1
Patricia Kelly 3 270 1
Cheryl Casto 4 271 0
Dustin Hick 6 353 0
Larry Miller 8 354 0
Member 10754595
16-Nov-17 14:09pm
View
just want to know why the same query is working for complete but not for incomplete.
there is a report which is fetching data from the document and employee table employeeID and document id only will appear in the signature table if someone has sigh off from that document. I don't know how I can show my table structure to you
Member 10754595
13-Nov-17 12:21pm
View
yes I did not result with 0
Member 10754595
13-Nov-17 12:06pm
View
If I do where Documents.Complete = 1
it is giving a result only not working with 0. And in my table,there are incomplete documents
Member 10754595
13-Nov-17 11:51am
View
I am trying to create a report of who have completed and who have not with the help of View so that I can run it everytime
Member 10754595
10-Nov-17 8:15am
View
I have added my code in this post please let me know if need any changes
Member 10754595
10-Nov-17 8:12am
View
Deleted
public void CheckIncompleteDocuments()
{
var documents = db.Documents
.Where(m => !m.Archived)
.Where(m => !m.Complete)
.ToList();
foreach (var document in documents)
{
if ((DateTime.Now.DayOfYear - document.Created.DayOfYear) >= 2)
{
var employees = new List<employee>();
foreach (var documentDepartment in document.DocumentDepartments)
{
foreach (var employee in documentDepartment.DocumentDepartmentEmployees)
{
if (!employees.Contains(employee))
{
employees.Add(employee);
}
}
}
foreach (var documentFacility in document.DocumentFacilities)
{
foreach (var employee in documentFacility.DocumentFacilityEmployees)
{
if (!employees.Contains(employee))
{
employees.Add(employee);
}
}
}
foreach (var documentWorkstation in document.DocumentWorkstations)
{
foreach (var employee in documentWorkstation.DocumentWorkstationEmployees)
{
if (!employees.Contains(employee))
{
employees.Add(employee);
}
}
}
if (!employees.Any(m => m.EmploymentStatus.Name == "Temporary Leave"))
{
var emailAddresses = employees
.Where(m => !m.Archived)
.Where(m => m.JobTitle.Name == "Administrator"
|| m.JobTitle.Name == "Assistant Manager"
.Where(m => m.EmploymentStatus.Name != "Resigned" && m.EmploymentStatus.Name != "Terminated")
.Where(m => m.Email != null
&& m.Email != "")
.Select(m => m.Email)
.ToList();
if (emailAddresses.Count() > 0)
{
var email = new MailMessage();
foreach (var emailAddress in emailAddresses)
{
email.To.Add(new MailAddress(emailAddress));
}
email.From = new MailAddress(ConfigurationManager.AppSettings["MailFrom"]);
email.Subject = "Pending Document";
email.Body = "<div style=\"font-family: sans-serif;\"><p style=\"color: red;\">DO NOT REPLY
Pending Document
The document \"" + document.Topic + "\" has been pending for " + (DateTime.Now.DayOfYear - document.Created.DayOfYear) + " days. Please notify all associates in your area that the document \"" + document.Topic + "\" is available to be signed. <a href=\"" + ConfigurationManager.AppSettings["AppAddress"] + Url.Action("Details", "Documents", new { id = document.ID }) + "\">";
email.IsBodyHtml = true;
using (var smtp = new SmtpClient())
{
smtp.Host = ConfigurationManager.AppSettings["MailHost"];
smtp.Port = Convert.ToInt32(ConfigurationManager.AppSettings["MailPort"]);
Member 10754595
30-Oct-17 19:31pm
View
I have embedded the font but still having an issue.
Member 10754595
19-Oct-17 14:25pm
View
I am getting incremented value in sequence box (1) but not with ABC. I need (ABC1)in sequence and when I add same value second time It should be (ABC2)
Member 10754595
11-Oct-17 13:46pm
View
yes
Member 10754595
24-Jul-17 17:02pm
View
Thanks for your answer. I check site.css but as I am very new to MVC and CSS don't know how to find particular cell details in CSS. Can you please help me to find it?
Member 10754595
24-Jul-17 14:27pm
View
Deleted
I have a table with 7 columns right now but and I want to add 4 more columns when I am adding extra columns then table structure is getting disturbed data are, not in one row. if I can increase the column width probably then it should look good.
can I add screenshot some how in a comment?
Member 10754595
17-Jul-17 11:08am
View
This is the first time I asked any question at codeproject.
Member 10754595
17-Jul-17 10:56am
View
Can you please provide some code how to do it?
Member 10754595
17-Jul-17 10:53am
View
I have code which sends email notification if a document is uploaded to view. Now I want to send a reminder to those people who have not seen the document yet.
Can anyone help with a code please?
Show More