public InstallmentController(ITLoanRepository loanRepository, ITInstallmentRepository installmentRepository, IMEmployeeRepository mEmployeeRepository)
        {
            Check.Require(loanRepository != null, "loanRepository may not be null");
            Check.Require(installmentRepository != null, "installmentRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");

            this._loanRepository        = loanRepository;
            this._installmentRepository = installmentRepository;
            this._mEmployeeRepository   = mEmployeeRepository;
        }
Beispiel #2
0
        public WarehouseController(IMWarehouseRepository mWarehouseRepository, IRefAddressRepository refAddressRepository, IMEmployeeRepository mEmployeeRepository)
        {
            Check.Require(mWarehouseRepository != null, "mWarehouseRepository may not be null");
            Check.Require(refAddressRepository != null, "refAddressRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");

            this._mWarehouseRepository = mWarehouseRepository;
            this._refAddressRepository = refAddressRepository;
            this._mEmployeeRepository  = mEmployeeRepository;
        }
        public PacketCommController(IMPacketCommRepository mPacketCommRepository, IMPacketRepository mPacketRepository, IMEmployeeRepository mEmployeeRepository)
        {
            Check.Require(mPacketCommRepository != null, "mPacketCommRepository may not be null");
            Check.Require(mPacketRepository != null, "mPacketRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");

            this._mPacketCommRepository = mPacketCommRepository;
            this._mPacketRepository     = mPacketRepository;
            this._mEmployeeRepository   = mEmployeeRepository;
        }
        public ActionCommController(IMActionCommRepository mActionCommRepository, IMActionRepository mActionRepository, IMEmployeeRepository mEmployeeRepository)
        {
            Check.Require(mActionCommRepository != null, "mActionCommRepository may not be null");
            Check.Require(mActionRepository != null, "mActionRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");

            this._mActionCommRepository = mActionCommRepository;
            this._mActionRepository     = mActionRepository;
            this._mEmployeeRepository   = mEmployeeRepository;
        }
        public EmployeeController(IMEmployeeRepository mEmployeeRepository, IRefAddressRepository refAddressRepository, IRefPersonRepository refPersonRepository, IMDepartmentRepository mDepartmentRepository)
        {
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(refAddressRepository != null, "refAddressRepository may not be null");
            Check.Require(refPersonRepository != null, "refPersonRepository may not be null");
            Check.Require(mDepartmentRepository != null, "mDepartmentRepository may not be null");

            this._mEmployeeRepository   = mEmployeeRepository;
            this._refAddressRepository  = refAddressRepository;
            this._refPersonRepository   = refPersonRepository;
            this._mDepartmentRepository = mDepartmentRepository;
        }
