Ejemplo n.º 1
0
        public void NUnit_Discipline_Domain_Add()
        {
            Hre_DisciplineServices service = new Hre_DisciplineServices();
            string result  = string.Empty;
            int    countSC = 0;

            for (int i = 1; i <= 10; i++)
            {
                var model = new Hre_Discipline
                {
                    ProfileID       = 1,
                    ViolationRule   = "ViolationRule " + i,
                    DateOfEffective = DateTime.Now,
                };
                result = service.Add(model);
                if (result != string.Empty)
                {
                    countSC += 1;
                    Console.WriteLine("Process Success >>> Create >>> " + model.Id
                                      + " | " + model.ViolationRule
                                      );
                }
            }
            Console.WriteLine("Total success record: " + countSC);
        }
Ejemplo n.º 2
0
 public void NUnit_Discipline_Domain_GetById()
 {
     string status = string.Empty;
     Hre_DisciplineServices service = new Hre_DisciplineServices();
     var model = new Hre_Discipline { Id = 10 };
     var result = service.GetById<Hre_DisciplineEntity>(model.Id, ref status) as Hre_DisciplineEntity;
     NUnit.Framework.Assert.IsNotNull(result);
     Console.Write("SearchResult: " + result.Id 
         + " | " + result.ProfileID
         + " | " + result.ViolationRule 
         );
 }
Ejemplo n.º 3
0
        public void NUnit_Discipline_Domain_GetById()
        {
            string status = string.Empty;
            Hre_DisciplineServices service = new Hre_DisciplineServices();
            var model = new Hre_Discipline {
                Id = 10
            };
            var result = service.GetById <Hre_DisciplineEntity>(model.Id, ref status) as Hre_DisciplineEntity;

            NUnit.Framework.Assert.IsNotNull(result);
            Console.Write("SearchResult: " + result.Id
                          + " | " + result.ProfileID
                          + " | " + result.ViolationRule
                          );
        }
Ejemplo n.º 4
0
        public void NUnit_Discipline_Domain_Delete()
        {
            Hre_DisciplineServices service = new Hre_DisciplineServices();
            int rs    = 0;
            var model = new Hre_Discipline {
                Id = 3
            };
            string result = service.Delete <Hre_DisciplineEntity>(model.Id);

            if (result != null)
            {
                rs += 1;
                Console.WriteLine("Process Success >>> Delete >>> " + model.Id);
            }
        }
Ejemplo n.º 5
0
        public void NUnit_Discipline_Domain_Remove()
        {
            Hre_DisciplineServices service = new Hre_DisciplineServices();
            int rs    = 0;
            var model = new Hre_Discipline {
                Id = 10
            };
            string result = service.Remove <Hre_DisciplineEntity>(model.Id);

            if (result != string.Empty)
            {
                rs += 1;
                Console.WriteLine("Process Success >>> Remove >>> " + model.Id);
            }
        }
Ejemplo n.º 6
0
 public void NUnit_Discipline_Domain_Edit()
 {
     Hre_DisciplineServices service = new Hre_DisciplineServices();
     var model = new Hre_Discipline
     {
         Id =10,
         ProfileID = 1,
         ViolationRule = "ViolationRule",
     };
     string result = service.Edit(model);
     if (result != string.Empty)
     {
         Console.WriteLine("Process Success >>> Update >>> " + model.Id
                 + " | " + model.ProfileID
                 + " | " + model.ViolationRule
                 );
     }
 }
Ejemplo n.º 7
0
        public void NUnit_Discipline_Domain_Edit()
        {
            Hre_DisciplineServices service = new Hre_DisciplineServices();
            var model = new Hre_Discipline
            {
                Id            = 10,
                ProfileID     = 1,
                ViolationRule = "ViolationRule",
            };
            string result = service.Edit(model);

            if (result != string.Empty)
            {
                Console.WriteLine("Process Success >>> Update >>> " + model.Id
                                  + " | " + model.ProfileID
                                  + " | " + model.ViolationRule
                                  );
            }
        }
