Example #1
0
        private void saveOperation()
        {
            try
            {
                innerFlag = groupSerivce.InsertBackupServerGroup(this.innerBackupServerGroup);
                innerFlag = backupService.InsertBackupServer(innerBackupServer);
                //add relation detail
                IList <BackupServerGroup> groupList = groupSerivce.GetBackupServerGroupByName(this.innerBackupServerGroup.backupServerGroupName);
                IList <BackupServer>      bkList    = backupService.GetBackupServerListByName(innerBackupServer.backupServerName);
                if (groupList.Count > 0 && bkList.Count > 0)
                {
                    BackupServerGroupDetail modelDetail = new BackupServerGroupDetail();
                    modelDetail.backupServerGroupId = Convert.ToInt32(groupList[0].id);
                    modelDetail.backupServerId      = Convert.ToInt32(bkList[0].id);
                    modelDetail.deleteFlg           = 0;
                    modelDetail.creater             = FrmMain.userinfo.loginID;
                    modelDetail.createDate          = CommonUtil.DateTimeNowToString();
                    modelDetail.updater             = FrmMain.userinfo.loginID;
                    modelDetail.updateDate          = CommonUtil.DateTimeNowToString();

                    IBackupServerGroupDetailService groubDetailService = BLLFactory.ServiceAccess.CreateBackupServerGroupDetailService();
                    innerFlag = groubDetailService.InsertBackupServerGroupDetail(modelDetail);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }
Example #2
0
        public ActionResult Add(BackupServerGroup model, BackupServer bkModel)
        {
            int result = -1;

            //session获取值
            if (Session["LoginId"] == null)
            {
                result = -99;
            }
            else
            {
                try
                {
                    string dt      = CommonUtil.DateTimeNowToString();
                    string loginId = Session["LoginId"].ToString();

                    model.backupServerGroupName = bkModel.backupServerName;
                    model.creater    = loginId;
                    model.createDate = dt;
                    model.updater    = loginId;
                    model.updateDate = dt;
                    model.deleteFlg  = 0;
                    result           = groupSerivce.InsertBackupServerGroup(model);

                    bkModel.creater    = loginId;
                    bkModel.createDate = dt;
                    bkModel.updater    = loginId;
                    bkModel.updateDate = dt;
                    bkModel.deleteFlg  = 0;
                    result             = bkService.InsertBackupServer(bkModel);

                    //add relation detail
                    IList <BackupServerGroup> groupList = groupSerivce.GetBackupServerGroupByName(model.backupServerGroupName);
                    IList <BackupServer>      bkList    = bkService.GetBackupServerListByName(bkModel.backupServerName);
                    if (groupList.Count > 0 && bkList.Count > 0)
                    {
                        BackupServerGroupDetail modelDetail = new BackupServerGroupDetail();
                        modelDetail.backupServerGroupId = Convert.ToInt32(groupList[0].id);
                        modelDetail.backupServerId      = Convert.ToInt32(bkList[0].id);
                        modelDetail.deleteFlg           = 0;
                        modelDetail.creater             = loginId;
                        modelDetail.createDate          = dt;
                        modelDetail.updater             = loginId;
                        modelDetail.updateDate          = dt;
                        result = groubDetailService.InsertBackupServerGroupDetail(modelDetail);
                    }
                }
                catch (Exception ex)
                {
                    result = -10;
                    logger.Error(ex.Message);
                }
            }
            Response.Write(result);
            Response.End();
            return(null);
        }
Example #3
0
        /// <summary>
        /// 転送先グループ対象名が存在するかをチェックする。
        /// </summary>
        /// <param name="groupName"></param>
        /// <returns></returns>
        public ActionResult CheckNameIsExists(string groupName)
        {
            int result = 0;

            try
            {
                IList <BackupServerGroup> groupList = groupSerivce.GetBackupServerGroupByName(groupName);
                result = groupList.Count;
            }
            catch (Exception ex)
            {
                result = -10;
                logger.Error(ex.Message);
            }
            Response.Write(result);
            Response.End();
            return(null);
        }
Example #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string nameMessage   = ValidationRegex.ValidteEmpty(this.lblName.Text, this.txtMonitorName.Text);
            string serverMessage = ValidationRegex.ValidteEmpty(this.lblServer.Text, this.cobMonitorServer.Text);

            if (nameMessage != "")
            {
                MsgHelper.WarningMsg(nameMessage, ValidationRegex.publicTitle);
                return;
            }
            else if (serverMessage != "")
            {
                MsgHelper.WarningMsg(serverMessage, ValidationRegex.publicTitle);
                return;
            }
            else
            {
                string id = this.txtMonitorId.Text;
                //save operation
                //BackupServerGroup backupServerGroup = new BackupServerGroup();

                innerBackupServerGroup.backupServerGroupName = this.txtMonitorName.Text.Trim();
                innerBackupServerGroup.monitorServerID       = this.cobMonitorServer.SelectedValue.ToString();
                innerBackupServerGroup.memo       = this.txtMonitorMemo.Text.Trim();
                innerBackupServerGroup.deleteFlg  = 0;
                innerBackupServerGroup.creater    = FrmMain.userinfo.loginID;
                innerBackupServerGroup.createDate = CommonUtil.DateTimeNowToString();
                innerBackupServerGroup.updater    = FrmMain.userinfo.loginID;
                innerBackupServerGroup.updateDate = CommonUtil.DateTimeNowToString();

                //IBackupServerGroupService backupService = BLLFactory.ServiceAccess.CreateBackupServerGroupService();
                //int flag = -1;
                if (id == "")
                {
                    IList <BackupServerGroup> existLists = backupService.GetBackupServerGroupByName(this.txtMonitorName.Text.Trim());
                    if (existLists.Count > 0)
                    {
                        string msg = ValidationRegex.W008;
                        msg = msg.Replace("{1}", this.lblName.Text);
                        MsgHelper.WarningMsg(msg, ValidationRegex.publicTitle);
                    }
                    else
                    {
                        if (MsgHelper.QuestionMsg(ValidationRegex.Q001, ValidationRegex.publicTitle))
                        {
                            ProgressbarEx.Progress.StartProgessBar(new ProgressbarEx.ShowProgess(saveOperation));
                        }
                        if (innerFlag > -1)
                        {
                            MsgHelper.InfoMsg(ValidationRegex.I001, ValidationRegex.publicTitle);
                            gFlag = true;
                            this.Dispose();
                        }
                    }
                }
                else
                {
                    innerBackupServerGroup.id = id;
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q002, ValidationRegex.publicTitle))
                    {
                        ProgressbarEx.Progress.StartProgessBar(new ProgressbarEx.ShowProgess(updateOperation));
                    }
                    if (innerFlag > -1)
                    {
                        MsgHelper.InfoMsg(ValidationRegex.U001, ValidationRegex.publicTitle);
                        gFlag = true;
                        this.Dispose();
                    }
                }
            }
        }