Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,in my project i am using entity frame work.i am assign some data to table(adit)using object (objadit). now i am sending this one to another method by using parameter,now i am not able to use that data.
so please help me

C#
{
                     audit objAudit = new audit();

                        objAudit.ActionPerformed = (long)enumAuditAction.Edit;
                        objAudit.ActionBy = (Session["LoginUser"] as user).id;
                        objAudit.ActionDate = DateTime.Now;
                        objAudit.ActionDescription =  "Role Updated";
                        objAudit.PageTitle = "CreateRole.aspx";
                        AuditManager.InsertAudit(objAudit);
}
///
   public static void  InsertAudit(objAudit aud)
{
{
             ObjectContext Obj = new ObjectContext();
            try
            {
                Obj.audits.AddObject(aud);
                Obj.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }


}
Posted
Updated 1-Jun-13 3:12am
v3
Comments
Hitesh_Mistry 1-Jun-13 2:22am    
What is the error are you getting and below code which inserts the audit is in different function. right???
raja514 1-Jun-13 9:13am    
sorry i miss the function calling,so please see the updated code
vaibhav10Dec1987 5-Jun-13 10:19am    
public static void InsertAudit(objAudit aud)
In above line parameter should be "audit objAudit"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900