コード例 #1
0
ファイル: FrmGroupTransfer.cs プロジェクト: hst-bridge/BBS
 /// <summary>
 /// 入力値が変更され画面が閉じられ用としたときに、注意を促し、閉じるかどうかを返す
 /// </summary>
 /// <returns>画面を閉じる場合はtrue</returns>
 private bool hasBeenOpened()
 {
     //shutdown the current page
     //新規入力:入力された場合
     if ((string.IsNullOrEmpty(id) &&
          (!string.IsNullOrWhiteSpace(this.txtMonitorName.Text) ||
           !string.IsNullOrWhiteSpace(this.txtMonitorMemo.Text) ||
           this.cobMonitorServer.SelectedIndex > 1
          )
          )
         //保存済みの値の変更:値が変更された場合
         || (!string.IsNullOrEmpty(id) &&
             (backupServerGroup.backupServerGroupName != this.txtMonitorName.Text.Trim() ||
              backupServerGroup.memo != this.txtMonitorMemo.Text.Trim() ||
              backupServerGroup.monitorServerID != (this.cobMonitorServer.SelectedIndex >= 0 ? this.cobMonitorServer.SelectedValue.ToString() : string.Empty)
             )
             )
         )
     {
         //確認して閉じてもOKと答えられた場合 true
         return(MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle));
     }
     else
     {
         return(true);
     }
 }
コード例 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool mesFlg = messageCheck();

            if (mesFlg)
            {
                return;
            }
            else
            {
                string id = this.txtTrId.Text;
                //save operation
                //BackupServer backupServer = new BackupServer();
                this.innerBackupServerGroup.monitorServerID       = this.cobMonitorServer.SelectedValue.ToString();
                this.innerBackupServerGroup.backupServerGroupName = innerBackupServer.backupServerName = this.txtTrName.Text.Trim();
                innerBackupServer.backupServerIP       = this.txtTrIp.Text.Trim();
                this.innerBackupServerGroup.memo       = innerBackupServer.memo = this.txtTrMemo.Text.Trim();
                innerBackupServer.account              = this.txtTraccount.Text.Trim();
                innerBackupServer.password             = this.txtTrPass.Text.Trim();
                innerBackupServer.startFile            = this.txtTrStfile.Text.Trim();
                innerBackupServer.ssbpath              = this.txtssbpath.Text.Trim();
                this.innerBackupServerGroup.deleteFlg  = innerBackupServer.deleteFlg = 0;
                this.innerBackupServerGroup.creater    = innerBackupServer.creater = FrmMain.userinfo.loginID;
                this.innerBackupServerGroup.createDate = innerBackupServer.createDate = CommonUtil.DateTimeNowToString();
                this.innerBackupServerGroup.updater    = innerBackupServer.updater = FrmMain.userinfo.loginID;
                this.innerBackupServerGroup.updateDate = innerBackupServer.updateDate = CommonUtil.DateTimeNowToString();

                IBackupServerService backupService = BLLFactory.ServiceAccess.CreateBackupServer();
                //int flag = -1;
                if (id == "")
                {
                    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
                {
                    innerBackupServer.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();
                    }
                }
            }
        }
