Example #1
0
        private void btnGroupDetailSave_Click(object sender, EventArgs e)
        {
            IBackupServerService            bs = BLLFactory.ServiceAccess.CreateBackupServer();
            IBackupServerGroupDetailService backGroupDetail = BLLFactory.ServiceAccess.CreateBackupServerGroupDetailService();
            //get the combobox selected value
            string selectGroupId = this.cobBKServerGroup.SelectedValue.ToString();

            if (MsgHelper.QuestionMsg(ValidationRegex.Q002, ValidationRegex.publicTitle))
            {
                int delFlg = backGroupDetail.DeleteBackupServerGroupDetailByGroupId(Convert.ToInt32(selectGroupId), FrmMain.userinfo.loginID);
                if (delFlg > -1)
                {
                    for (int i = 0; i < this.dgrdMonitorServer.Rows.Count; i++)
                    {
                        BackupServerGroupDetail bsgd = new BackupServerGroupDetail();
                        string backupServerId        = this.dgrdMonitorServer.Rows[i].Cells[0].Value.ToString();
                        bsgd.backupServerGroupId = Convert.ToInt32(selectGroupId);
                        bsgd.backupServerId      = Convert.ToInt32(backupServerId);
                        bsgd.creater             = FrmMain.userinfo.loginID;
                        bsgd.createDate          = DateTime.Now.ToString();
                        bsgd.updater             = FrmMain.userinfo.loginID;
                        bsgd.updateDate          = DateTime.Now.ToString();
                        int insertFlg = backGroupDetail.InsertBackupServerGroupDetail(bsgd);
                        if (insertFlg > -1)
                        {
                            MsgHelper.InfoMsg(ValidationRegex.I001, ValidationRegex.publicTitle);
                            this.Dispose();
                        }
                        else
                        {
                            MsgHelper.InfoMsg(ValidationRegex.I002, ValidationRegex.publicTitle);
                        }
                    }
                }
            }
        }