コード例 #1
0
        private void InsertIntoUnitRegister(string ipAddress, string serialNumber,
            string name, string emailAddress, string phoneNumber, out string errorMessage)
        {
            errorMessage = string.Empty;

            using (MyDataClassesDataContext myDb = new MyDataClassesDataContext())
            {
                UnitRegister n = new UnitRegister();
                n.IPAddress = ipAddress;
                n.SerialNumber = serialNumber;
                n.Name = name;
                n.EmailAddress = emailAddress;
                n.PhoneNumber = phoneNumber;

                try
                { 
                    myDb.UnitRegisters.InsertOnSubmit(n);
                    myDb.SubmitChanges();
                }
                catch (Exception ex)
                {
                    errorMessage = String.Format("Exception caught in SendEmail(): {0}",
                    ex.ToString());
                }
            }
        }
コード例 #2
0
 partial void UpdateUnitRegister(UnitRegister instance);
コード例 #3
0
 partial void DeleteUnitRegister(UnitRegister instance);
コード例 #4
0
 partial void InsertUnitRegister(UnitRegister instance);