Beispiel #6
0
        public ReservationController(ITReservationRepository reservationRepository, ITReservationDetailRepository reservationDetailRepository, IMCustomerRepository mCustomerRepository, IMEmployeeRepository mEmployeeRepository, IMPacketRepository mPacketRepository)
        {
            Check.Require(reservationRepository != null, "reservationRepository may not be null");
            Check.Require(reservationDetailRepository != null, "reservationDetailRepository may not be null");
            Check.Require(mCustomerRepository != null, "mCustomerRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(mPacketRepository != null, "mPacketRepository may not be null");

            this._reservationRepository       = reservationRepository;
            this._reservationDetailRepository = reservationDetailRepository;
            this._mCustomerRepository         = mCustomerRepository;
            this._mEmployeeRepository         = mEmployeeRepository;
            this._mPacketRepository           = mPacketRepository;
        }
        public InventoryController(ITTransRepository tTransRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransRefRepository tTransRefRepository, ITStockRepository tStockRepository, ITStockRefRepository tStockRefRepository, IMCustomerRepository mCustomerRepository, IMRoomRepository mRoomRepository, IMEmployeeRepository mEmployeeRepository, ITTransDetRepository tTransDetRepository, ITTransRoomRepository tTransRoomRepository, IMPacketRepository mPacketRepository, IMPacketItemCatRepository mPacketItemCatRepository, ITTransDetItemRepository tTransDetItemRepository, IMPacketCommRepository mPacketCommRepository, IMAccountRefRepository mAccountRefRepository, ITJournalRepository tJournalRepository, ITJournalDetRepository tJournalDetRepository, IMAccountRepository mAccountRepository, IMPromoRepository mPromoRepository)
        {
            Check.Require(tTransRepository != null, "tTransRepository may not be null");
            Check.Require(mWarehouseRepository != null, "mWarehouseRepository may not be null");
            Check.Require(mSupplierRepository != null, "mSupplierRepository may not be null");
            Check.Require(mItemRepository != null, "mItemRepository may not be null");
            Check.Require(tStockCardRepository != null, "tStockCardRepository may not be null");
            Check.Require(tStockItemRepository != null, "tStockItemRepository may not be null");
            Check.Require(tTransRefRepository != null, "tTransRefRepository may not be null");
            Check.Require(tStockRepository != null, "tStockRepository may not be null");
            Check.Require(tStockRefRepository != null, "tStockRefRepository may not be null");
            Check.Require(mCustomerRepository != null, "mCustomerRepository may not be null");
            Check.Require(mRoomRepository != null, "mRoomRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(tTransDetRepository != null, "tTransDetRepository may not be null");
            Check.Require(tTransRoomRepository != null, "tTransRoomRepository may not be null");
            Check.Require(mPacketRepository != null, "mPacketRepository may not be null");
            Check.Require(mPacketItemCatRepository != null, "mPacketItemCatRepository may not be null");
            Check.Require(tTransDetItemRepository != null, "tTransDetItemRepository may not be null");
            Check.Require(mPacketCommRepository != null, "mPacketCommRepository may not be null");
            Check.Require(mAccountRefRepository != null, "mAccountRefRepository may not be null");
            Check.Require(tJournalRepository != null, "tJournalRepository may not be null");
            Check.Require(tJournalDetRepository != null, "tJournalDetRepository may not be null");
            Check.Require(mAccountRepository != null, "mAccountRepository may not be null");
            Check.Require(mPromoRepository != null, "mPromoRepository may not be null");

            this._tTransRepository         = tTransRepository;
            this._mWarehouseRepository     = mWarehouseRepository;
            this._mSupplierRepository      = mSupplierRepository;
            this._mItemRepository          = mItemRepository;
            this._tStockCardRepository     = tStockCardRepository;
            this._tStockItemRepository     = tStockItemRepository;
            this._tTransRefRepository      = tTransRefRepository;
            this._tStockRepository         = tStockRepository;
            this._tStockRefRepository      = tStockRefRepository;
            this._mCustomerRepository      = mCustomerRepository;
            this._mRoomRepository          = mRoomRepository;
            this._mEmployeeRepository      = mEmployeeRepository;
            this._tTransDetRepository      = tTransDetRepository;
            this._tTransRoomRepository     = tTransRoomRepository;
            this._mPacketRepository        = mPacketRepository;
            this._mPacketItemCatRepository = mPacketItemCatRepository;
            this._tTransDetItemRepository  = tTransDetItemRepository;
            this._mPacketCommRepository    = mPacketCommRepository;
            this._mAccountRefRepository    = mAccountRefRepository;
            this._tJournalRepository       = tJournalRepository;
            this._tJournalDetRepository    = tJournalDetRepository;
            this._mAccountRepository       = mAccountRepository;
            this._mPromoRepository         = mPromoRepository;
        }
        public WarehouseController(IMWarehouseRepository mWarehouseRepository, IRefAddressRepository refAddressRepository, IMEmployeeRepository mEmployeeRepository, IMCostCenterRepository mCostCenterRepository, IMAccountRefRepository mAccountRefRepository, IMAccountRepository mAccountRepository)
        {
            Check.Require(mWarehouseRepository != null, "mWarehouseRepository may not be null");
            Check.Require(refAddressRepository != null, "refAddressRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(mCostCenterRepository != null, "mCostCenterRepository may not be null");
            Check.Require(mAccountRefRepository != null, "mAccountRefRepository may not be null");
            Check.Require(mAccountRepository != null, "mAccountRepository may not be null");

            this._mWarehouseRepository  = mWarehouseRepository;
            this._refAddressRepository  = refAddressRepository;
            this._mEmployeeRepository   = mEmployeeRepository;
            this._mCostCenterRepository = mCostCenterRepository;
            this._mAccountRefRepository = mAccountRefRepository;
            this._mAccountRepository    = mAccountRepository;
        }
Beispiel #9
0
        public ClosingController(ITLoanRepository loanRepository, ITInstallmentRepository installmentRepository, IMEmployeeRepository mEmployeeRepository, ITRecPeriodRepository tRecPeriodRepository, IMCommissionRepository mCommissionRepository, IMCommissionDetRepository mCommissionDetRepository, ITLoanSurveyRepository tLoanSurveyRepository, ITCommissionRepository tCommissionRepository, IMZoneEmployeeRepository mZoneEmployeeRepository)
        {
            Check.Require(loanRepository != null, "loanRepository may not be null");
            Check.Require(installmentRepository != null, "installmentRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(tRecPeriodRepository != null, "tRecPeriodRepository may not be null");
            Check.Require(mCommissionRepository != null, "mCommissionRepository may not be null");
            Check.Require(mCommissionDetRepository != null, "mCommissionDetRepository may not be null");
            Check.Require(tLoanSurveyRepository != null, "tLoanSurveyRepository may not be null");
            Check.Require(tCommissionRepository != null, "tCommissionRepository may not be null");
            Check.Require(mZoneEmployeeRepository != null, "mZoneEmployeeRepository may not be null");

            this._loanRepository           = loanRepository;
            this._installmentRepository    = installmentRepository;
            this._mEmployeeRepository      = mEmployeeRepository;
            this._tRecPeriodRepository     = tRecPeriodRepository;
            this._mCommissionRepository    = mCommissionRepository;
            this._mCommissionDetRepository = mCommissionDetRepository;
            this._tLoanSurveyRepository    = tLoanSurveyRepository;
            this._tCommissionRepository    = tCommissionRepository;
            this._mZoneEmployeeRepository  = mZoneEmployeeRepository;
        }
 public MEmployeeTasks(IMEmployeeRepository employeeRepository)
 {
     this._employeeRepository = employeeRepository;
 }
        public static SurveyFormViewModel CreateSurveyFormViewModel(ITLoanSurveyRepository tLoanSurveyRepository, IMEmployeeRepository mEmployeeRepository, IMZoneRepository mZoneRepository, IMPartnerRepository mPartnerRepository, IMDepartmentRepository mDepartmentRepository, string loanSurveyId)
        {
            SurveyFormViewModel viewModel = new SurveyFormViewModel();

            viewModel.CanEditId = true;

            TLoanSurvey loanSurvey = null;
            TLoanUnit   loanUnit   = null;
            RefPerson   person     = new RefPerson();
            RefAddress  address    = new RefAddress();

            if (!string.IsNullOrEmpty(loanSurveyId))
            {
                loanSurvey = tLoanSurveyRepository.Get(loanSurveyId);
                person     = loanSurvey.LoanId.PersonId;
                address    = loanSurvey.LoanId.AddressId;
                if (loanSurvey.LoanId.LoanUnits.Count > 0)
                {
                    loanUnit = loanSurvey.LoanId.LoanUnits[0];
                }
                else
                {
                    loanUnit = new TLoanUnit();
                }

                viewModel.CanEditId = true;
            }
            if (loanSurvey == null)
            {
                TLoan loan = new TLoan();
                loanUnit = new TLoanUnit();
                MCustomer customer = new MCustomer();
                loanSurvey = new TLoanSurvey();
                MZone    zone    = new MZone();
                MPartner partner = new MPartner();

                loanSurvey.LoanId                      = loan;
                loanSurvey.LoanId.CustomerId           = customer;
                loanSurvey.LoanId.CustomerId.PersonId  = person;
                loanSurvey.LoanId.CustomerId.AddressId = address;
                loanSurvey.LoanId.ZoneId               = zone;
                loanSurvey.LoanId.PartnerId            = partner;

                MEmployee emp = new MEmployee();
                loan.SalesmanId  = emp;
                loan.SurveyorId  = emp;
                loan.CollectorId = emp;
                loan.TLSId       = emp;
            }
            viewModel.LoanSurvey = loanSurvey;
            viewModel.LoanUnit   = loanUnit;

            //set asset
            SetAssetCheck(loanSurvey.SurveyNeighborAsset, viewModel);

            //fill gender
            var values = from EnumGender e in Enum.GetValues(typeof(EnumGender))
                         select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.GenderList = new SelectList(values, "Id", "Name", person.PersonGender);

            //get education list
            var edus = from EnumEducation e in Enum.GetValues(typeof(EnumEducation))
                       select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.EducationList = new SelectList(edus, "Id", "Name", person.PersonLastEducation);

            //get married status list
            var merrieds = from EnumMarriedStatus e in Enum.GetValues(typeof(EnumMarriedStatus))
                           select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.MarriedStatusList = new SelectList(merrieds, "Id", "Name", person.PersonMarriedStatus);

            //get religions list
            var religions = from EnumReligion e in Enum.GetValues(typeof(EnumReligion))
                            select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.ReligionList = new SelectList(religions, "Id", "Name", person.PersonReligion);

            //get house owner status list
            var houses = from EnumHouseOwner e in Enum.GetValues(typeof(EnumHouseOwner))
                         select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.HouseOwnerList          = new SelectList(houses, "Id", "Name", address.AddressStatusOwner);
            viewModel.GuarantorHouseOwnerList = new SelectList(houses, "Id", "Name", person.PersonGuarantorHouseOwnerStatus);

            //get neighbor character list
            var neighbors = from EnumNeighborChar e in Enum.GetValues(typeof(EnumNeighborChar))
                            select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.NeighborCharList = new SelectList(neighbors, "Id", "Name", loanSurvey.SurveyNeighbor);

            //get house type list
            var housetypes = from EnumHouseType e in Enum.GetValues(typeof(EnumHouseType))
                             select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.HouseTypeList = new SelectList(housetypes, "Id", "Name", loanSurvey.SurveyHouseType);

            //get known customer list
            var knowcustomers = from EnumKnowCustomer e in Enum.GetValues(typeof(EnumKnowCustomer))
                                select new { ID = e, Name = CommonHelper.GetStringValue(e) };

            viewModel.KnowCustomerList = new SelectList(knowcustomers, "Id", "Name", loanSurvey.LoanId.LoanIsSalesmanKnownCustomer);

            MEmployee employee = new MEmployee();

            var listSaEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.SA.ToString());

            listSaEmployee.Insert(0, employee);

            var salesman = from emp in listSaEmployee
                           select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Salesman-" };

            viewModel.SalesmanList = new SelectList(salesman, "Id", "Id", loanSurvey.LoanId.SalesmanId != null ? loanSurvey.LoanId.SalesmanId.Id : string.Empty);

            var listSuEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.SU.ToString());

            listSuEmployee.Insert(0, employee);

            var surveyor = from emp in listSuEmployee
                           select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Surveyor-" };

            viewModel.SurveyorList = new SelectList(surveyor, "Id", "Id", loanSurvey.LoanId.SurveyorId != null ? loanSurvey.LoanId.SurveyorId.Id : string.Empty);

            var listColEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.COL.ToString());

            listColEmployee.Insert(0, employee);

            var collector = from emp in listColEmployee
                            select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Kolektor-" };

            viewModel.CollectorList = new SelectList(collector, "Id", "Id", loanSurvey.LoanId.CollectorId != null ? loanSurvey.LoanId.CollectorId.Id : string.Empty);

            var listTlsEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.TLS.ToString());

            listTlsEmployee.Insert(0, employee);

            var tls = from emp in listTlsEmployee
                      select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Team Leader-" };

            viewModel.TLSList = new SelectList(tls, "Id", "Id", loanSurvey.LoanId.TLSId != null ? loanSurvey.LoanId.TLSId.Id : string.Empty);

            var   listZone = mZoneRepository.GetAll();
            MZone z        = new MZone();

            z.ZoneName = "-Pilih Wilayah-";
            listZone.Insert(0, z);
            var zones = from zo in listZone
                        select new { Id = zo.Id, Name = zo.ZoneName };

            viewModel.ZoneList = new SelectList(zones, "Id", "Name", loanSurvey.LoanId.ZoneId != null ? loanSurvey.LoanId.ZoneId.Id : string.Empty);

            var      listPartner = mPartnerRepository.GetAll();
            MPartner p           = new MPartner();

            p.PartnerName = "-Pilih Toko-";
            listPartner.Insert(0, p);
            var partners = from prtner in listPartner
                           select new { Id = prtner.Id, Name = prtner.PartnerName };

            viewModel.PartnerList = new SelectList(partners, "Id", "Name", loanSurvey.LoanId.PartnerId != null ? loanSurvey.LoanId.PartnerId.Id : string.Empty);

            const string separator = "|";

            string[] photos = new string[0];//= loanSurvey.LoanId.LoanDesc.Split(separator.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            if (!string.IsNullOrEmpty(loanSurvey.LoanId.LoanDesc))
            {
                photos = loanSurvey.LoanId.LoanDesc.Split(separator.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            }
            viewModel.Photo1 = "~/Content/Images/no_photo104_on.jpg";
            viewModel.Photo2 = "~/Content/Images/no_photo104_on.jpg";
            if (photos.Count() > 0)
            {
                viewModel.Photo1 = photos[0];
            }
            if (photos.Count() > 1)
            {
                viewModel.Photo2 = photos[1];
            }

            return(viewModel);
        }
Beispiel #12
0
        public static CRFormViewModel CreateCRFormViewModel(ITLoanRepository tLoanRepository, IMEmployeeRepository mEmployeeRepository, string loanCustomerRequestId)
        {
            CRFormViewModel viewModel = new CRFormViewModel();

            viewModel.CanEditId = true;

            TLoan      loan     = null;
            TLoanUnit  loanUnit = null;
            RefPerson  person   = new RefPerson();
            RefAddress address  = new RefAddress();

            if (!string.IsNullOrEmpty(loanCustomerRequestId))
            {
                loan    = tLoanRepository.Get(loanCustomerRequestId);
                person  = loan.PersonId;
                address = loan.AddressId;
                if (loan.LoanUnits.Count > 0)
                {
                    loanUnit = loan.LoanUnits[0];
                }
                else
                {
                    loanUnit = new TLoanUnit();
                }

                viewModel.CanEditId = false;
            }

            if (loan == null)
            {
                MEmployee emp  = new MEmployee();
                MCustomer cust = new MCustomer();

                loan     = new TLoan();
                loanUnit = new TLoanUnit();

                loan.TLSId                = emp;
                loan.CustomerId           = cust;
                loan.CustomerId.PersonId  = person;
                loan.CustomerId.AddressId = address;
            }

            viewModel.Loan     = loan;
            viewModel.LoanUnit = loanUnit;

            if (loan.LoanAdminFee != null)
            {
                if (loan.LoanAdminFee == 25000)
                {
                    viewModel.LoanAdminFee1 = true;
                }
                else if (loan.LoanAdminFee == 50000)
                {
                    viewModel.LoanAdminFee2 = true;
                }
                else if (loan.LoanAdminFee == 75000)
                {
                    viewModel.LoanAdminFee3 = true;
                }
            }

            if (loan.LoanMateraiFee != null)
            {
                viewModel.LoanMateraiFee = true;
            }

            viewModel.Photo1 = "~/Content/Images/no_photo104_on.jpg";
            viewModel.Photo2 = "~/Content/Images/no_photo104_on.jpg";

            if (!string.IsNullOrEmpty(loan.LoanDesc))
            {
                string   separator = "|";
                string[] photos    = loan.LoanDesc.Split(separator.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (photos.Count() > 0)
                {
                    viewModel.Photo1 = photos[0];
                }
                if (photos.Count() > 1)
                {
                    viewModel.Photo2 = photos[1];
                }
            }

            MEmployee employee = new MEmployee();

            var listTlsEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.TLS.ToString());

            listTlsEmployee.Insert(0, employee);

            var tls = from emps in listTlsEmployee
                      select new { Id = emps.Id, Name = emps.PersonId != null ? emps.PersonId.PersonName : "-Pilih Team Leader-" };

            viewModel.TLSList = new SelectList(tls, "Id", "Id", loan.TLSId != null ? loan.TLSId.Id : string.Empty);

            var listSaEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.SA.ToString());

            listSaEmployee.Insert(0, employee);

            var salesman = from emps in listSaEmployee
                           select new { Id = emps.Id, Name = emps.PersonId != null ? emps.PersonId.PersonName : "-Pilih Salesman-" };

            viewModel.SalesmanList = new SelectList(salesman, "Id", "Id", loan.SalesmanId != null ? loan.SalesmanId.Id : string.Empty);

            var listSuEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.SU.ToString());

            listSuEmployee.Insert(0, employee);

            var surveyor = from emps in listSuEmployee
                           select new { Id = emps.Id, Name = emps.PersonId != null ? emps.PersonId.PersonName : "-Pilih Surveyor-" };

            viewModel.SurveyorList = new SelectList(surveyor, "Id", "Id", loan.SurveyorId != null ? loan.SurveyorId.Id : string.Empty);

            return(viewModel);
        }
        public static BillingFormViewModel CreateBillingViewModel(IMRoomRepository mRoomRepository, IMEmployeeRepository mEmployeeRepository, IMCustomerRepository mCustomerRepository, ITTransRoomRepository transRoomRepository)
        {
            BillingFormViewModel viewModel = new BillingFormViewModel();

            viewModel.RoomsList = GetRoomViewModel(transRoomRepository, mCustomerRepository, mRoomRepository.GetAll());

            //var listCustomer = mCustomerRepository.GetAll();
            //MCustomer mCustomer = new MCustomer();
            ////mCustomer.SupplierName = "-Pilih Supplier-";
            //listCustomer.Insert(0, mCustomer);
            //var custs = from cust in listCustomer
            //            select new { Id = cust.Id, Name = cust.PersonId != null ? cust.PersonId.PersonName : "-Pilih Konsumen-" };
            //viewModel.CustomerList = new SelectList(custs, "Id", "Name");

            //var listEmployee = mEmployeeRepository.GetAll();
            //MEmployee employee = new MEmployee();
            ////mCustomer.SupplierName = "-Pilih Supplier-";
            //listEmployee.Insert(0, employee);
            //var employees = from emp in listEmployee
            //                select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Terapis-" };
            //viewModel.TherapistList = new SelectList(employees, "Id", "Name");


            TTrans trans = new TTrans();

            trans.SetAssignedIdTo(Guid.NewGuid().ToString());
            trans.TransDiscount = 0;
            trans.TransDate     = DateTime.Today;
            viewModel.Trans     = trans;

            TTransRoom transRoom = new TTransRoom();

            transRoom.RoomInDate  = DateTime.Now;
            transRoom.RoomOutDate = DateTime.Now;
            viewModel.TransRoom   = transRoom;

            return(viewModel);
        }