Ejemplo n.º 8
0
        public void AddDiscipline()
        {
            for (int i = 0; i < 10000; i++)
            {
                var model = new Hre_Discipline
                {
                    DateOfEffective = DateTime.Now,
                    DateOfInsurance = DateTime.Now,
                    DecisionNo = "Công ty VnResource",
                    DateOfViolation = DateTime.Now,
                    DescriptionOfViolation = "Nghi nhieu",
                    ContentOfDiscipline = "Khong di lam",
                    DateOfExpiry = DateTime.Now,
                    DisciplinedDecidingOrgID = i,
                    DisciplineTypeID = i,
                    Notes = "Ghi chú",
                    ViolationRule = "ViolationRule",
                    Witnesses = "Witnesses",
                    ViolationRuleDescription = "ViolationRuleDescription",
                    ViolationRuleDescriptionEN = "ViolationRuleDescriptionEN",
                    ResultOfRecidivism = "TP. Hồ Chí Minh",
                    TimeOfViolation = "TimeOfViolation",
                    UserApprovedID = 10,
                    UserHeadID = 11,
                    ViolationExplain = "ViolationExplain",
                    UnionAgentID = i,
                    HeadAgentID = i,
                    ManagementAgentID = i,
                    PlaceViolation = "PlaceViolation",
                    DateEndOfViolation = DateTime.Now,
                    Attachment = "Attachment",
                    PercentDeduction = 59,
                    

                };
                var service = new Hre_DisciplineServices();
                var repo = service.Add(model);
                Console.Write("Record: " + repo);
            }
        }
Ejemplo n.º 9
0
        public void EditDiscipline()
        {
            var model = new Hre_Discipline
            {
                Id = 1,
                DateOfEffective = DateTime.Now,
                DateOfInsurance = DateTime.Now,
                DecisionNo = "Công ty VnResource Test update",
                DateOfViolation = DateTime.Now,
                DescriptionOfViolation = "Nghi nhieu Test update",
                ContentOfDiscipline = "Khong di lam Test update",
                DateOfExpiry = DateTime.Now,
                DisciplinedDecidingOrgID = 2,
                DisciplineTypeID = 2,
                Notes = "Ghi chú Test update",

            };
            var service = new Hre_DisciplineServices();
            var repo = service.Edit(model);
            Console.Write("Result: " + repo);

        }
Ejemplo n.º 10
0
 public void NUnit_Discipline_Domain_Add()
 {
     Hre_DisciplineServices service = new Hre_DisciplineServices();
     string result = string.Empty;
     int countSC = 0;
     for (int i = 1; i <= 10; i++)
     {
         var model = new Hre_Discipline
         {
             ProfileID = 1,
             ViolationRule = "ViolationRule " + i,
             DateOfEffective = DateTime.Now,
         };
         result = service.Add(model);
         if (result != string.Empty)
         {
             countSC += 1;
             Console.WriteLine("Process Success >>> Create >>> " + model.Id
                 + " | " + model.ViolationRule
                 );
         }
     }
     Console.WriteLine("Total success record: " + countSC);
 }
Ejemplo n.º 11
0
 public void NUnit_Discipline_Domain_Remove()
 {
     Hre_DisciplineServices service = new Hre_DisciplineServices();
     int rs = 0;
     var model = new Hre_Discipline { Id = 10 };
     string result = service.Remove<Hre_DisciplineEntity>(model.Id);
     if (result != string.Empty)
     {
         rs += 1;
         Console.WriteLine("Process Success >>> Remove >>> " + model.Id);
     }
 }
Ejemplo n.º 12
0
 public void NUnit_Discipline_Domain_Delete()
 {
     Hre_DisciplineServices service = new Hre_DisciplineServices();
     int rs = 0;
     var model = new Hre_Discipline { Id = 3 };
     string result = service.Delete<Hre_DisciplineEntity>(model.Id);
     if (result != null)
     {
         rs += 1;
         Console.WriteLine("Process Success >>> Delete >>> " + model.Id);
     }
 }