Esempio n. 1
0
        private void AddBatch(object obj)
        {
            DialogResult result = System.Windows.Forms.MessageBox.Show("Do you want to save the details?", "Confirmation", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                if (DateTime.Compare(endDate, startDate) < 0)
                {
                    System.Windows.Forms.MessageBox.Show("Start Date should be greater than enddate", "Information", MessageBoxButtons.OK);
                    return;
                }
                Batch batch = new Batch()
                {
                    BatchId = batchId, StartDate = startDate, EndDate = endDate, Stream = stream, FacultyId = facultyId
                };
                IBatch batch1 = new BatchService(new Data.WpfDbContext());
                batch1.AddBatch(batch);
            }
        }
 public async Task <ActionResponse> CreateBatch(Batch batch)
 {
     return(await _batchService.AddBatch(batch));
 }