コード例 #1
0
        public IList <Domain.Employee> GetAllInBranch(Domain.Branch branch)
        {
            var criteria = DetachedCriteria.For <Domain.Employee>()
                           .Add(Restrictions.Eq(@"Branch", branch));

            return(_repo.FindAll(criteria));
        }
コード例 #2
0
        protected virtual void OnFormTransactionSuccess(Domain.Branch branch, bool status)
        {
            var handler = FormTransactionSuccess;

            if (handler != null)
            {
                handler(this, new FormTransactionSuccessArgs <Domain.Branch>(branch, status));
            }
        }
コード例 #3
0
        public Domain.Branch Save()
        {
            Domain.Branch branch  = null;
            var           session = NHibernateSessionManager.GetLocalSession();

            session.DoTransactional(sess =>
                                    branch = _branchRepo.Insert(
                                        new Domain.Branch(
                                            _form.BranchCode,
                                            _form.BranchName,
                                            new Address(
                                                _form.City,
                                                _form.Zipcode,
                                                _form.AddressLine
                                                )
                                            )
                                        )
                                    );

            return(branch);
        }