Пример #1
0
partial         void Accounts_Inserted(Account entity)
        {
            // Calculate a new account number
            if(entity.AccountNumber == null)
            {
                int count = this.DataWorkspace.CRMData.Accounts.Count();
                if (count > 0)
                    entity.AccountNumber = string.Format("{0:0000}", count );
                else
                    entity.AccountNumber = "0001";
            //                SaveChanges();
            }
        }
partial         void Accounts_Updating(Account entity)
        {
            entity.AccountName = entity.AccountName.ToUpper();
            entity.AccountCode = entity.AccountCode.ToUpper();
            entity.Address = entity.Address.ToUpper();
        }