コード例 #3
0
        private void FrmGroupFile_FormClosing(object sender, FormClosingEventArgs e)
        {
            string sysChk = "0";
            string hidChk = "0";

            if (this.chkSystemFileFlg.Checked == true)
            {
                sysChk = "1";
            }
            if (this.chkSystemFileFlg.Checked == true)
            {
                hidChk = "1";
            }
            string chkExceptAttrFlg1 = this.chkExceptAttr1.Checked == true ? "1" : "0";
            string chkExceptAttrFlg2 = this.chkExceptAttr2.Checked == true ? "1" : "0";
            string chkExceptAttrFlg3 = this.chkExceptAttr3.Checked == true ? "1" : "0";

            if (gFlag == false)
            {
                if ((fileTypeSetLists.id == "" || fileTypeSetLists.id == null) &&
                    ((this.chkExceptAttr1.Checked == true || this.txtExceptAttr1.Text.Trim() != "") ||
                     (this.chkExceptAttr2.Checked == true || this.txtExceptAttr2.Text.Trim() != "") ||
                     (this.chkExceptAttr3.Checked == true || this.txtExceptAttr3.Text.Trim() != "") ||
                     this.chkSystemFileFlg.Checked == true || this.chkHiddenFileFlg.Checked == true))
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                    {
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
                else if ((fileTypeSetLists.id != "" && fileTypeSetLists.id != null) && (fileTypeSetLists.exceptAttribute1 != this.txtExceptAttr1.Text.Trim() ||
                                                                                        fileTypeSetLists.exceptAttributeFlg1 != chkExceptAttrFlg1 ||
                                                                                        fileTypeSetLists.exceptAttribute2 != this.txtExceptAttr2.Text.Trim() ||
                                                                                        fileTypeSetLists.exceptAttributeFlg2 != chkExceptAttrFlg2 ||
                                                                                        fileTypeSetLists.exceptAttribute3 != this.txtExceptAttr3.Text.Trim() ||
                                                                                        fileTypeSetLists.exceptAttributeFlg3 != chkExceptAttrFlg3 ||
                                                                                        fileTypeSetLists.systemFileFlg != sysChk || fileTypeSetLists.hiddenFileFlg != hidChk))
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                    {
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
            }
        }
コード例 #4
0
ファイル: FrmGroupDetail.cs プロジェクト: hst-bridge/BBS
        private void FrmGroupDetail_FormClosing(object sender, FormClosingEventArgs e)
        {
            string selectGroupId = this.cobBKServerGroup.SelectedValue.ToString();
            IBackupServerGroupDetailService backGroupDetail = BLLFactory.ServiceAccess.CreateBackupServerGroupDetailService();
            IList <BackupServerGroupDetail> bsgdLists       = backGroupDetail.GetBackupServerGroupDetailByGroupId(selectGroupId);
            List <string> list1 = new List <string>();
            List <string> list2 = new List <string>();

            foreach (BackupServerGroupDetail bsgd in bsgdLists)
            {
                list1.Add(bsgd.backupServerId.ToString());
            }
            for (int i = 0; i < this.dgrdMonitorServer.Rows.Count; i++)
            {
                list2.Add(this.dgrdMonitorServer.Rows[i].Cells[0].Value.ToString());
            }
            if (list1.Count != list2.Count)
            {
                //if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                //{
                //    e.Cancel = false;
                //}
                //else
                //{
                //    e.Cancel = true;
                //}
            }
            else
            {
                bool flag = false;
                foreach (string i in list1)
                {
                    if (!list2.Contains(i))
                    {
                        flag = true;
                        break;
                    }
                }
                if (flag)
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                    {
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
            }
        }
コード例 #5
0
ファイル: FrmObject.cs プロジェクト: hst-bridge/BBS
        private void FrmObject_FormClosing(object sender, FormClosingEventArgs e)
        {
            int flg = 1;

            if (gFlag == false)
            {
                if ((id == null || id == "") && (this.txtMonitorName.Text.Trim() != "" ||
                                                 this.txtMonitorIp.Text.Trim() != "" ||
                                                 this.txtMonitorMemo.Text.Trim() != "" ||
                                                 this.txtMonitorAccount.Text.Trim() != "" ||
                                                 this.txtMonitorPass.Text.Trim() != "" ||
                                                 this.txtMonitorStfile.Text.Trim() != "" ||
                                                 this.txtLocalPath.Text.Trim() != ""))
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                    {
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
                else if ((id != null && id != "") &&
                         (monitorServer.monitorServerName != this.txtMonitorName.Text.Trim() ||
                          monitorServer.monitorServerIP != this.txtMonitorIp.Text.Trim() ||
                          monitorServer.monitorSystem != flg ||
                          monitorServer.memo != this.txtMonitorMemo.Text.Trim() ||
                          monitorServer.account != this.txtMonitorAccount.Text.Trim() ||
                          monitorServer.password != this.txtMonitorPass.Text.Trim() ||
                          monitorServer.startFile != this.txtMonitorStfile.Text.Trim() ||
                          monitorServer.monitorLocalPath != this.txtLocalPath.Text.Trim()))
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                    {
                        e.Cancel = false;
                    }
                    else
                    {
                        e.Cancel = true;
                    }
                }
            }
        }
コード例 #6
0
ファイル: FrmObject.cs プロジェクト: hst-bridge/BBS
        private void btnCancel_Click(object sender, EventArgs e)
        {
            int flg = 1;

            //shutdown the current page
            if ((id == null || id == "") && (this.txtMonitorName.Text.Trim() != "" ||
                                             this.txtMonitorIp.Text.Trim() != "" ||
                                             this.txtMonitorMemo.Text.Trim() != "" ||
                                             this.txtMonitorAccount.Text.Trim() != "" ||
                                             this.txtMonitorPass.Text.Trim() != "" ||
                                             this.txtMonitorStfile.Text.Trim() != "" ||
                                             this.txtLocalPath.Text.Trim() != ""))
            {
                if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                {
                    gFlag = true;
                }
            }
            else if ((id != null && id != "") &&
                     (monitorServer.monitorServerName != this.txtMonitorName.Text.Trim() ||
                      monitorServer.monitorServerIP != this.txtMonitorIp.Text.Trim() ||
                      monitorServer.monitorSystem != flg ||
                      monitorServer.memo != this.txtMonitorMemo.Text.Trim() ||
                      monitorServer.account != this.txtMonitorAccount.Text.Trim() ||
                      monitorServer.password != this.txtMonitorPass.Text.Trim() ||
                      monitorServer.startFile != this.txtMonitorStfile.Text.Trim() ||
                      monitorServer.monitorLocalPath != this.txtLocalPath.Text.Trim()))
            {
                if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
                {
                    gFlag = true;
                }
            }
            else
            {
                gFlag = true;
            }
            if (gFlag)
            {
                this.Dispose();
            }
        }
コード例 #7
0
 private void FrmTransfer_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (gFlag == false)
     {
         if ((id == null || id == "") && (this.txtTrName.Text.Trim() != "" ||
                                          this.txtTrIp.Text.Trim() != "" ||
                                          this.txtTrMemo.Text.Trim() != "" ||
                                          this.txtTraccount.Text.Trim() != "" ||
                                          this.txtTrPass.Text.Trim() != "" ||
                                          this.txtTrStfile.Text.Trim() != ""))
         {
             if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
             {
                 e.Cancel = false;
             }
             else
             {
                 e.Cancel = true;
             }
         }
         else if ((id != null && id != "") &&
                  (backupServer.backupServerName != this.txtTrName.Text.Trim() ||
                   backupServer.backupServerIP != this.txtTrIp.Text.Trim() ||
                   backupServer.memo != this.txtTrMemo.Text.Trim() ||
                   backupServer.account != this.txtTraccount.Text.Trim() ||
                   backupServer.password != this.txtTrPass.Text.Trim() ||
                   backupServer.startFile != this.txtTrStfile.Text.Trim()))
         {
             if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
             {
                 e.Cancel = false;
             }
             else
             {
                 e.Cancel = true;
             }
         }
     }
 }
コード例 #8
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     //shutdown the current page
     if ((id == null || id == "") && (this.txtTrName.Text.Trim() != "" ||
                                      this.txtTrIp.Text.Trim() != "" ||
                                      this.txtTrMemo.Text.Trim() != "" ||
                                      this.txtTraccount.Text.Trim() != "" ||
                                      this.txtTrPass.Text.Trim() != "" ||
                                      this.txtTrStfile.Text.Trim() != ""))
     {
         if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
         {
             gFlag = true;
         }
     }
     else if ((id != null && id != "") &&
              (backupServer.backupServerName != this.txtTrName.Text.Trim() ||
               backupServer.backupServerIP != this.txtTrIp.Text.Trim() ||
               backupServer.memo != this.txtTrMemo.Text.Trim() ||
               backupServer.account != this.txtTraccount.Text.Trim() ||
               backupServer.password != this.txtTrPass.Text.Trim() ||
               backupServer.startFile != this.txtTrStfile.Text.Trim()))
     {
         if (MsgHelper.QuestionMsg(ValidationRegex.Q003, ValidationRegex.publicTitle))
         {
             gFlag = true;
         }
     }
     else
     {
         gFlag = true;
     }
     if (gFlag)
     {
         this.Dispose();
     }
 }
コード例 #9
0
ファイル: FrmGroupDetail.cs プロジェクト: hst-bridge/BBS
        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);
                        }
                    }
                }
            }
        }
