private void btnTab1Save_Click(object sender, EventArgs e) { try { ConfigHeader_bindingSource1.EndEdit(); mstconfigdtlsBindingSource.EndEdit(); dbc.SubmitChanges(); lbMsgAlertTab1.Text = "Save data completed."; } catch (Exception ex) { Program.MessageError(ex.Message); } }
private void btntab1_NewConfig_Header_Click(object sender, EventArgs e) { ConfigHeader_bindingSource1.AddNew(); DateTime dtnow = Program.GetServerDateTime(); mst_config_hdr currenthdr = (mst_config_hdr)ConfigHeader_bindingSource1.Current; if (currenthdr != null) { string username = Program.CurrentUser.mut_username; int mshid = (from t1 in dbc.mst_hpc_sites select t1.mhs_id).FirstOrDefault(); currenthdr.mhs_id = mshid; currenthdr.mfh_status = 'A'; currenthdr.mfh_effective_date = dtnow; currenthdr.mfh_expire_date = dtnow.AddYears(1); currenthdr.mfh_create_by = username; currenthdr.mfh_create_date = dtnow; currenthdr.mfh_update_by = username; currenthdr.mfh_update_date = dtnow; Ch_configHeader_IsActive.Checked = true; } }