private void btnBackup_Click(object sender, EventArgs e) { //DAL_DbBackUp NewDALObj = new DAL_DbBackUp(); //NewDALObj.DbBackUp(); try { DAL_DbBackUp dalDbBackUp = new DAL_DbBackUp(); if (dalDbBackUp.DatabaseBackup()) { txtAttachment.Enabled = true; dalDbBackUp.CreateBackUpLog(); this.btnAttachement.Enabled = true; this.btnSendEmail.Enabled = false; this.btnBackUp.Enabled = false; } else { dalDbBackUp.CreateBackUpLog(); this.txtAttachment.Enabled = false; this.btnAttachement.Enabled = false; this.btnSendEmail.Enabled = false; this.btnBackUp.Enabled = true; } } catch (Exception ex) { int num = (int)MessageBox.Show(ex.Message, "Easy Rashan Management System", MessageBoxButtons.OK, MessageBoxIcon.Hand); } }
private void FrmMain_Load(object sender, EventArgs e) { DAL_DbBackUp NewDALObj = new DAL_DbBackUp(); DataTable dt = new DataTable(); DateTime dtDueDate = DateTime.Now.Date; string Fromday = dtDueDate.Day.ToString(); string FromMonth = dtDueDate.Month.ToString(); string Year = dtDueDate.Year.ToString(); if (int.Parse(Fromday.ToString()) <= 9) { Fromday = "0" + Fromday; } if (int.Parse(FromMonth.ToString()) <= 9) { FromMonth = "0" + FromMonth; } string FromDate = Year + "-" + FromMonth + "-" + Fromday; dt = NewDALObj.GetDueDate(FromDate); //dt = NewDALObj.ColumnCreation(); if (dt.Rows.Count > 0) { //Shaban Comment //FrmRemainingKnockOff NewFrm = new FrmRemainingKnockOff(); //NewFrm.ShowDialog(); } //NewDALObj.TableCreation(); //Timer MyTimer = new Timer(); //MyTimer.Interval = (1 * 60 * 1000); // 1 mins //MyTimer.Tick += new EventHandler(MyTimer_Tick); //MyTimer.Start(); //GlobalVaribles gblvar = new GlobalVaribles(); //Infragistics.Win.AppStyling.StyleManager.Load(Application.StartupPath + "\\styles\\" + gblvar.Style ); }