コード例 #10
0
        private bool messageCheck()
        {
            bool   flag           = false;
            string nameMessage    = ValidationRegex.ValidteEmpty(this.lblTrName.Text, this.txtTrName.Text);
            string ipMessage      = ValidationRegex.ValidteEmpty(this.lblTrIp.Text, this.txtTrIp.Text);
            string accountMessage = ValidationRegex.ValidteEmpty(this.lblTrAccount.Text, this.txtTraccount.Text);
            string passMessage    = ValidationRegex.ValidteEmpty(this.lblTrPass.Text, this.txtTrPass.Text);
            string stfileMessage  = ValidationRegex.ValidteEmpty(this.lblTrStfile.Text, this.txtTrStfile.Text);
            Regex  patt           = new Regex("([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}");

            int bkId = 0;

            if (!String.IsNullOrWhiteSpace(this.id))
            {
                bkId = Convert.ToInt32(this.id);
            }
            //check Backup Server Name
            IList <BackupServer> existLists = null;

            if (!String.IsNullOrWhiteSpace(this.txtTrName.Text))
            {
                existLists = backupService.GetBackupServerListByNameButId(bkId, this.txtTrName.Text.Trim());
            }

            if (nameMessage != "")
            {
                MsgHelper.WarningMsg(nameMessage, ValidationRegex.publicTitle);
                flag = true;
            }
            else if (existLists != null && existLists.Count > 0)
            {
                string msg = ValidationRegex.W008;
                msg = msg.Replace("{1}", this.lblTrName.Text);
                MsgHelper.WarningMsg(msg, ValidationRegex.publicTitle);
                flag = true;
            }
            else if (ipMessage != "")
            {
                MsgHelper.WarningMsg(ipMessage, ValidationRegex.publicTitle);
                flag = true;
            }
            else if (!patt.IsMatch(this.txtTrIp.Text.Trim()))
            {
                string msg = ValidationRegex.W003.Replace("{1}", this.lblTrIp.Text);
                MsgHelper.WarningMsg(msg, ValidationRegex.publicTitle);
                flag = true;
            }
            else if (accountMessage != "")
            {
                MsgHelper.WarningMsg(accountMessage, ValidationRegex.publicTitle);
                flag = true;
            }
            else if (passMessage != "")
            {
                MsgHelper.WarningMsg(passMessage, ValidationRegex.publicTitle);
                flag = true;
            }
            else if (stfileMessage != "")
            {
                MsgHelper.WarningMsg(stfileMessage, ValidationRegex.publicTitle);
                flag = true;
            }
            else
            {
                //IP and startfolder unique checking
                IList <BackupServer> bkList = backupService.GetBackupServerListButId(bkId, this.txtTrIp.Text, this.txtTrStfile.Text);
                if (bkList.Count > 0)
                {
                    MsgHelper.WarningMsg(ValidationRegex.W009, ValidationRegex.publicTitle);
                    flag = true;
                }
                else
                {
                    //check whether the ip and startfolder is deleted.
                    IList <BackupServer> deletedbkList = backupService.GetDeletedBackupServerList(this.txtTrIp.Text, this.txtTrStfile.Text);
                    if (deletedbkList.Count > 0)
                    {
                        flag = !MsgHelper.QuestionMsg(ValidationRegex.W010, ValidationRegex.publicTitle);
                    }
                }
            }
            return(flag);
        }
