Example #1
0
        public JsonResult UpdateCatEthnicGroup(HttpRequestMessage request, Cat_EthnicGroup EthnicGroup)
        {
            var model = new Cat_EthnicGroup();

            model.Id = EthnicGroup.Id;
            model.EthnicGroupName = EthnicGroup.EthnicGroupName;
            model.EthnicGroupCode = EthnicGroup.EthnicGroupCode;
            model.UserCreate      = EthnicGroup.UserCreate;
            model.UserLockID      = EthnicGroup.UserLockID;
            model.UserUpdate      = EthnicGroup.UserUpdate;
            model.DateCreate      = EthnicGroup.DateCreate;
            model.DateLock        = EthnicGroup.DateLock;
            model.DateUpdate      = EthnicGroup.DateUpdate;
            model.IPCreate        = EthnicGroup.IPCreate;
            model.IPUpdate        = EthnicGroup.IPUpdate;
            model.IsDelete        = EthnicGroup.IsDelete;
            model.ServerCreate    = EthnicGroup.ServerCreate;
            model.ServerUpdate    = EthnicGroup.ServerUpdate;

            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            var result = service.UpdateCatEthnicGroup(model);

            if (result == false)
            {
                model = null;
            }
            return(Json(model));
        }
 public JsonResult DeleteCatEthnicGroup(HttpRequestMessage request, Cat_EthnicGroup EthnicGroup)          
 {
     Cat_EthnicGroup catEthnicGroup = new Cat_EthnicGroup();
     Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
     var result = service.DeleteCatEthnicGroup(EthnicGroup.Id);
     if (result == false) catEthnicGroup = null;
     return Json(catEthnicGroup);
 }
 public JsonResult AddCatEthnicGroup(HttpRequestMessage request, Cat_EthnicGroup EthnicGroup)
 {
     var model = new Cat_EthnicGroup();
     model.Id = EthnicGroup.Id;
     model.EthnicGroupName = EthnicGroup.EthnicGroupName;
     model.EthnicGroupCode = EthnicGroup.EthnicGroupCode;
     Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
     var result = service.AddCatEthnicGroup(model);
     if (result == false) model = null;
     return Json(model);
 }
Example #4
0
        public JsonResult DeleteCatEthnicGroup(HttpRequestMessage request, Cat_EthnicGroup EthnicGroup)
        {
            Cat_EthnicGroup         catEthnicGroup = new Cat_EthnicGroup();
            Cat_EthnicGroupServices service        = new Cat_EthnicGroupServices();
            var result = service.DeleteCatEthnicGroup(EthnicGroup.Id);

            if (result == false)
            {
                catEthnicGroup = null;
            }
            return(Json(catEthnicGroup));
        }
 public void NUnit_Domain_UpdateCatEthnicGroup()
 {
     Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
     var EthnicGroup = new Cat_EthnicGroup
     {
         Id = 12,
         EthnicGroupName = "ABCDomain12",
         EthnicGroupCode = "BC-12",
     };
     //NUnit.Framework.Assert.IsTrue(result);
     if (service.Edit(EthnicGroup) == ActionStatus.EditSucceed.ToString())
     {
         Console.WriteLine("==>>> Result After Update:  " + EthnicGroup.Id + " | " + EthnicGroup.EthnicGroupName + " | " + EthnicGroup.EthnicGroupCode);
     }
 }
        public void NUnit_Domain_UpdateCatEthnicGroup()
        {
            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            var EthnicGroup = new Cat_EthnicGroup
            {
                Id = 12,
                EthnicGroupName = "ABCDomain12",
                EthnicGroupCode = "BC-12",
            };

            //NUnit.Framework.Assert.IsTrue(result);
            if (service.Edit(EthnicGroup) == ActionStatus.EditSucceed.ToString())
            {
                Console.WriteLine("==>>> Result After Update:  " + EthnicGroup.Id + " | " + EthnicGroup.EthnicGroupName + " | " + EthnicGroup.EthnicGroupCode);
            }
        }
