Exemple #1
0
        bool arule_OptRule(string type, string[] data)
        {
            IsysService service = sysService.GetService();
            var         rs      = string.Empty;

            switch (type)
            {
            case "ADD":
                data[0] = Guid.NewGuid().ToString();
                rs      = service.AddRule(data[0], data[1], data[2], data[3], data[4].ToLower() == "all" ? "*" : data[4]);
                break;

            case "EDIT":
                rs = service.EditRule(data[0], data[1], data[2], data[3], data[4].ToLower() == "all" ? "*" : data[4]);
                break;

            case "DEL":
                rs = service.DelRule(data[0]);
                break;

            default:
                break;
            }

            if (rs == "-1")
            {
                MsgBoxEx.Info("Name already exist");
                return(false);
            }

            frm_config_Load(null, null);

            return(true);
        }