void SendAffidavitInfo(sw_posting affidavit)
 {
     if (affidavit != null)
     {
         Messenger.Default.Send <MessageCommunicator>(new MessageCommunicator()
         {
             AffidavitInfo = affidavit
         });
     }
 }
        //public RelayCommand SelectCountriesCommand
        //{
        //    get { return _selectCountriesCommand; }
        //}

        //public RelayCommand DeSelectCountriesCommand
        //{
        //    get { return _deSelectCountriesCommand; }
        //}

        public ContractorPermitProcessViewModel(IDataService dataService, PermitModel permit, MdiContainer container)
        {
            _container     = container;
            _dataService   = dataService;
            AffidavitInfo  = new sw_posting();
            ContractorInfo = new CCBContractor();
            GetAffidavitByNumber(permit.Permit.AffidavitID.ToString());
            GetContractorByCCB(permit.Permit.BuilderBoardNo);
            ApplicantInfo     = permit.Applicant;
            PermitHistoryInfo = new ApplicantPermitHistory();
            GetPermitHistory(ApplicantInfo.Name);
            TotalFee          = "0.00";
            Permits           = new ObservableCollection <ContractorPermit>();
            PermitPaymentInfo = new PermitPayment();
            NewExpireDate     = DateTime.Now;
            //GetPermitByContractor(permit.Permit.ContractorID);
            GetPermitByContractor(permit.Permit.PermitApplicant.Name);
            PermitInfo = permit;
            //PermitNumber = permit.Permit.PermitNo.ToString();
            if (permit.Applicant.ApplicantType == "Contractor")
            {
                ContractorRadio = true;
            }
            if (permit.Applicant.ApplicantType == "Owner")
            {
                OwnerRadio = true;
            }
            if (permit.Applicant.ApplicantType == "Other")
            {
                OtherRadio = true;
            }
            //GetAffidavitCostsDetails();
            AcceptButtonModel           = true;
            PermitPaymentInfo.IssueDate = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            PermitPaymentInfo.IssuedBy  = new string(Environment.UserName.ToUpper().Take(3).ToArray());
            this.CalculateAmountCommand = new RelayCommand(AcceptPermit);
            AcceptPermitFeeCommand      = new RelayCommand(AcceptPermitFee);
            RejectAllPermitsCommand     = new RelayCommand(RejectAllPermits);
            HoldPermitCommand           = new RelayCommand(HoldPermit);
            string env = ConfigurationManager.AppSettings["AppEnvironment"];

            PermitReportFactory.AppEnvironment = env;
            showPermitDetailsCommand           = new RelayCommand <long>((s) => ShowPermitDetails(s));
            //Full Set=2 Copies +Instructions, CustomerSet = 1 Copy +Instructions, FileCopy = Our Copy, Instructions =Instructions only, Permit = 1 Copy, None = No print
            PrintOptionData.Add("None");
            //PrintOptionData.Add("Permit");
            //PrintOptionData.Add("Instructions");
            PrintOptionData.Add("File Copy");
            PrintOptionData.Add("Customer Copy");
            PrintOptionData.Add("Customer and File Copy");
            SelectedPrintOption = "Customer and File Copy";
        }
예제 #3
0
        /// <summary>
        /// This method will get affidavit details by affidavit number
        /// </summary>
        /// <param name="affidavitNumber"></param>
        /// <returns></returns>
        public sw_posting GetAffidavitByNumber(string affidavitNumber)
        {
            sw_posting result = new sw_posting();

            try
            {
                result = affidavitLogic.GetAffidavitDetails(affidavitNumber);
            }
            catch (Exception)
            {
                result = null;
            }
            return(result);
        }
예제 #4
0
        public StaffPermitProcessViewModel(IDataService dataService, PermitModel permit, MdiContainer container)
        {
            _container     = container;
            _dataService   = dataService;
            AffidavitInfo  = new sw_posting();
            ContractorInfo = new CCBContractor();
            GetAffidavitByNumber(permit.Permit.AffidavitID.ToString());
            GetContractorByCCB(permit.Permit.BuilderBoardNo);
            ApplicantInfo     = permit.Applicant;
            PermitPaymentInfo = new PermitPayment();
            PermitInfo        = permit;
            AcceptButtonModel = true;
            //PermitNumber = permit.Permit.PermitNo.ToString();
            if (permit.Applicant.ApplicantType == "Contractor")
            {
                ContractorRadio = true;
            }
            if (permit.Applicant.ApplicantType == "Owner")
            {
                OwnerRadio = true;
            }
            if (permit.Applicant.ApplicantType == "Other")
            {
                OtherRadio = true;
            }
            AffidavitCostsDetails = new ObservableCollection <sw_action_detail>();
            GetAffidavitCostsDetails(permit.Permit.AffidavitID.ToString());

            PermitPaymentInfo.IssueDate = Convert.ToDateTime(DateTime.Now.ToShortDateString());
            PermitPaymentInfo.IssuedBy  = new string(Environment.UserName.ToUpper().Take(3).ToArray());

            AcceptPermitCommand = new RelayCommand(AcceptPermit);
            RejectPermitCommand = new RelayCommand(RejectPermit);
            HoldPermitCommand   = new RelayCommand(HoldPermit);
            //Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
            string env = ConfigurationManager.AppSettings["AppEnvironment"];

            PermitReportFactory.AppEnvironment = env;
        }