public int Add(TabLocale tabLocale)
        {
            Requires.NotNull("tabLocale", tabLocale);
            Requires.PropertyNotNegative("tabLocale", "TabID", tabLocale.TabID);
            Requires.PropertyNotNullOrEmpty("tabLocale", "CultureCode", tabLocale.CultureCode);
            Requires.PropertyNotNullOrEmpty("tabLocale", "TabName", tabLocale.TabName);

            var tab = GetByTab(tabLocale.TabID, tabLocale.CultureCode);

            if (tab != null)
            {
                tab.TabName              = tabLocale.TabName;
                tab.Title                = tabLocale.Title;
                tab.Description          = tabLocale.Description;
                tab.KeyWords             = tabLocale.KeyWords;
                tab.PageHeadText         = tabLocale.PageHeadText;
                tab.LastModifiedByUserId = tabLocale.LastModifiedByUserId;
                tab.LastModifiedOnDate   = tabLocale.LastModifiedOnDate;
                Update(tab);
                return(tab.ID);
            }
            else
            {
                using (IDataContext db = DataContext.Instance())
                {
                    var repo = db.GetRepository <TabLocale>();
                    repo.Insert(tabLocale);
                }
                return(tabLocale.ID);
            }
        }
        public void Update(TabLocale tabLocale)
        {
            Requires.NotNull("tabLocale", tabLocale);
            Requires.PropertyNotNegative("tabLocale", "ID", tabLocale.ID);
            Requires.PropertyNotNegative("tabLocale", "TabID", tabLocale.TabID);
            Requires.PropertyNotNullOrEmpty("tabLocale", "CultureCode", tabLocale.CultureCode);
            Requires.PropertyNotNullOrEmpty("tabLocale", "TabName", tabLocale.TabName);

            using (IDataContext db = DataContext.Instance())
            {
                var repo = db.GetRepository <TabLocale>();
                repo.Update(tabLocale);
            }
        }
        public int AddTabLocale(int tabId, string cultureCode, string tabName, string title, string description, string keywords, string pageHeadText, int createdBy)
        {
            var tab = new TabLocale
            {
                TabID                = tabId,
                CultureCode          = cultureCode,
                TabName              = tabName,
                Title                = title,
                Description          = description,
                KeyWords             = keywords,
                PageHeadText         = pageHeadText,
                CreatedByUserId      = createdBy,
                CreatedOnDate        = DateTime.Now,
                LastModifiedByUserId = createdBy,
                LastModifiedOnDate   = DateTime.Now
            };

            return(repository.Add(tab));
        }