Beispiel #14
0
        public ZoneEmployeeController(IMZoneEmployeeRepository mZoneEmployeeRepository, IMEmployeeRepository mEmployeeRepository, IMZoneRepository mZoneRepository)
        {
            Check.Require(mZoneEmployeeRepository != null, "mZoneEmployeeRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(mZoneRepository != null, "mZoneRepository may not be null");

            this._mZoneEmployeeRepository = mZoneEmployeeRepository;
            this._mEmployeeRepository     = mEmployeeRepository;
            this._mZoneRepository         = mZoneRepository;
        }
Beispiel #15
0
        public static LoanViewModel Create(EnumLoanStatus?loanStatus, IMEmployeeRepository mEmployeeRepository, IMZoneRepository mZoneRepository)
        {
            var viewModel = new LoanViewModel();

            viewModel.ShowInstallmentSubGrid = false;
            viewModel.ShowLegend             = true;
            if (loanStatus != null)
            {
                switch (loanStatus)
                {
                case EnumLoanStatus.OK:
                    viewModel.ShowInstallmentSubGrid = true;
                    break;

                case EnumLoanStatus.Cancel:
                    viewModel.ShowLegend = false;
                    break;

                case EnumLoanStatus.Reject:
                    viewModel.ShowLegend = false;
                    break;

                case EnumLoanStatus.LatePay:
                    viewModel.ShowLegend             = false;
                    viewModel.ShowInstallmentSubGrid = true;
                    break;

                case EnumLoanStatus.Paid:
                    viewModel.ShowLegend             = false;
                    viewModel.ShowInstallmentSubGrid = true;
                    break;
                }
            }

            MEmployee employee = new MEmployee();

            var listSaEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.SA.ToString());

            listSaEmployee.Insert(0, employee);

            var salesman = from emp in listSaEmployee
                           select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Semua Salesman-" };

            viewModel.SalesmanList = new SelectList(salesman, "Id", "Id", string.Empty);

            var listSuEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.SU.ToString());

            listSuEmployee.Insert(0, employee);

            var surveyor = from emp in listSuEmployee
                           select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Semua Surveyor-" };

            viewModel.SurveyorList = new SelectList(surveyor, "Id", "Id", string.Empty);

            var listColEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.COL.ToString());

            listColEmployee.Insert(0, employee);

            var collector = from emp in listColEmployee
                            select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Semua Kolektor-" };

            viewModel.CollectorList = new SelectList(collector, "Id", "Id", string.Empty);

            var listTlsEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.TLS.ToString());

            listTlsEmployee.Insert(0, employee);

            var tls = from emp in listTlsEmployee
                      select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Semua Team Leader-" };

            viewModel.TLSList = new SelectList(tls, "Id", "Id", string.Empty);

            var   listZone = mZoneRepository.GetAll();
            MZone z        = new MZone();

            z.ZoneName = "-Semua Wilayah-";
            listZone.Insert(0, z);
            var zones = from zo in listZone
                        select new { Id = zo.Id, Name = zo.ZoneName };

            viewModel.ZoneList = new SelectList(zones, "Id", "Name", string.Empty);

            return(viewModel);
        }
