Beispiel #1
0
        public override int?Save(string action)
        {
            var data = new TabParentStructureDataModel();

            data.TabParentStructureId = SystemKeyId;
            data.Name        = Name;
            data.Description = Description;
            data.SortOrder   = SortOrder;
            data.IsAllTab    = IsAllTab;

            if (action == "Insert")
            {
                var dtTabParentStructure = TabParentStructureDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtTabParentStructure.Rows.Count == 0)
                {
                    TabParentStructureDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                TabParentStructureDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.TabParentStructureId);
        }