Exemplo n.º 1
0
 /// <summary>
 /// //メインページ
 /// </summary>
 /// <returns></returns>
 public ActionResult Index()
 {
     //session値チェック
     if (Session["LoginId"] == null)
     {
         return(RedirectToAction("Account", "Account/LogOn", new { url = Request.Url }));
     }
     try
     {
         ViewData["modelList"] = groupSerivce.GetBackupServerGroupList();
     }
     catch (Exception ex)
     {
         ViewData["modelList"] = new List <BackupServerGroup>();
         logger.Error(ex.Message);
     }
     return(View());
 }
Exemplo n.º 2
0
 /// <summary>
 /// メインページ
 /// </summary>
 /// <returns></returns>
 public ActionResult Index()
 {
     try
     {
         ViewData["groupList"] = groupService.GetBackupServerGroupList();
         //ViewData["backupServerList"] = backupServerService.GetBackupServerList();
     }
     catch (Exception ex)
     {
         ViewData["groupList"] = new List <BackupServerGroup>();
         logger.Error(ex.Message);
     }
     return(View());
 }
Exemplo n.º 3
0
        private void FrmGroupDetail_Load(object sender, EventArgs e)
        {
            //init the backup group select tab
            IBackupServerGroupService backGroupList = BLLFactory.ServiceAccess.CreateBackupServerGroupService();
            IBackupServerService      bs            = BLLFactory.ServiceAccess.CreateBackupServer();
            IList <BackupServerGroup> bsgList       = backGroupList.GetBackupServerGroupList();
            List <ComboBoxItem>       cbiList       = new List <ComboBoxItem>();
            int index = 0;
            int i     = 0;

            foreach (BackupServerGroup bgs in bsgList)
            {
                if (bgs.id == id)
                {
                    index = i;
                }
                cbiList.Add(new ComboBoxItem(bgs.id.ToString(), bgs.backupServerGroupName));
                i++;
            }
            this.cobBKServerGroup.DisplayMember = "Text";
            this.cobBKServerGroup.ValueMember   = "Value";
            this.cobBKServerGroup.DataSource    = cbiList;

            //set the combobox default value;
            this.cobBKServerGroup.SelectedIndex = index;

            //not allowed user add new row to datagridview
            this.dgrdMonitorServer.AllowUserToAddRows = false;

            IList <BackupServer> gbsList = bs.GetGroupBackupServerList(this.cobBKServerGroup.SelectedValue.ToString());

            foreach (BackupServer gbs in gbsList)
            {
                DataGridViewRow dgvr = new DataGridViewRow();
                foreach (DataGridViewColumn c in dgrdMonitorServer.Columns)
                {
                    dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);//add row cells
                }
                dgvr.Cells[0].Value = gbs.id;
                dgvr.Cells[1].Value = gbs.backupServerName;
                this.dgrdMonitorServer.Rows.Add(dgvr);
            }


            //not allowed user add new row to datagridview
            this.dgrdBackupServer.AllowUserToAddRows = false;

            IList <BackupServer> bsList = bs.GetPartBackupServerList(this.cobBKServerGroup.SelectedValue.ToString());

            foreach (BackupServer bserver in bsList)
            {
                DataGridViewRow dgvr = new DataGridViewRow();
                foreach (DataGridViewColumn c in dgrdBackupServer.Columns)
                {
                    dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);//add row cells
                }
                dgvr.Cells[0].Value = bserver.id;
                dgvr.Cells[1].Value = bserver.backupServerName;
                this.dgrdBackupServer.Rows.Add(dgvr);
            }
            changed = true;
        }