コード例 #1
0
        private void AddPeriode(object sender, EventArgs e)
        {
            DateTime   mulai   = dateEdit1.DateTime;
            DateTime   selesai = dateEdit2.DateTime;
            string     a       = comboBoxEdit1.SelectedItem.ToString();
            IadmClient service = new IadmClient();
            periode    data    = new periode()
            {
                semester      = a,
                awalSemester  = mulai,
                akhirSemester = selesai
            };

            service.addPeriode(data);
            gridControl1.DataSource = service.viewPeriode().Select(x => new
            {
                semester      = $"{x.semester} {x.awalSemester.ToString("yyyy")}/{x.akhirSemester.ToString("yyyy")}",
                awalSemester  = x.awalSemester.ToString("dd MMMM yyyy", new CultureInfo("id-ID")),
                akhirSemester = x.akhirSemester.ToString("dd MMMM yyyy", new CultureInfo("id-ID"))
            }).ToList();
            service.Close();
        }