private void butAdd_Click(object sender, EventArgs e)
        {
            FormInsFilingCodeSubtypeEdit FormI = new FormInsFilingCodeSubtypeEdit();

            FormI.InsFilingCodeSubtypeCur       = new InsFilingCodeSubtype();
            FormI.InsFilingCodeSubtypeCur.IsNew = true;
            FormI.ShowDialog();
            if (FormI.DialogResult == DialogResult.OK)
            {
                if (InsFilingCodeCur.IsNew)
                {
                    //If we are adding a subtype to a new filing code, then we need to
                    //save the filing code to the database to generate the InsFilingCodeNum,
                    //so that we can then save teh InsFilingCodeSubtype record with the correct
                    //foreign key.
                    SaveFilingCode();
                    InsFilingCodeCur.IsNew = false;
                }
                FormI.InsFilingCodeSubtypeCur.InsFilingCodeNum = InsFilingCodeCur.InsFilingCodeNum;
                try {
                    InsFilingCodeSubtypes.Insert(FormI.InsFilingCodeSubtypeCur);
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                    return;
                }
                FillGrid();
            }
        }
        private void gridInsFilingCodeSubtypes_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            FormInsFilingCodeSubtypeEdit FormI = new FormInsFilingCodeSubtypeEdit();

            FormI.InsFilingCodeSubtypeCur = insFilingCodeSubtypes[e.Row].Clone();
            FormI.ShowDialog();
            if (FormI.DialogResult == DialogResult.OK)
            {
                try {
                    InsFilingCodeSubtypes.Update(FormI.InsFilingCodeSubtypeCur);
                }
                catch (Exception ex) {
                    MessageBox.Show(ex.Message);
                    return;
                }
            }
            FillGrid();
        }
Example #3
0
		private void butAdd_Click(object sender,EventArgs e) {
			FormInsFilingCodeSubtypeEdit FormI=new FormInsFilingCodeSubtypeEdit();
			FormI.InsFilingCodeSubtypeCur=new InsFilingCodeSubtype();
			FormI.InsFilingCodeSubtypeCur.IsNew=true;
			FormI.ShowDialog();
			if(FormI.DialogResult==DialogResult.OK) {
				if(InsFilingCodeCur.IsNew){
					//If we are adding a subtype to a new filing code, then we need to
					//save the filing code to the database to generate the InsFilingCodeNum,
					//so that we can then save teh InsFilingCodeSubtype record with the correct
					//foreign key.
					SaveFilingCode();
					InsFilingCodeCur.IsNew=false;
				}
				FormI.InsFilingCodeSubtypeCur.InsFilingCodeNum=InsFilingCodeCur.InsFilingCodeNum;
				try {
					InsFilingCodeSubtypes.Insert(FormI.InsFilingCodeSubtypeCur);
				} 
				catch(Exception ex) {
					MessageBox.Show(ex.Message);
					return;
				}
				FillGrid();
			}
		}
Example #4
0
		private void gridInsFilingCodeSubtypes_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			FormInsFilingCodeSubtypeEdit FormI=new FormInsFilingCodeSubtypeEdit();
			FormI.InsFilingCodeSubtypeCur=insFilingCodeSubtypes[e.Row].Clone();
			FormI.ShowDialog();
			if(FormI.DialogResult==DialogResult.OK){
				try {
					InsFilingCodeSubtypes.Update(FormI.InsFilingCodeSubtypeCur);
				} 
				catch(Exception ex) {
					MessageBox.Show(ex.Message);
					return;
				}
			}
			FillGrid();
		}