Ejemplo n.º 1
0
        public virtual bool Delete(string keyValue)
        {
            int count = Sys_Setting.Delete("where SettingId=@0", keyValue);

            if (count > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public void NUnit_Domain_GetByIdSetting()
        {
            Sys_SettingServices service = new Sys_SettingServices();
            var model = new Sys_Setting {
                Id = 2
            };
            var result = service.GetByIdSetting(model.Id) as Sys_Setting;

            NUnit.Framework.Assert.IsNotNull(result);
            Console.Write("SearchResult: " + result.Id + " | " + result.Name + " | " + result.Value + " | " + result.ModuleId);
        }
Ejemplo n.º 3
0
        public void NUnit_Domain_UpdateSetting()
        {
            Sys_SettingServices service = new Sys_SettingServices();
            var model = new Sys_Setting
            {
                Id    = 3,
                Name  = "Update Name Test",
                Value = "Update tt"
            };
            bool result = service.UpdateSetting(model);

            NUnit.Framework.Assert.IsTrue(result);
            if (result == true)
            {
                Console.WriteLine("==>>> Result After Update:  " + model.Id + " | " + model.Name + " | " + model.Value + " | " + model.ModuleId);
            }
        }
Ejemplo n.º 4
0
        public void NUnit_Domain_DeleteEternitySetting()
        {
            Sys_SettingServices service = new Sys_SettingServices();
            bool result = true;
            int  rs     = 0;

            for (int i = 4; i <= 6; i++)
            {
                var model = new Sys_Setting {
                    Id = i
                };
                result = service.DeleteEternity(model.Id);
                if (result == true)
                {
                    rs += 1;
                    Console.Write(" Process Success >>> DeleteEternity >>> " + i);
                }
            }
            Console.WriteLine("Total success record: " + rs);
            //NUnit.Framework.Assert.IsTrue(result);
        }
Ejemplo n.º 5
0
        public void NUnit_Domain_AddSetting()
        {
            Sys_SettingServices service = new Sys_SettingServices();
            bool result = true;
            int  rs     = 0;

            for (int i = 0; i < 10; i++)
            {
                var model = new Sys_Setting
                {
                    Name     = "Name Test" + i,
                    Value    = "value " + i,
                    ModuleId = i
                };
                result = service.AddSetting(model);
                if (result == true)
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + model.Id + " | " + model.Name + " | " + model.Value + " | " + model.ModuleId);
                }
            }
            Console.WriteLine("Total success record: " + rs);
        }