コード例 #11
0
ファイル: FrmGroupTransfer.cs プロジェクト: hst-bridge/BBS
        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();
                    }
                }
            }
        }
コード例 #12
0
ファイル: FrmObject.cs プロジェクト: hst-bridge/BBS
        /// <summary>
        /// save or update button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool mesFlg = messageCheck();

            if (mesFlg)
            {
                return;
            }
            else
            {
                string id = this.txtId.Text;
                //save operation
                //MonitorServer monitorServer = new MonitorServer();
                innerMonitorServer.monitorServerName = this.txtMonitorName.Text.Trim();
                innerMonitorServer.monitorServerIP   = this.txtMonitorIp.Text.Trim();
                innerMonitorServer.monitorSystem     = 1;
                innerMonitorServer.memo             = this.txtMonitorMemo.Text.Trim();
                innerMonitorServer.account          = this.txtMonitorAccount.Text.Trim();
                innerMonitorServer.password         = this.txtMonitorPass.Text.Trim();
                innerMonitorServer.startFile        = this.txtMonitorStfile.Text.Trim().TrimEnd('\\');
                innerMonitorServer.monitorDrive     = "\\\\" + this.txtMonitorIp.Text.Trim() + "\\" + this.txtMonitorStfile.Text.Trim().TrimEnd('\\');
                innerMonitorServer.monitorDriveP    = "";
                innerMonitorServer.monitorLocalPath = this.txtLocalPath.Text.Trim();
                innerMonitorServer.monitorMacPath   = this.txtMacPath.Text.Trim();
                // Top Directory コピーするかどうか
                if (checkBoxTopDirFile.Checked)
                {
                    innerMonitorServer.copyInit = 1;
                }
                else
                {
                    innerMonitorServer.copyInit = 0;
                }
                innerMonitorServer.deleteFlg = 0;
                if (id == "")
                {
                    innerMonitorServer.creater    = FrmMain.userinfo.loginID;
                    innerMonitorServer.createDate = CommonUtil.DateTimeNowToString();
                }
                else
                {
                    innerMonitorServer.creater    = monitorServer.creater;
                    innerMonitorServer.createDate = monitorServer.createDate;
                }
                innerMonitorServer.updater    = FrmMain.userinfo.loginID;
                innerMonitorServer.updateDate = CommonUtil.DateTimeNowToString();

                //IMonitorServerService monitorService = BLLFactory.ServiceAccess.CreateMonitorServerService();
                //IMonitorServerFolderService imsfs = BLLFactory.ServiceAccess.CreateMonitorServerFolderService();
                //int flag = -1;
                if (id == "")
                {
                    IList <MonitorServer> existLists = monitorService.GetMonitorServerListByName(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
                {
                    innerMonitorServer.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();
                    }
                }
            }
        }
