Exemple #1
0
 public UserService(IUserRepository repo, ICompanyRepository _cRepo, ICodeTableRepository _ctRepo, IRoleRepository _roleRepo, IUserRolesRepository _userRoleRepo, ISupplierServiceTagsRepository _supplierServiceTagsRepo)
 {
     this.repo               = repo;
     cRepo                   = _cRepo;
     CTrepo                  = _ctRepo;
     roleRepo                = _roleRepo;
     userRolesRepo           = _userRoleRepo;
     supplierServiceTagsRepo = _supplierServiceTagsRepo;
 }
Exemple #2
0
 public CompanyService(ICompanyRepository repo, ICodeTableRepository companyRepo, IUserRepository repoUser,
                       IRatingRepository ratingRepo, ICompanySupplierRepository companySupplierRepo, IRoleRepository roleRepository,
                       IUserRolesRepository userRoleRepository,
                       ISupplierServiceTagsRepository supplierSvsTagRepo)
 {
     this.repo                   = repo;
     this.codeTableRepo          = companyRepo;
     this.repoUser               = repoUser;
     this.ratingRepo             = ratingRepo;
     this.companySupplierRepo    = companySupplierRepo;
     this.roleRepository         = roleRepository;
     this.userRoleRepository     = userRoleRepository;
     this.supplierServiceTagRepo = supplierSvsTagRepo;
 }
Exemple #3
0
        public VmGenericServiceResult Insert(VmCompanyItem vmItem)
        {
            VmGenericServiceResult result = new VmGenericServiceResult();

            try
            {
                Com.BudgetMetal.DBEntities.Company r = new Com.BudgetMetal.DBEntities.Company();

                Copy <VmCompanyItem, Com.BudgetMetal.DBEntities.Company>(vmItem, r);

                r.IsVerified         = false;
                r.AwardedQuotation   = 0;
                r.SubmittedQuotation = 0;
                r.BuyerAvgRating     = 0;
                r.SupplierAvgRating  = 0;

                //Max Default RFQ Per Week
                var codeTableRepo = this.codeTableRepo.Get(10100001);

                int maxQuotationPerWeek = Convert.ToInt32(codeTableRepo.Result.Value);

                //Max Default Quote Per Week
                codeTableRepo = this.codeTableRepo.Get(10100002);

                int maxRFQPerWeek = Convert.ToInt32(codeTableRepo.Result.Value);

                r.MaxQuotationPerWeek = maxQuotationPerWeek;
                r.MaxRFQPerWeek       = maxRFQPerWeek;

                if (r.CreatedBy.IsNullOrEmpty())
                {
                    r.CreatedBy = r.UpdatedBy = "System";
                }
                repo.Add(r);

                repo.Commit();

                result.IsSuccess = true;
            }
            catch (Exception e)
            {
                result.IsSuccess = false;
                result.Error     = e;
            }

            return(result);
        }
Exemple #4
0
 public CodeTableService(ICodeTableRepository repo, ICodeCategoryRepository repoC)
 {
     this.repo     = repo;
     this.repoCate = repoC;
 }
Exemple #5
0
 public FacebookService(ICodeTableRepository repoCodeTable)
 {
     this.repoCodeTable = repoCodeTable;
 }
Exemple #6
0
 public DocumentService(IDocumentRepository documentRepo, ICodeTableRepository codeTableRepo, ICompanyRepository companyRepo)
 {
     this.documentRepo  = documentRepo;
     this.codeTableRepo = codeTableRepo;
     this.companyRepo   = companyRepo;
 }