Beispiel #16
0
        //private readonly ITTransDetItemRepository _tTransDetItemRepository;
        //private readonly IMAccountRefRepository _mAccountRefRepository;
        //private readonly ITJournalRepository _tJournalRepository;
        //private readonly ITJournalDetRepository _tJournalDetRepository;
        //private readonly IMAccountRepository _mAccountRepository;
        //private readonly ITJournalRefRepository _tJournalRefRepository;

        public InventoryController(ITTransRepository tTransRepository, IMWarehouseRepository mWarehouseRepository, IMSupplierRepository mSupplierRepository, IMItemRepository mItemRepository, ITStockCardRepository tStockCardRepository, ITStockItemRepository tStockItemRepository, ITTransRefRepository tTransRefRepository, ITStockRepository tStockRepository, ITStockRefRepository tStockRefRepository, IMCustomerRepository mCustomerRepository, IMEmployeeRepository mEmployeeRepository, ITTransDetRepository tTransDetRepository)
        {
            Check.Require(tTransRepository != null, "tTransRepository may not be null");
            Check.Require(mWarehouseRepository != null, "mWarehouseRepository may not be null");
            Check.Require(mSupplierRepository != null, "mSupplierRepository may not be null");
            Check.Require(mItemRepository != null, "mItemRepository may not be null");
            Check.Require(tStockCardRepository != null, "tStockCardRepository may not be null");
            Check.Require(tStockItemRepository != null, "tStockItemRepository may not be null");
            Check.Require(tTransRefRepository != null, "tTransRefRepository may not be null");
            Check.Require(tStockRepository != null, "tStockRepository may not be null");
            Check.Require(tStockRefRepository != null, "tStockRefRepository may not be null");
            Check.Require(mCustomerRepository != null, "mCustomerRepository may not be null");
            Check.Require(mEmployeeRepository != null, "mEmployeeRepository may not be null");
            Check.Require(tTransDetRepository != null, "tTransDetRepository may not be null");

            this._tTransRepository     = tTransRepository;
            this._mWarehouseRepository = mWarehouseRepository;
            this._mSupplierRepository  = mSupplierRepository;
            this._mItemRepository      = mItemRepository;
            this._tStockCardRepository = tStockCardRepository;
            this._tStockItemRepository = tStockItemRepository;
            this._tTransRefRepository  = tTransRefRepository;
            this._tStockRepository     = tStockRepository;
            this._tStockRefRepository  = tStockRefRepository;
            this._mCustomerRepository  = mCustomerRepository;
            this._mEmployeeRepository  = mEmployeeRepository;
            this._tTransDetRepository  = tTransDetRepository;
        }
        public static InstallmentPaymentFormViewModel Create(ITInstallmentRepository installmentRepository, IMEmployeeRepository mEmployeeRepository, string loanCode)
        {
            installmentRepository.DbContext.BeginTransaction();
            InstallmentPaymentFormViewModel viewModel = new InstallmentPaymentFormViewModel();
            TInstallment ins = installmentRepository.GetLastInstallment(loanCode);

            if (ins == null)
            {
                ins = new TInstallment();
            }
            viewModel.installment = ins;
            viewModel.installment.InstallmentPaymentDate = DateTime.Today;
            installmentRepository.DbContext.RollbackTransaction();

            var       listEmployee = mEmployeeRepository.GetEmployeeByDept(EnumDepartment.COL.ToString());
            MEmployee employee     = new MEmployee();

            //mCustomer.SupplierName = "-Pilih Supplier-";
            listEmployee.Insert(0, employee);

            var collector = from emp in listEmployee
                            //where emp.DepartmentId.DepartmentName == "COLLECTOR"
                            select new { Id = emp.Id, Name = emp.PersonId != null ? emp.PersonId.PersonName : "-Pilih Kolektor-" };

            viewModel.CollectorList = new SelectList(collector, "Id", "Id", string.Empty);

            return(viewModel);
        }