Click here to Skip to main content
15,887,676 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# UserControl Inheritance Pin
OriginalGriff24-Sep-15 2:19
mveOriginalGriff24-Sep-15 2:19 
AnswerRe: C# UserControl Inheritance Pin
BillWoodruff24-Sep-15 7:13
professionalBillWoodruff24-Sep-15 7:13 
AnswerRe: C# UserControl Inheritance Pin
Gerry Schmitz24-Sep-15 8:56
mveGerry Schmitz24-Sep-15 8:56 
GeneralRe: C# UserControl Inheritance Pin
BillWoodruff24-Sep-15 12:18
professionalBillWoodruff24-Sep-15 12:18 
AnswerRe: C# UserControl Inheritance Pin
didydj28-Sep-15 4:07
didydj28-Sep-15 4:07 
Question(Selenium web driver using c#)How to make the webdrivers.exe path to environment varibales in my local machine Pin
Member 1200855524-Sep-15 0:47
Member 1200855524-Sep-15 0:47 
AnswerRe: (Selenium web driver using c#)How to make the webdrivers.exe path to environment varibales in my local machine Pin
Pete O'Hanlon24-Sep-15 0:54
mvePete O'Hanlon24-Sep-15 0:54 
QuestionNewbie: code doesn't return result, could someone please help? Pin
Member 1200834023-Sep-15 23:41
Member 1200834023-Sep-15 23:41 
Hello,

Apologies for what surely is a very basic question. I'm new to C# and need to write some easy functions for an application we use at work. This application uses a special DateTime as it needs to accommodate unknown date parts, e.g. UNK/May/2015. Ideally I would like to know the difference in months between two dates, but for a start I'm happy with just the year difference (the year will always be known). I've written the following function which throws no errors but it always returns 0. I can see while debugging that StDt.Year and EnSt.Year are integers with the correct year, but it doesn't seem to calculate the PackYears. Any help is greatly appreciated!

[DesignerFunction("Calculates the pack years")]
public static int fnCalculatePackYears(
[DesignerParameter("Start Date (date)")] PFDateTime StDt,
[DesignerParameter("End Date (date)")] PFDateTime EnDt)
{
int PackYears = 0;
int StDtYr = StDt.Year;
int EnDtYr = EnDt.Year;

PackYears = (EnDt.Year - StDt.Year);

return PackYears;

}

Thanks in advance!
Nicole
AnswerRe: Newbie: code doesn't return result, could someone please help? Pin
OriginalGriff24-Sep-15 0:14
mveOriginalGriff24-Sep-15 0:14 
QuestionRe: Newbie: code doesn't return result, could someone please help? Pin
Richard MacCutchan24-Sep-15 1:13
mveRichard MacCutchan24-Sep-15 1:13 
QuestionMAKE AUTOMATIC NUMBER Pin
Saepul Bahri23-Sep-15 17:28
Saepul Bahri23-Sep-15 17:28 
AnswerRe: MAKE AUTOMATIC NUMBER Pin
Pete O'Hanlon23-Sep-15 21:09
mvePete O'Hanlon23-Sep-15 21:09 
AnswerRe: MAKE AUTOMATIC NUMBER Pin
OriginalGriff23-Sep-15 21:48
mveOriginalGriff23-Sep-15 21:48 
QuestionVIEW DATA FROM DATABASE Pin
Saepul Bahri23-Sep-15 17:24
Saepul Bahri23-Sep-15 17:24 
AnswerRe: VIEW DATA FROM DATABASE Pin
aarif moh shaikh23-Sep-15 19:24
professionalaarif moh shaikh23-Sep-15 19:24 
QuestionColor Calculation Pin
RadioButton23-Sep-15 13:27
RadioButton23-Sep-15 13:27 
AnswerRe: Color Calculation Pin
Ravi Bhavnani23-Sep-15 18:29
professionalRavi Bhavnani23-Sep-15 18:29 
QuestionLanguage Converter Pin
vish_jani23-Sep-15 1:51
vish_jani23-Sep-15 1:51 
AnswerRe: Language Converter Pin
Pete O'Hanlon23-Sep-15 2:29
mvePete O'Hanlon23-Sep-15 2:29 
GeneralRe: Language Converter Pin
Vish_jani23-Sep-15 3:13
Vish_jani23-Sep-15 3:13 
GeneralRe: Language Converter Pin
Eddy Vluggen23-Sep-15 3:25
professionalEddy Vluggen23-Sep-15 3:25 
GeneralRe: Language Converter Pin
Pete O'Hanlon23-Sep-15 4:24
mvePete O'Hanlon23-Sep-15 4:24 
GeneralRe: Language Converter Pin
Ravi Bhavnani23-Sep-15 18:31
professionalRavi Bhavnani23-Sep-15 18:31 
AnswerRe: Language Converter Pin
Eddy Vluggen23-Sep-15 2:20
professionalEddy Vluggen23-Sep-15 2:20 
AnswerRe: Language Converter Pin
Ravi Bhavnani23-Sep-15 18:32
professionalRavi Bhavnani23-Sep-15 18:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.