Пример #1
0
        public bool SaveObracun()
        {
            lblValidationMessages.ResetText();

            BusinessLogic.Obracuni Obracuni = new BusinessLogic.Obracuni();

            if (FormEditMode == Enums.FormEditMode.Insert || FormEditMode == Enums.FormEditMode.Copy)
            {
                Obracuni.InsertObracun();
            }
            else if (FormEditMode == Enums.FormEditMode.Update)
            {
                Obracuni.EditObracun();
            }
            bool persist = false;

            persist = Obracuni.Persist();
            if (FormEditMode == Enums.FormEditMode.Insert)
            {
                BusinessLogic.Obracuni.pID = Obracuni.NajveciID();
            }
            if (persist)
            {
                FormEditMode = Enums.FormEditMode.Update;
                return(true);
            }
            return(false);
        }