コード例 #1
0
        public static bool save(string number, string message)
        {
            db = new SMSDataClassesDataContext();
            SMS_Inbox inbox = new SMS_Inbox();
            SMS_ReceivedMsg receivedMsg = new SMS_ReceivedMsg();

            inbox.Sender = number;
            inbox.Message = message;
            inbox.DateReceived = config.receivedDateTime();
            inbox.MonthOf = DateTime.Now.Month;
            inbox.YearOf = DateTime.Now.Year;
            inbox.Status = false;

            receivedMsg.Sender = number;
            receivedMsg.Message = message;
            receivedMsg.DateReceived = config.receivedDateTime();
            receivedMsg.MonthOf = DateTime.Now.Month;
            receivedMsg.YearOf = DateTime.Now.Year;
            receivedMsg.Status = false;

            validatorMessage.save(number, "Sorry, your message cannot be processed at this time, " +
                    "but your message is on queue. and it will process later. thank you!");

            try
            {
                db.SMS_Inboxes.InsertOnSubmit(inbox);
                db.SMS_ReceivedMsgs.InsertOnSubmit(receivedMsg);
                db.SubmitChanges();
                return true;
            }
            catch (Exception ex)
            {
                config.log(ex.Message);
                return false;
            }
        }
コード例 #2
0
 partial void DeleteSMS_ReceivedMsg(SMS_ReceivedMsg instance);
コード例 #3
0
 partial void UpdateSMS_ReceivedMsg(SMS_ReceivedMsg instance);
コード例 #4
0
 partial void InsertSMS_ReceivedMsg(SMS_ReceivedMsg instance);