コード例 #1
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Obligation obligation = new Obligation();

        if (txtNumber.Text != null)
        {
            obligation.Count = Convert.ToInt32(txtNumber.Text);
        }

        if (!String.IsNullOrEmpty(txtNote.Text))
        {
            obligation.Comments = txtNote.Text;
        }

        if (!String.IsNullOrEmpty(txtNameProduct.Text))
        {
            obligation.KindName = txtNameProduct.Text;
        }


        int SchoolID = SchoolInfo.getId();

        obligation.SchoolId = SchoolID;

        obligation.SemesterId = MyDate.getCurrentSemesterId();

        obligation.IsReturn   = false;
        obligation.IsReceived = false;

        obligation.EmployeeId = ddlName.SelectedValue;

        km.Obligations.Add(obligation);
        km.SaveChanges();
        ClientScript.RegisterStartupScript(this.GetType(), "openModal", "<script> addSuccess('  لقد تم الإضافة بنجاح.. '); </script>", false);
    }
コード例 #2
0
        public void SaveObligation(ObligationViewModel model)
        {
            Obligation obligation;

            if (model.ObligationId != 0)
            {
                obligation = this.clientProfileService.GetClientObligation(model.ObligationId);
            }
            else
            {
                obligation = new Obligation();
            }

            obligation.CompanyName       = model.CompanyName;
            obligation.OutstandingAmount = model.OutstandingAmount;
            obligation.MontlyPayments    = model.MonthlyPayments;
            obligation.ExpirationDate    = model.ExpirationDate ?? DateTime.Now;
            obligation.DelayAmount       = model.DelayAmount;

            if (obligation.Id == 0)
            {
                Client client = this.clientProfileService.GetClient(model.ClientId);
                client.Obligations.Add(obligation);
            }

            this.clientProfileService.Save(obligation);
        }
コード例 #3
0
        public bool Counter_GetObligationCounter(Obligation model)
        {
            try
            {
                var counterId = repo.AllReadonly <Counter>()
                                .Where(x => x.CourtId == model.CourtId && x.CounterTypeId == NomenclatureConstants.CounterTypes.Obligation)
                                .Select(x => x.Id)
                                .FirstOrDefault();
                if (counterId > 0)
                {
                    var courtCode = repo.AllReadonly <Court>().FirstOrDefault(x => x.Id == model.CourtId)?.Code;

                    model.ObligationNumber = $"{DateTime.Now.Year}{courtCode}{Counter_GetValue(counterId)}";
                    model.ObligationDate   = DateTime.Now;
                    return(true);
                }
                else
                {
                    throw new Exception($"Няма настроен брояч за задължения. Court={model.CourtId}");
                }
            }
            catch (Exception ex)
            {
                logger.LogError(ex, $"Грешка при запис на брояч за задължения. Court={model.CourtId}");
            }
            return(false);
        }
コード例 #4
0
        public Obligation GetClientObligation(int obligationId)
        {
            Contract.Requires <ArgumentException>(obligationId.IsPositive());
            Obligation obligation = this.gangsterBankUnitOfWork.ObligationsRepository.GetById(obligationId);

            return(obligation);
        }
