private void btnAdd_Click(object sender, EventArgs e)
        {
            Data.JHStudentRecord student = Data.JHStudent.SelectByID(PrimaryKey);
            CreateForm           form    = new CreateForm(student);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (form.Course == null)
                {
                    return;
                }

                try
                {
                    Data.JHSCAttendRecord scattend = new JHSchool.Data.JHSCAttendRecord();
                    scattend.RefCourseID  = form.Course.ID;
                    scattend.RefStudentID = PrimaryKey;
                    Data.JHSCAttend.Insert(scattend);
                }
                catch (Exception ex)
                {
                    MsgBox.Show("新增修課記錄失敗。" + ex.Message);
                }

                ScoreInputForm inputform = new ScoreInputForm(student, form.Course);
                inputform.ShowDialog();

                if (!_worker.IsBusy)
                {
                    _RunningID = PrimaryKey;
                    _worker.RunWorkerAsync();
                }
            }
        }
        public void onCreateProcess(object sender, EventArgs e)
        {
            CreateForm myCreateForm = createForm as CreateForm;

            myCreateForm.ShowDialog();

            if (createForm.path != "")
            {
                client.createRemoteTask(createForm.path);
            }
        }
Exemple #3
0
 private void BtnAdd_Click(object sender, EventArgs e)
 {
     if (_lastType != null)
     {
         using (var cf = new CreateForm((DbObject)Activator.CreateInstance(_lastType), FormGoal.Add))
         {
             cf.ShowDialog();
             RefreshDataGridView();
         }
     }
 }
Exemple #4
0
        //Add Button Behaviour
        private void mainAddButton_Click(object sender, EventArgs e)
        {
            createDialog.ShowDialog();

            if (createDialog.DialogResult == DialogResult.OK)
            {
                clientVM.Clients = DataAccessObject.SelectAll();
                dataGridViewClients.DataSource = clientVM.Clients;
                dataGridViewClients.Refresh();
                setOutputLabel();
            }
        }
Exemple #5
0
        private void BtnUpdate_Click(object sender, EventArgs e)
        {
            if (DVValues.SelectedCells.Count > 0)
            {
                var genericCRUD = GetCRUD(_lastType);
                var entity      = genericCRUD.GetOne(DVValues.SelectedId);

                using (var frm = new CreateForm((DbObject)entity, FormGoal.Update))
                {
                    frm.ShowDialog();
                    RefreshDataGridView();
                }
            }
        }
Exemple #6
0
        static void CreateForm(string objectClass, VMDirServerDTO dto)
        {
            var frm = new CreateForm(objectClass, dto);

            if (frm.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            var attributes = frm.Attributes.Select(x => LdapTypesService.MakeAttribute(x)).ToArray();

            var    cnVal = frm.Attributes.First(x => x.Key == "cn").Value.Value;
            string dn    = string.Format("cn={0},{1}", cnVal, "dc=vsphere,dc=local");

            dto.Connection.Add(dn, attributes);
        }
Exemple #7
0
 private void ButtonAddJob_Click(object sender, EventArgs e)
 {
     if (_currentDayEvent != null)
     {
         using (var frm = new CreateForm(new Job {
             EventDate = _currentDayEvent.EventDate
         }, FormGoal.Add))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 EventAdded(_currentDayEvent.EventDate.Day, _currentDayEvent.EventDate.Month);
                 RefreshLists();
             }
         }
     }
 }
Exemple #8
0
 private void ButtonAddEvent_Click(object sender, EventArgs e)
 {
     if (_currentDayEvent != null)
     {
         using (var frm = new CreateForm(new Event(), FormGoal.None))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 var eventEntity = frm.Entity as Event;
                 _currentDayEvent.Events.Add(eventEntity);
                 DbFactory.DayEventCRUD.Upsert(_currentDayEvent);
                 EventAdded(_currentDayEvent.EventDate.Day, _currentDayEvent.EventDate.Month);
                 RefreshLists();
             }
         }
     }
 }
 public void AddObject()
 {
     MiscUtilsService.CheckedExec(delegate
     {
         var frmSelect = new SelectObjectClass(ServerDTO.Connection.SchemaManager);
         if (frmSelect.ShowDialog() == DialogResult.OK)
         {
             var frm = new CreateForm(frmSelect.SelectedObject, ServerDTO, Dn);
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 var attributes = frm.Attributes.Select(x => LdapTypesService.MakeAttribute(x)).ToArray();
                 string newdn   = frm.Rdn + "," + Dn;
                 ServerDTO.Connection.AddObject(newdn, attributes);
                 ClearDummyNode();
                 var oc = VMDirUtil.Utilities.GetObjectClassList(ServerDTO, newdn, LdapScope.SCOPE_BASE);
                 this.Nodes.Insert(0, new DirectoryExpandableNode(newdn, oc, ServerDTO, PropertiesCtl));
                 MMCDlgHelper.ShowInformation(VMDirConstants.STAT_OBJ_ADD_SUCC);
             }
         }
     });
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            JHStudentRecord student = JHStudent.SelectByID(PrimaryKey);
            CreateForm      form    = new CreateForm(student);

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (form.Course == null)
                {
                    return;
                }

                try
                {
                    JHSCAttendRecord scattend = new JHSCAttendRecord();
                    scattend.RefCourseID  = form.Course.ID;
                    scattend.RefStudentID = PrimaryKey;
                    JHSCAttend.Insert(scattend);
                    StringBuilder builder = new StringBuilder("");
                    builder.Append(StudentInfoConvertor.GetInfoWithClass(student));
                    builder.Append(" 加入修課:" + form.Course.Name);
                    FISCA.LogAgent.ApplicationLog.Log("成績系統.修課及評量成績", "新增修課", "student", PrimaryKey, builder.ToString());
                }
                catch (Exception ex)
                {
                    MsgBox.Show("新增修課記錄失敗。" + ex.Message);
                }

                ScoreInputForm inputform = new ScoreInputForm(student, form.Course);
                inputform.ShowDialog();

                if (!_worker.IsBusy)
                {
                    _RunningID = PrimaryKey;
                    _worker.RunWorkerAsync();
                }
            }
        }