Example #1
0
        public void Update(Parameters.UpdateParameter param)
        {
            param.Validate();
            Models.Tax tax = repository.Get(param.Id);
            if (tax.IsNull())
            {
                throw new Exception("Pajak tidak di temukan");
            }
            if (tax.Code.NotEquals(param.Code))
            {
                assertTaxNotExist(param.Code, tax.OrganizationId);
                tax.Code = param.Code;
            }
            if (tax.Name.NotEquals(param.Name))
            {
                tax.Name = param.Name;
            }
            if (tax.Value != param.Value)
            {
                tax.Value = param.Value;
            }
            if (tax.Type != param.Type)
            {
                tax.Type = param.Type;
            }

            repository.Update(tax);
        }
Example #2
0
 public Models.Tax Create(Parameters.CreateParameter param)
 {
     param.Validate();
     assertTaxNotExist(param.Code, param.OrganizationId);
     Models.Tax tax = param.ParseToTax();
     repository.Insert(tax);
     return(tax);
 }
Example #3
0
 public void Update(Models.Tax tax)
 {
     Collection.Save(tax);
 }