コード例 #5
0
        public async Task <IActionResult> Create(Obligation obligation, string fullName)
        {
            var user = await _bll.Persons.OnePerson(User.UserId());

            obligation.ParentId = user.Id;
            ModelState.SetModelValue("ParentId", new ValueProviderResult(user.Id.ToString()));
            var child = await _bll.Persons.PersonByName(fullName);

            obligation.ChildId = child.Id;
            ModelState.SetModelValue("ChildId", new ValueProviderResult(child.Id.ToString()));
            Time t = new Time();

            t.StartTime = obligation.Time !.StartTime;
            t.EndTime   = obligation.Time !.EndTime;
            _bll.Times.Add(t);
            await _bll.SaveChangesAsync();

            obligation.TimeId = t.Id;
            ModelState.SetModelValue("TimeId", new ValueProviderResult(t.Id.ToString()));
            Location l;

            if (await _bll.Locations.ExistsValue(obligation.Location !.LocationValue, User.UserId()))
            {
                l = await _bll.Locations.LocationByValue(obligation.Location.LocationValue, User.UserId());
            }
コード例 #6
0
        /* Rule logic goes here. */
        public void RunRule()
        {
            this.EventsGenerated = new List <IEvent>();
            Obligation obligationToUse = null;

            foreach (var item in AccountState.Obligations.Values.ToImmutableList())
            {
                if (item.Status == ObligationStatus.Active)
                {
                    obligationToUse = item;
                    break;
                }
            }
            if (obligationToUse != null)
            {
                foreach (var item in LineItems)
                {
                    var @event = new ObligationAssessedConcept(obligationToUse.ObligationNumber, item.Item, item.TotalAmount);
                    this.EventsGenerated.Add(@event);
                }

                this.DetailsGenerated = "THIS WORKED";
                this.Success          = true;
            }
            else
            {
                this.DetailsGenerated = "No Acttive obligations on this account.";
                this.Success          = false;
            }
        }
コード例 #7
0
        protected void VATPeriodFilter_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
        {
            baseTaxPeriodFilterRowUpdated(sender, e);
            VATPeriodFilter filter = (VATPeriodFilter)e.Row;

            if (!sender.ObjectsEqual <VATPeriodFilter.organizationID>(e.Row, e.OldRow) ||
                !sender.ObjectsEqual <VATPeriodFilter.branchID>(e.Row, e.OldRow))
            {
                SetVRN(filter);
            }
            if (!sender.ObjectsEqual <VATPeriodFilter.organizationID>(e.Row, e.OldRow) ||
                !sender.ObjectsEqual <VATPeriodFilter.branchID>(e.Row, e.OldRow) ||
                !sender.ObjectsEqual <VATPeriodFilter.vendorID>(e.Row, e.OldRow) ||
                !sender.ObjectsEqual <VATPeriodFilter.taxPeriodID>(e.Row, e.OldRow)
                )
            {
                filter.Start     = null;
                filter.End       = null;
                filter.PeriodKey = null;
                filter.Due       = null;
                filter.Status    = null;
                filter.Received  = null;
            }
            if (!sender.ObjectsEqual <VATPeriodFilter.periodKey>(e.Row, e.OldRow))
            {
                Obligation o = (Obligation)this.Obligations.Cache.Locate(new Obligation()
                {
                    PeriodKey = filter.PeriodKey
                });
                if (o != null)
                {
                    filter.Start    = o.Start;
                    filter.End      = o.End;
                    filter.Status   = o.Status;
                    filter.Due      = o.Due;
                    filter.Received = o.Received;
                }
            }
            if (!sender.ObjectsEqual <VATPeriodFilter.endDate>(e.Row, e.OldRow))
            {
                try
                {
                    GetVATObligationsForYearProc(this, filter.EndDate ?? DateTime.UtcNow);
                }
                catch (Exception)
                {
                }
            }
        }
コード例 #8
0
        public ObligationViewModel GetObligation(int clientId, int obligationId)
        {
            Obligation obligation = clientProfileService.GetClientObligation(obligationId);

            var model = new ObligationViewModel();

            model.CompanyName       = obligation.CompanyName;
            model.OutstandingAmount = obligation.OutstandingAmount;
            model.MonthlyPayments   = obligation.MontlyPayments ?? default(decimal);
            model.ExpirationDate    = obligation.ExpirationDate;
            model.DelayAmount       = obligation.DelayAmount;
            model.ObligationId      = obligation.Id;

            return(model);
        }
コード例 #9
0
 public IElement Evaluate(EvaluationContext ctx, string SchemeID, string effect)
 {
     if (this._fulfillOn.Equals(effect))
     {
         var obligation = new Obligation(this._obligationId);
         foreach (AttributeAssignmentExpression attr in this._attributeAssignmentExpressions)
         {
             obligation.AddAttributeAssignment((AttributeAssignment)attr.Evaluate(ctx, SchemeID, effect));
         }
         return(obligation);
     }
     else
     {
         return(null);
     }
 }
コード例 #10
0
        private void SpinUpAccountActor(string accountNumber, ImmutableDictionary <string, string> obligations, IActorRef supervisor)
        {
            this.Monitor();
            var props        = Props.Create <AccountActor>();
            var accountActor = Context.ActorOf(props, name: accountNumber);

            accountActor.Tell(new CreateAccount(accountNumber));

            if (obligations.ContainsValue(accountNumber))
            {
                foreach (var obligation in obligations)
                {
                    if (obligation.Value == accountNumber)
                    {
                        var o = new Obligation(obligation.Key);
                        /* maybe messing with the  belongs in the reader? */
                        o = o.SetStatus(ObligationStatus.Active);
                        accountActor.Tell(new AddObligationToAccount(obligation.Value, o));
                    }
                }
            }
            accountActor.Tell(new AskToBeSupervised(supervisor));
        }
コード例 #11
0
 public bool Counter_GetObligationCounter(Obligation model)
 {
     throw new NotImplementedException();
 }
コード例 #12
0
 public void Save(Obligation obligation)
 {
     Contract.Requires <ArgumentNullException>(obligation.IsNotNull());
     this.gangsterBankUnitOfWork.ObligationsRepository.CreateOrUpdate(obligation);
 }
コード例 #13
0
 public void Post([FromBody] Obligation value, [FromServices] IObligationRepository obligationRepository)
 {
     _obligationRepository = obligationRepository;
     _obligationRepository.Load();
 }
コード例 #14
0
        public void RemoveObligation(int obligationId)
        {
            Obligation obligation = obligationRepository.GetById(obligationId);

            obligationRepository.Remove(obligation);
        }
コード例 #15
0
 public ObligationAddedToAccount(string accountNumber, Obligation obligation) : this()
 {
     Obligation    = obligation;
     AccountNumber = accountNumber;
 }
コード例 #16
0
 public bool Update(Obligation obligation)
 {
     throw new NotImplementedException();
 }
コード例 #17
0
 public Obligation Add(Obligation obligation)
 {
     throw new NotImplementedException();
 }
コード例 #18
0
        public List <Obligation> Load()
        {
            List <Obligation> obligations = new List <Obligation>();

            List <string> processes = new List <string>()
            {
                "Tax"
            };
            Jurisdiction jurisdiction = new Jurisdiction {
                Country = "United States", State = "Ohio", City = "Hubbard"
            };

            Obligation obligation = new Obligation();

            obligation.Id           = "us_oh_hubbard_bt_file_q100_est_tax_pmt_02_2015";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "OH Hubbard Q1100, Est Tax PMT 02";
            obligation.Processes    = processes;
            obligation.Year         = 2015;
            obligation.PriorId      = "us_oh_hubbard_bt_file_q100_est_tax_pmt_02_2014";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United States", State = "Ohio", City = "Hubbard"
            };
            obligation              = new Obligation();
            obligation.Id           = "us_oh_hubbard_bt_file_q100_est_tax_pmt_02_2016";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "OH Hubbard Q1100, Est Tax PMT 02";
            obligation.Processes    = processes;
            obligation.Year         = 2016;
            obligation.PriorId      = "us_oh_hubbard_bt_file_q100_est_tax_pmt_02_2015";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United Kingdom"
            };
            obligation              = new Obligation();
            obligation.Id           = "uk_ct_file_ct600_2015";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "CT600 Filing";
            obligation.Processes    = processes;
            obligation.Year         = 2015;
            obligation.PriorId      = "uk_ct_file_ct600_2014";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United Kingdom"
            };
            obligation              = new Obligation();
            obligation.Id           = "uk_ct_pay1_2015";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "Payment 1";
            obligation.Processes    = processes;
            obligation.Year         = 2015;
            obligation.PriorId      = "uk_ct_pay1_2014";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United Kingdom"
            };
            obligation              = new Obligation();
            obligation.Id           = "uk_ct_pay2_2015";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "Payment 2";
            obligation.Processes    = processes;
            obligation.Year         = 2015;
            obligation.PriorId      = "uk_ct_pay2_2014";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United Kingdom"
            };
            obligation              = new Obligation();
            obligation.Id           = "uk_ct_pay3_2015";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "Payment 3";
            obligation.Processes    = processes;
            obligation.Year         = 2015;
            obligation.PriorId      = "uk_ct_pay3_2014";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United Kingdom"
            };
            obligation              = new Obligation();
            obligation.Id           = "uk_ct_pay4_2015";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "Payment 4";
            obligation.Processes    = processes;
            obligation.Year         = 2015;
            obligation.PriorId      = "uk_ct_pay4_2014";
            obligations.Add(obligation);

            jurisdiction = new Jurisdiction {
                Country = "United Kingdom"
            };
            obligation              = new Obligation();
            obligation.Id           = "uk_ct_file_ct600_2016";
            obligation.Jursidiction = jurisdiction;
            obligation.Name         = "CT600 Filing";
            obligation.Processes    = processes;
            obligation.Year         = 2016;
            obligation.PriorId      = "uk_ct_file_ct600_2015";
            obligations.Add(obligation);



            return(obligations);
        }
コード例 #19
0
 public AddObligationToAccount(string accountNumber, Obligation obligation) : this()
 {
     AccountNumber = accountNumber;
     Obligation    = obligation;
 }
コード例 #20
0
 public async void Update(Obligation obligation)
 {
     await _provider.InsertItem <Obligation>(obligation);
 }