Example #1
0
 public PermitPayment InsertPermitPayment(PermitPayment model)
 {
     try
     {
         model = permitLogic.InsertPermitPayment(model);
     }
     catch (Exception)
     {
         model = null;
     }
     return(model);
 }
        //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";
        }
Example #3
0
 /// <summary>
 /// this method will create payment towards a permit
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public PermitPayment InsertPermitPayment(PermitPayment model)
 {
     try
     {
         context.PermitPayment.Add(model);
         context.SaveChanges();
     }
     catch (Exception ex)
     {
         model = null;
     }
     return(model);
 }
Example #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;
        }