public void AutoBackup(string application) { Inventori.Facade.DataMasterMgtServices DataMaster = new Inventori.Facade.DataMasterMgtServices(); Inventori.Data.MSetting set = (Inventori.Data.MSetting)DataMaster.GetObjectByProperty(typeof(Inventori.Data.MSetting), Inventori.Data.MSetting.ColumnNames.SettingId, application); if (set == null) { return; } if (set.AutoBackup) { if (f_BackupDB != null) { if (!f_BackupDB.IsDisposed) { f_BackupDB.Close(); } } f_BackupDB = new FormBackupDatabase(); f_BackupDB.lbl_UserName.Text = toolStripStatusLabelLoginName.Text; string BackupFileExtention = "backup"; f_BackupDB.txt_BackupFile.Text = set.BackupDir + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss.") + BackupFileExtention; f_BackupDB.lbl_Auto.Text = set.AutoBackup.ToString(); f_BackupDB.ShowDialog(); } }
private void FormMain_Load(object sender, System.EventArgs e) { try { Inventori.Facade.DataMasterMgtServices DataMaster = new Inventori.Facade.DataMasterMgtServices(); Inventori.Data.MSetting set = (Inventori.Data.MSetting)DataMaster.GetObjectByProperty(typeof(Inventori.Data.MSetting), Inventori.Data.MSetting.ColumnNames.SettingId, AppCode.AssemblyProduct); if (set != null) { toolStripStatusLabel_CompanyName.Text = set.CompanyName; } else { toolStripStatusLabel_CompanyName.Text = "Demo "; } } catch (Exception) { toolStripStatusLabel_CompanyName.Text = ""; } }
void hapusTransaksiToolStripMenuItem_Click(object sender, EventArgs e) { formDel = new FormDeleteConfirm(FormDeleteConfirm.DeletePin.PO); if (formDel.ShowDialog(this) == DialogResult.OK) { Inventori.Facade.DataMasterMgtServices DataMaster = new Inventori.Facade.DataMasterMgtServices(); Inventori.Data.TTransaction trans = null; if (f_SearchTrans.grid_Search.RowCount > 0) { trans = (Inventori.Data.TTransaction)DataMaster.GetObjectByProperty(typeof(Inventori.Data.TTransaction), Inventori.Data.TTransaction.ColumnNames.TransactionId, decimal.Parse(f_SearchTrans.grid_Search.CurrentRow.Cells[0].Value.ToString())); } if (trans != null) { DataMaster.Delete(trans); ModuleControlSettings.SaveLog(ListOfAction.Delete, f_SearchTrans.grid_Search.CurrentRow.Cells[0].Value.ToString(), ListOfTable.TTransaction, toolStripStatusLabelLoginName.Text); f_SearchTrans.BindData(null, null); f_SearchTrans.Refresh(); } } }