Ejemplo n.º 1
0
        public override int?Save(string action)
        {
            var data = new LanguageDataModel();

            data.LanguageId  = SystemKeyId;
            data.Name        = Name;
            data.Description = Description;
            data.SortOrder   = SortOrder;

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

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

            return(data.LanguageId);
        }
Ejemplo n.º 2
0
 public void Create([FromBody] LanguageDataModel data)
 {
     LanguageDataManager.Create(data, SessionVariables.RequestProfile);
 }