コード例 #13
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            IFileTypeSetService IFileTypeSetService = BLLFactory.ServiceAccess.CreateFileTypeSetService();
            FileTypeSet         fileTypeSet         = new FileTypeSet();

            if (msFolderName != "")
            {
                fileTypeSet.monitorServerFolderName = msFolderName;
            }
            fileTypeSet.monitorServerID     = Convert.ToInt32(mServerID);
            fileTypeSet.exceptAttribute1    = "";
            fileTypeSet.exceptAttribute2    = "";
            fileTypeSet.exceptAttribute3    = "";
            fileTypeSet.exceptAttributeFlg1 = "0";
            fileTypeSet.exceptAttributeFlg2 = "0";
            fileTypeSet.exceptAttributeFlg3 = "0";
            fileTypeSet.systemFileFlg       = "0";
            fileTypeSet.hiddenFileFlg       = "0";
            if (this.chkExceptAttr1.Checked == true && this.txtExceptAttr1.Text.Trim() != "")
            {
                fileTypeSet.exceptAttributeFlg1 = "1";
            }
            if (this.txtExceptAttr1.Text.Trim() != "")
            {
                fileTypeSet.exceptAttribute1 = this.txtExceptAttr1.Text.Trim();
            }
            if (this.chkExceptAttr2.Checked == true && this.txtExceptAttr2.Text.Trim() != "")
            {
                fileTypeSet.exceptAttributeFlg2 = "1";
            }
            if (this.txtExceptAttr2.Text.Trim() != "")
            {
                fileTypeSet.exceptAttribute2 = this.txtExceptAttr2.Text.Trim();
            }
            if (this.chkExceptAttr3.Checked == true && this.txtExceptAttr3.Text.Trim() != "")
            {
                fileTypeSet.exceptAttributeFlg3 = "1";
            }
            if (this.txtExceptAttr3.Text.Trim() != "")
            {
                fileTypeSet.exceptAttribute3 = this.txtExceptAttr3.Text.Trim();
            }
            //if (this.chkSystemFileFlg.Checked == true)
            //{
            //    fileTypeSet.systemFileFlg = "1";
            //}
            //if (this.chkHiddenFileFlg.Checked == true)
            //{
            //    fileTypeSet.hiddenFileFlg = "1";
            //}
            fileTypeSet.deleteFlg  = 0;
            fileTypeSet.creater    = FrmMain.userinfo.loginID;
            fileTypeSet.createDate = CommonUtil.DateTimeNowToString();
            fileTypeSet.updater    = FrmMain.userinfo.loginID;
            fileTypeSet.updateDate = CommonUtil.DateTimeNowToString();

            FileTypeSet fts = IFileTypeSetService.GetFileTypeSetByMonitorServerIdAndFolderName(mServerID, msFolderName);

            if (fts.id != "" && fts.id != null)
            {
                fileTypeSet.id = fts.id;
                int updateFlg = -1;
                if (MsgHelper.QuestionMsg(ValidationRegex.Q002, ValidationRegex.publicTitle))
                {
                    try
                    {
                        updateFlg = IFileTypeSetService.UpdateFileTypeSet(fileTypeSet);
                    }
                    catch (Exception ex)
                    {
                        logger.Error(ex.Message);
                    }
                }
                if (updateFlg > -1)
                {
                    MsgHelper.InfoMsg(ValidationRegex.U001, ValidationRegex.publicTitle);
                    gFlag = true;
                    this.Dispose();
                }
                else
                {
                    MsgHelper.InfoMsg(ValidationRegex.U002, ValidationRegex.publicTitle);
                }
            }
            else
            {
                int insertFlg = -1;
                if (this.txtExceptAttr1.Text.Trim() != "" ||
                    this.txtExceptAttr2.Text.Trim() != "" ||
                    this.txtExceptAttr3.Text.Trim() != "" ||
                    this.chkHiddenFileFlg.Checked == true ||
                    this.chkSystemFileFlg.Checked == true)
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q002, ValidationRegex.publicTitle))
                    {
                        try
                        {
                            insertFlg = IFileTypeSetService.InsertFileTypeSet(fileTypeSet);
                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.Message);
                        }
                    }
                }
                if (this.txtExceptAttr1.Text.Trim() == "" &&
                    this.txtExceptAttr2.Text.Trim() == "" &&
                    this.txtExceptAttr3.Text.Trim() == "" ||
                    this.chkHiddenFileFlg.Checked == true ||
                    this.chkSystemFileFlg.Checked == true)
                {
                    insertFlg = 0;
                }
                if (insertFlg > -1)
                {
                    MsgHelper.InfoMsg(ValidationRegex.I001, ValidationRegex.publicTitle);
                    gFlag = true;
                    this.Dispose();
                }
                else
                {
                    MsgHelper.InfoMsg(ValidationRegex.I002, ValidationRegex.publicTitle);
                }
            }
            this.DialogResult = DialogResult.OK;
        }
