private void buttonSave_Click(object sender, EventArgs e) { var bSuccessfull = false; var setNme = String.Format(@"USB{0}", DateTime.Now); Application.DoEvents(); Thread.Sleep(200); machineInsNameTextBox.Text = setNme; //save machine instance var iResult = SaveMachineInstance(); if (iResult <= 0) { return; } var listLogs = DTRManagement.RemoveDuplicateUsb(_listDat, iResult); var iiResult = MachineManager.Save(listLogs); if (iiResult <= 0) { return; } List <MacDumpLog> listMacDump; var listDTR = DTRManagement.LoadEnrolleeAttendanceDtrAll(EmployeeManager.GetAll(true), out listMacDump, User.UserName); //save DTR var iiiResult = DTRManager.Save(listDTR); if (iiiResult > 0) { bSuccessfull = true; } //save macDump if (listMacDump.Count > 0) { var tempMacDump = new List <MacDumpLog>(); foreach (var dumpLog in listMacDump) { if (dumpLog.MacDumpDate != null) { tempMacDump.Add(dumpLog); } } var iiiiResult = MacDumpLogManager.Save(tempMacDump); if (iiiiResult > 0) { Console.WriteLine(@"MacDump Successfully Record."); } } if (bSuccessfull) { MessageBox.Show(@"DTR Generated Successfully. Kindly Close the form and go to DTR Management", @"Save - DTR", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(@"Error occured during save.", @"Error Save - DTR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void DTRUpdateForm_Load(object sender, EventArgs e) { buttonOk.Enabled = false; macDumpLogBindingSource.DataSource = MacDumpLogManager.GetAll(IEnrolleeNo.ToString(), SDate); }