public void InsertMessage(int applicantId, string applicationusername, string eventdescription, string message, int applicationlcid, string applicationType) { var context = new SidejobEntities(); var generalmessage = new Message { MessageID = GetNextMessageID(), SenderType = "A", SenderID = 0, SenderName = "My-SIDE-JOB", ReceiverType = applicationType, ReceiverID = applicantId, ReceiverName = applicationusername, Title = eventdescription, Description = message, DateMessage = DateTime.Now.Date, NumberofSenderInobx = 0, NumberofSenderOutbox = 0, NumberofSenderSaved = 0, NumberofReceiverInbox = 1, NumberofReceiverOutbox = 0, NmberofReceiverSaved = 0, NumberofSenderTotal = 0, NumberofReceiverTotal = 1, LCID = applicationlcid }; context.AddToMessages(generalmessage); }