コード例 #14
0
ファイル: FrmAuth.cs プロジェクト: hst-bridge/BBS
        private void btnAuthSave_Click(object sender, EventArgs e)
        {
            string loginIDMessage = ValidationRegex.ValidteEmpty(this.lblAuEditLoginId.Text, this.txtAuEditLoginId.Text);
            string passMessage    = ValidationRegex.ValidteEmpty(this.lblAuEditLoginPass.Text, this.txtAuEditLoginPass.Text);
            string nameMessage    = ValidationRegex.ValidteEmpty(this.lblAuEditName.Text, this.txtAuEditName.Text);
            string mailMessage    = ValidationRegex.ValidteEmpty(this.lblAuEditMail.Text, this.txtAuEditMail.Text);

            if (loginIDMessage != "")
            {
                MsgHelper.WarningMsg(loginIDMessage, ValidationRegex.publicTitle);
                return;
            }
            else if (passMessage != "")
            {
                MsgHelper.WarningMsg(passMessage, ValidationRegex.publicTitle);
                return;
            }
            else if (nameMessage != "")
            {
                MsgHelper.WarningMsg(nameMessage, ValidationRegex.publicTitle);
                return;
            }
            else if (mailMessage != "")
            {
                MsgHelper.WarningMsg(mailMessage, ValidationRegex.publicTitle);
                return;
            }
            else
            {
                string id = this.txtAuthEditId.Text;
                //save operation
                UserInfo userInfo = new UserInfo();

                userInfo.loginID  = this.txtAuEditLoginId.Text;
                userInfo.password = this.txtAuEditLoginPass.Text;
                userInfo.name     = this.txtAuEditName.Text;
                userInfo.mail     = this.txtAuEditMail.Text;
                if (this.rbAuthMailYes.Checked == true)
                {
                    userInfo.mailFlg = 1;
                }
                else
                {
                    userInfo.mailFlg = 0;
                }
                if (this.rbAuthFlgYes.Checked == true)
                {
                    userInfo.authorityFlg = 1;
                }
                else
                {
                    userInfo.authorityFlg = 0;
                }
                userInfo.deleteFlg  = 0;
                userInfo.creater    = FrmMain.userinfo.loginID;
                userInfo.createDate = CommonUtil.DateTimeNowToString();
                userInfo.updater    = FrmMain.userinfo.loginID;
                userInfo.updateDate = CommonUtil.DateTimeNowToString();

                IUserInfoService userInfoService = BLLFactory.ServiceAccess.CreateUserInfoService();

                int flag = -1;
                if (id == "")
                {
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q001, ValidationRegex.publicTitle))
                    {
                        flag = userInfoService.InsertUserInfo(userInfo);
                    }
                    if (flag > -1)
                    {
                        MsgHelper.InfoMsg(ValidationRegex.I001, ValidationRegex.publicTitle);
                        this.Dispose();
                    }
                    else
                    {
                        MsgHelper.InfoMsg(ValidationRegex.I002, ValidationRegex.publicTitle);
                    }
                }
                else
                {
                    userInfo.id = id;
                    if (MsgHelper.QuestionMsg(ValidationRegex.Q002, ValidationRegex.publicTitle))
                    {
                        flag = userInfoService.UpdateUserInfo(userInfo);
                    }
                    if (flag > -1)
                    {
                        MsgHelper.InfoMsg(ValidationRegex.U001, ValidationRegex.publicTitle);
                        this.Dispose();
                    }
                    else
                    {
                        MsgHelper.InfoMsg(ValidationRegex.U002, ValidationRegex.publicTitle);
                    }
                }
            }
        }