コード例 #1
0
 private void Remove()
 {
     try
     {
         ErrorMessage = WarningMessage = InfoMessage = string.Empty;
         var studentObj = new Student
         {
             RollNo         = _rollNo,
             StudentName    = _studentname,
             BranchName     = _branchName,
             RegistrationID = _registrationId
         };
         var Student = ViewDetails.GetStudentDetails(RollNo).FirstOrDefault();
         if (RemoveDetails.RemoveStudentDetails(Student))
         {
             InfoMessage = studentObj.ToString();
             GetAllStudents();
         }
         else
         {
             WarningMessage = "Data is already removed from database.";
         }
     }
     catch (Exception e)
     {
         ErrorMessage = e.Message.ToString();
         logmsg.Log(LogMessage.LogType.Error, e.ToString());
     }
 }
コード例 #2
0
 private void GetStudent()
 {
     try
     {
         ErrorMessage = WarningMessage = InfoMessage = string.Empty;
         Students     = ViewDetails.GetStudentDetails(RollNo);
         if (Students.Count < 1)
         {
             WarningMessage = "No data found with selected roll number.";
         }
     }
     catch (Exception e)
     {
         ErrorMessage = e.Message.ToString();
         logmsg.Log(LogMessage.LogType.Error, e.ToString());
     }
 }