protected void cmdSave_Click(object sender, EventArgs e)
        {
            try
            {
                IQCareUtils theUtils = new IQCareUtils();
                DateTime    theTime;
                if (ddBackupTime.SelectedValue != "0")
                {
                    theTime = Convert.ToDateTime(ddBackupTime.SelectedItem.ToString());
                }
                else
                {
                    theTime = Convert.ToDateTime("1900-01-01");
                }

                IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                int            noRows       = BackupManger.SaveBackupSetup(ddBackupDrive.SelectedItem.ToString(), theTime);
                BackupManger = null;
                IQCareMsgBox.Show("BackupSetupSave", this);
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareMsgBox.Show("#C1", theBuilder, this);
            }
        }
示例#2
0
        protected void cmdSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (showSetup == "")
                {
                    IQCareUtils theUtils = new IQCareUtils();
                    DateTime    theTime;
                    string      timeStr  = Request.Form[ddBackupTime.UniqueID].ToString();
                    string      driveStr = Request.Form[ddBackupDrive.UniqueID].ToString();

                    if (timeStr != "0" || timeStr != "")
                    {
                        theTime = Convert.ToDateTime(timeStr);
                    }
                    else
                    {
                        theTime = Convert.ToDateTime("1900-01-01");
                    }
                    Session["BackupDrive"] = driveStr;
                    IFacilitySetup BackupManger = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
                    int            noRows       = BackupManger.SaveBackupSetup(driveStr, theTime);
                    BackupManger = null;
                    //IQCareMsgBox.Show("BackupSetupSave", this);
                    IQCareMsgBox.NotifyAction("Backup Setup Updated Successfully", "Database Backup Setup", false, this, "window.location.href='../AdminForms/frmDBBackup.aspx'");
                }
                else
                {
                    IQCareMsgBox.NotifyAction("Your are not authorized to setup database backup", "Database Backup Setup", true, this, "");
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                    Response.Redirect("~/frmLogOff.aspx", false);
                }
            }
            catch (Exception err)
            {
                //MsgBuilder theBuilder = new MsgBuilder();
                //theBuilder.DataElements["MessageText"] = err.Message.ToString();
                //IQCareMsgBox.Show("#C1", theBuilder, this);
                IQCareMsgBox.NotifyAction(err.Message, "Database Backup Setup", true, this, "");
            }
        }