/// <summary> /// init the backup server modifification page /// </summary> private void FrmTransfer_Load(object sender, EventArgs e) { //get monitor server by record id if (!String.IsNullOrWhiteSpace(id)) { IBackupServerService bs = BLLFactory.ServiceAccess.CreateBackupServer(); backupServer = bs.GetBackupServerById(Convert.ToInt32(id)); this.txtTrId.Text = backupServer.id.ToString(); this.txtTrName.Text = backupServer.backupServerName; this.txtTrIp.Text = backupServer.backupServerIP; this.txtTrMemo.Text = backupServer.memo; this.txtTraccount.Text = backupServer.account; this.txtTrPass.Text = backupServer.password; this.txtTrStfile.Text = backupServer.startFile; //Set the related MonitorServer. this.innerBackupServerGroup = groupSerivce.GetBackupServerGroupByBackupServerID(Convert.ToInt32(id)); foreach (object item in this.cobMonitorServer.Items) { ComboBoxItem cobItem = (ComboBoxItem)item; if (cobItem.Value != null && cobItem.Value.Equals(this.innerBackupServerGroup.monitorServerID)) { this.cobMonitorServer.SelectedItem = item; break; } } this.txtBackupServerGroupName.Text = this.innerBackupServerGroup.backupServerGroupName; } else { this.IP_StartFolder = CommonUtil.GetTransfer_IP_StartFolder(); } }
/// <summary> /// 転送先・編集ページ /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Edit(int id) { try { ViewData["bkserver"] = bkService.GetBackupServerById(id); ViewData["msList"] = mService.GetMonitorServerList(); ViewData["model"] = groupSerivce.GetBackupServerGroupByBackupServerID(id); } catch (Exception ex) { ViewData["bkserver"] = new BackupServer(); ViewData["msList"] = new MonitorServer(); ViewData["model"] = new BackupServerGroup(); logger.Error(ex.Message); } return(View()); }