예제 #1
0
    public static string Save(int RQMTID, string RQMTName, string addToSets, string deleteFromSets, string attrChanges, string usageChanges, string funcChanges, string descChanges, int ParentRQMTID)
    {
        var result = WTSPage.CreateDefaultResult();

        RQMTName = RQMTName.Replace("|", "!");
        RQMTName = RQMTName.Replace("\r", "");
        RQMTName = RQMTName.Replace("\n", "");

        // new ID will be 0 if fail, RQMTID if updating, or a new RQMTID if new
        int savedID = RQMT.RQMTEditData_Save(RQMTID, RQMTName, addToSets, deleteFromSets, attrChanges, usageChanges, funcChanges, StringUtil.UndoStrongEscape(descChanges), RQMTID == 0 ? ParentRQMTID : 0);

        if (savedID > 0)
        {
            result["success"] = "true";

            if (RQMTID == 0)
            {
                result["newid"] = savedID.ToString();
            }
        }

        return(WTSPage.SerializeResult(result));
    }