예제 #1
0
        private void buttonFindStudent_Click(object sender, EventArgs e)
        {
            var activityId = Guid.NewGuid().ToString();
            var logger     = new ShafiqKhuidadAppLogger("ShafiqKhuidadAppLogger", activityId, "FindWindow");
            var name       = textBoxName.Text;
            var count      = StudentFackRepo.GetStudentList().Count(x => x.Name.Contains(name));

            if (count > 0)
            {
                logger.Info($"Info : Student recored found with Name {name} ");
            }
            else
            {
                logger.Error($"Error : No Record Found for Name {name}");
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var student = new Student()
            {
                Name = textBoxName.Text,
                Age  = textBoxAge.Text
            };

            label1.Text = student.Name + " " + student.Age;
            var someLogger = new ShafiqKhuidadAppLogger("ShafiqKhuidadAppLogger", Guid.NewGuid().ToString(), "LogInWindow");
            var props      = new Dictionary <string, string>();

            props.Add("Name", student.Name);
            props.Add("Age", student.Age);
            someLogger.Info($"Info : Student Recored is added ", props);
        }