コード例 #1
0
        private void EditBarItem_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (working_time != null)
            {
                string oddeven          = (Odd_EvenCB.SelectedIndex == 1) ? "Neparni" : "Parni";
                string morningafternoon = (Morning_AfternoonCB.SelectedIndex == 1) ? "Jutro" : "Posljepodne";

                working_time.Odd_Even          = oddeven;
                working_time.Morning_Afternoon = morningafternoon;
                if (!_DB.UpdateWorkingDays(working_time))
                {
                    XtraMessageBox.Show("Element is not edited!");
                }
                _working_time = _DB.GetWorkingTime();
                WorkingTimeGridControl.DataSource = _working_time;
                Odd_EvenCB.SelectedIndex          = 0;
                Morning_AfternoonCB.SelectedIndex = 0;
            }
            else
            {
                XtraMessageBox.Show("All fields should be filled!");
            }
        }