Example #7
0
        public JsonResult AddCatEthnicGroup(HttpRequestMessage request, Cat_EthnicGroup EthnicGroup)
        {
            var model = new Cat_EthnicGroup();

            model.Id = EthnicGroup.Id;
            model.EthnicGroupName = EthnicGroup.EthnicGroupName;
            model.EthnicGroupCode = EthnicGroup.EthnicGroupCode;
            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            var result = service.AddCatEthnicGroup(model);

            if (result == false)
            {
                model = null;
            }
            return(Json(model));
        }
        public void NUnit_Domain_DeleteCatEthnicGroup()
        {
            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            int rs = 0;
            for (int i = 1; i <= 10; i++)
            {
                var EthnicGroup = new Cat_EthnicGroup { Id = i };
                if (service.Delete<Cat_EthnicGroup>(EthnicGroup.Id) == ActionStatus.DeleteSucceed.ToString())
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Delete >>> " + i);
                }
            }
            Console.WriteLine("Total success record: " + rs);

            //NUnit.Framework.Assert.IsTrue(result);
        }
        public void NUnit_Domain_DeleteEternityCatEthnicGroup()
        {
            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            int rs = 0;

            for (int i = 1; i <= 10; i++)
            {
                var EthnicGroup = new Cat_EthnicGroup {
                    Id = i
                };
                if (service.Delete <Cat_EthnicGroup>(EthnicGroup.Id) == ActionStatus.DeleteSucceed.ToString())
                {
                    rs += 1;
                    Console.Write(" Process Success >>> DeleteEternity >>> " + i);
                }
            }
            Console.WriteLine("Total success record: " + rs);
            //NUnit.Framework.Assert.IsTrue(result);
        }
 public void NUnit_Domain_AddCatEthnicGroup()
 {
     Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
     int rs=0;
     for (int i = 0; i < 10; i++)
     {
         var EthnicGroup = new Cat_EthnicGroup
         {
             EthnicGroupName = "NUnit Domain EthnicGroupName " + i,
             EthnicGroupCode = "NUnit-EthnicGroupCode-" + i,
         };
         if (service.Add(EthnicGroup) == ActionStatus.AddSucceed.ToString())
         {
             rs += 1;
             Console.WriteLine("Process Success >>> Create >>> " + EthnicGroup.Id + " | " + EthnicGroup.EthnicGroupName + " | " + EthnicGroup.EthnicGroupCode);
         }
     }
     Console.WriteLine("Total success record: " + rs);
 }
        public void NUnit_Domain_AddCatEthnicGroup()
        {
            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            int rs = 0;

            for (int i = 0; i < 10; i++)
            {
                var EthnicGroup = new Cat_EthnicGroup
                {
                    EthnicGroupName = "NUnit Domain EthnicGroupName " + i,
                    EthnicGroupCode = "NUnit-EthnicGroupCode-" + i,
                };
                if (service.Add(EthnicGroup) == ActionStatus.AddSucceed.ToString())
                {
                    rs += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + EthnicGroup.Id + " | " + EthnicGroup.EthnicGroupName + " | " + EthnicGroup.EthnicGroupCode);
                }
            }
            Console.WriteLine("Total success record: " + rs);
        }
        public JsonResult UpdateCatEthnicGroup(HttpRequestMessage request, Cat_EthnicGroup EthnicGroup)
        {

            var model = new Cat_EthnicGroup();
            model.Id = EthnicGroup.Id;
            model.EthnicGroupName = EthnicGroup.EthnicGroupName;
            model.EthnicGroupCode = EthnicGroup.EthnicGroupCode;
            model.UserCreate = EthnicGroup.UserCreate;
            model.UserLockID = EthnicGroup.UserLockID;
            model.UserUpdate = EthnicGroup.UserUpdate;
            model.DateCreate = EthnicGroup.DateCreate;
            model.DateLock = EthnicGroup.DateLock;
            model.DateUpdate = EthnicGroup.DateUpdate;
            model.IPCreate = EthnicGroup.IPCreate;
            model.IPUpdate = EthnicGroup.IPUpdate;
            model.IsDelete = EthnicGroup.IsDelete;
            model.ServerCreate = EthnicGroup.ServerCreate;
            model.ServerUpdate = EthnicGroup.ServerUpdate;

            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            var result = service.UpdateCatEthnicGroup(model);
            if (result == false) model = null;
            return Json(model);
        }
Example #13
0
        public JsonResult GetCatEthnicGroupById([DataSourceRequest] DataSourceRequest request, Cat_EthnicGroup catEthnicGroup)
        {
            Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
            var CatEthnicGroup = service.GetByIdCatEthnicGroup(catEthnicGroup.Id);

            return(Json(CatEthnicGroup));
        }
 public JsonResult GetCatEthnicGroupById([DataSourceRequest] DataSourceRequest request, Cat_EthnicGroup catEthnicGroup)
 {
     Cat_EthnicGroupServices service = new Cat_EthnicGroupServices();
     var CatEthnicGroup = service.GetByIdCatEthnicGroup(catEthnicGroup.Id);
     return Json(CatEthnicGroup);
 }