Esempio n. 1
0
        private AsetHistoriEntryModel GetCreateStateModel()
        {
            AsetHistoriEntryFormData formData = new AsetHistoriEntryFormData();

            formData.Asets = new AsetQuery(Db).GetQuery().ToList();

            List <Control> formControls   = CreateFormControls(0);
            AsetHistoriDTO asetHistoriDTO = new AsetHistoriDTO()
            {
                TglMulai = DateTime.Now
            };

            return(new AsetHistoriEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = asetHistoriDTO,
            });
        }
Esempio n. 2
0
        private AsetHistoriEntryModel GetUpdateStateModel(int asetHistoriPK)
        {
            AsetHistoriEntryFormData formData = new AsetHistoriEntryFormData();

            formData.Asets = new AsetQuery(Db).GetQuery().ToList();
            List <Control> formControls   = CreateFormControls(asetHistoriPK);
            AsetHistoriDTO asetHistoriDTO = asetHistoriQuery.GetByPrimaryKey(asetHistoriPK);

            if (asetHistoriDTO == null)
            {
                throw new KairosException($"Record with primary key '{asetHistoriDTO.AsetHistori_PK}' is not found.");
            }

            return(new AsetHistoriEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = asetHistoriDTO,
            });
        }