+ Start a Discussion

How do i get Date field original Date when executing in Apex Query using Asp.net C#....????





Now I m developing Asp. WEbapplication using salesforce..


In sales froce I have object name 'Class' and 'Attendance' . In Attendance have a following fileds
Attendance Date, StudentName, ClassName, Roll.. When I want update the Field Roll wheather using Present/Absent, I need a Attendance record. So I passing parameter passing from aspx page like StudentName, ClassName, and Attendance Date. Here I want to date parameter format correctly... So Is my first question when I am passing the parameter from outside to apex code which date format i am following?


Another one when creating the Attendance record from asp.net. i need same above fields. So same I need Date Parameter from c# area..normally the date return '05/12/2011 12:00:00 AM' it is not support the Apex class..



1. how do I update the Attendance record from using c# parameter?
2.how do i insert the new record from Attendacne record from using c# parameter?


Update Apex Class Is

global class UpdateAttendanceList{
WebService static void UpdateAttendanceFromClassname(string id,string classname,string studentname,string attendance){
List<Attendance__c> Alist=[Select student_Name__c,attendance_Roll__c from Attendance__c where id = :id AND class_Name__r.Name= :classname AND student_Name__r.Name= :studentname];
Attendance__c conts=Alist.get(0);
conts.attendance_Roll__c= attendance;
update conts;


Update Aspx Code:

updateAttendanceObj.UpdateAttendanceFromClassname(Id,sClassName, sStudentname, attendanceText);

Insert Apex Class Is

global class InsertOneAttendanceDate{
WebService static void InsertOneDateAttendance(string studentname,string classname,date dtattendance){
Attendance__c i=new Attendance__c(student_Name__c= studentname,class_Name__c= classname,attendance_Date__c= dtattendance);
Insert i;

Insert Aspx Code:

InsertAttendanceObj.InsertOneDateAttendance(UserId, ClassNameID, firstweekday.Date);


InsertAttendanceObj.InsertOneDateAttendance(0039000000CYPcOAAX,a0390000002vWW9AAM,05/22/2012 12:00:00 AM)