Example #1
0
        protected override bool InsertObject()
        {
            try
            {
                if (!ValidInput()) return false;

                var o = new Pol_Role()
                {
                    Name = txtName.Text,
                    Descript = txtDescript.Text
                };

                var oki = _bll.Pol_Role.Insert(o);
                if (oki == null) BasePRE.ShowMessage(STR_DUPLICATE, STR_ADD);

                return oki != null ? true : false;
            }
            catch { return false; }
        }
Example #2
0
        protected override bool UpdateObject()
        {
            try
            {
                if (!ValidInput()) return false;

                var id = (Guid)grvMain.GetFocusedRowCellValue("Id");

                var o = new Pol_Role()
                {
                    Id = id,
                    Name = txtName.Text,
                    Descript = txtDescript.Text
                };

                var oki = _bll.Pol_Role.Update(o);
                if (oki == null) BasePRE.ShowMessage(STR_DUPLICATE, STR_EDIT);

                return oki != null ? true : false;
            }
            catch { return false; }
        }