示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.IsAdmin = UserManagement.UserIsInRole("Admin");
        this.CanEdit = UserManagement.UserCanEdit(WTSModuleOption.MasterData);
        this.CanView = (CanEdit || UserManagement.UserCanView(WTSModuleOption.MasterData));

        ReadQueryString();
        initControls();

        //Gather RQMTAttribute data for dropdown(s)
        if (Session["RQMTAttribute_Get"] == null)
        {
            dtRQMTAttribute = RQMT.RQMTAttribute_Get();
            Session["RQMTAttribute_Get"] = dtRQMTAttribute;
        }
        else
        {
            dtRQMTAttribute = (DataTable)Session["RQMTAttribute_Get"];
        }

        DataTable dt = new DataTable();

        dt = LoadData();

        matchAORSRWebSystems = SR.GetAORWebSystemsForWTSSystem(SYSTEM_ID);
        if (matchAORSRWebSystems.ToLower().IndexOf("wts") != -1)
        {
            matchAORSRWebSystems += ",wts"; // the aorsr forms of wts do not match the internal form, so we ensure that we get WTS results out of R&D WTS and other forms whenever a wts variant is present
        }

        grdData.DataSource = dt;
        grdData.DataBind();
    }
    public static string SaveChanges(string changes)
    {
        Dictionary <string, string> result = new Dictionary <string, string>()
        {
            { "saved", "" }, { "error", "" }
        };
        bool   saved    = false;
        string errorMsg = string.Empty;

        try
        {
            XmlDocument docChanges = (XmlDocument)JsonConvert.DeserializeXmlNode(changes, "changes");

            saved = RQMT.RQMT_Update(Changes: docChanges); //todo: check for uniqueness
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);

            saved    = false;
            errorMsg = ex.Message;
        }

        result["saved"] = saved.ToString();
        result["error"] = errorMsg;

        return(JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.None));
    }
示例#3
0
    public static string DeleteRQMTFromSet(int RQMTSetID, string checkedRQMTIDs, bool globalDelete)
    {
        var result = WTSPage.CreateDefaultResult();

        string[] ids = checkedRQMTIDs.Split('|');

        for (int i = ids.Length - 1; i >= 0; i--) // we go backwards so we can re-order as we go and not delete parents before children
        {
            int id = Int32.Parse(ids[i]);

            if (globalDelete)
            {
                DataTable dt = RQMT.RQMT_AssociatedSets_Get(id);

                foreach (DataRow row in dt.Rows)
                {
                    RQMT.RQMTSet_DeleteRQMT((int)row["RQMTSetID"], id, 0, true);
                }
            }
            else
            {
                RQMT.RQMTSet_DeleteRQMT(RQMTSetID, id, 0, true);
            }
        }

        result["success"] = "true";

        return(WTSPage.SerializeResult(result));
    }
    private void Page_Load(object sender, EventArgs e)
    {
        ReadQueryString();
        InitializeEvents();

        this.CanEditRQMTDescription = UserManagement.UserCanEdit(WTSModuleOption.RQMT);
        this.CanViewRQMTDescription = this.CanEditRQMTDescription || UserManagement.UserCanView(WTSModuleOption.RQMT);

        this.dtRQMTDescriptionType = RQMT.RQMTDescriptionTypeList_Get();

        DataTable dt = LoadData();

        if (dt != null)
        {
            this.DCC        = dt.Columns;
            this.TotalCount = dt.Rows.Count;
        }

        grdData.DataSource = dt;

        if (!Page.IsPostBack && this.GridPageIndex > 0 && this.GridPageIndex < ((decimal)dt.Rows.Count / (decimal)25))
        {
            grdData.PageIndex = this.GridPageIndex;
        }

        grdData.DataBind();
    }
    public static string DeleteRQMTDescription(string rqmtDescription)
    {
        Dictionary <string, string> result = new Dictionary <string, string>()
        {
            { "deleted", "" }, { "error", "" }
        };
        bool   deleted  = false;
        string errorMsg = string.Empty;

        try
        {
            int RQMTDescription_ID = 0;
            int.TryParse(rqmtDescription, out RQMTDescription_ID);

            deleted = RQMT.RQMTDescription_Delete(RQMTDescriptionID: RQMTDescription_ID);
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);

            deleted  = false;
            errorMsg = ex.Message;
        }

        result["deleted"] = deleted.ToString();
        result["error"]   = errorMsg;

        return(JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.None));
    }
示例#6
0
    public static string SaveRQMTDescription(int RQMTSet_RQMTSystemID, int RQMTSystemRQMTDescriptionID, string RQMTDescription, int RQMTDescriptionTypeID, bool editMode)
    {
        var result = WTSPage.CreateDefaultResult();

        try
        {
            int RQMTDescriptionID = RQMT.RQMTSystem_SaveDescription(0, RQMTSet_RQMTSystemID, RQMTSystemRQMTDescriptionID, RQMTDescription, RQMTDescriptionTypeID, editMode, "all");

            result["success"]           = "true";
            result["rqmtdescriptionid"] = RQMTDescriptionID.ToString();
        }
        catch (Exception e)
        {
            if (e.Message.IndexOf("UNIQUE KEY") != -1)
            {
                result["error"] = "This description/type combination already exists in this RQMT.";
            }
            else
            {
                result["error"] = e.Message;
            }
        }

        return(WTSPage.SerializeResult(result));
    }
示例#7
0
    public static string DeleteItem(string strRQMTSystemDefectID)
    {
        Dictionary <string, string> result = new Dictionary <string, string>()
        {
            { "saved", "" }, { "ids", "" }, { "error", "" }
        };
        bool   exists = false, deleted = false;
        string ids = string.Empty, errorMsg = string.Empty, tempMsg = string.Empty;

        try
        {
            int rqmtSystemDefectID = 0;
            int.TryParse(strRQMTSystemDefectID, out rqmtSystemDefectID);

            deleted = RQMT.RQMTDefectsImpact_Delete(intRQMTSystemDefectID: rqmtSystemDefectID);
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);
            deleted  = false;
            errorMsg = ex.Message;
        }

        result["deleted"] = deleted.ToString();
        result["error"]   = errorMsg;

        return(JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.None));
    }
示例#8
0
    public static string DeleteTaskFromDefect(int rsdtaskid)
    {
        var result = WTS.WTSPage.CreateDefaultResult();

        if (RQMT.RQMTDefectsImpactTask_Delete(rsdtaskid))
        {
            result["success"] = "true";
        }

        return(WTS.WTSPage.SerializeResult(result));
    }
示例#9
0
    public static string TaskAddedToDefect(int rsdid, int WORKITEM_TASKID)
    {
        var result = WTS.WTSPage.CreateDefaultResult();

        if (RQMT.RQMTDefectsImpactTask_Add(rsdid, WORKITEM_TASKID))
        {
            result["success"] = "true";
        }

        return(WTS.WTSPage.SerializeResult(result));
    }
示例#10
0
    public static string SRDelete(int rsdsrid)
    {
        var result = WTS.WTSPage.CreateDefaultResult();

        if (RQMT.RQMTDefectsImpactSR_Delete(rsdsrid))
        {
            result["success"] = "true";
        }

        return(WTS.WTSPage.SerializeResult(result));
    }
示例#11
0
    public static string SRSelected(int rsdid, int srid, int srext)
    {
        var result = WTS.WTSPage.CreateDefaultResult();

        if (RQMT.RQMTDefectsImpactSR_Add(rsdid, srext == 0 ? srid : 0, srext == 1 ? srid : 0))
        {
            result["success"] = "true";
        }

        return(WTS.WTSPage.SerializeResult(result));
    }
示例#12
0
    public static string DeleteDescriptionAttachment(int AttachmentID)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTDescriptionAttachment_Delete(0, 0, AttachmentID))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#13
0
    public static string DeleteRQMTBase(int RQMTID)
    {
        var result = WTSPage.CreateDefaultResult();

        var deleteResult = RQMT.RQMT_Delete(RQMTID, false);

        result["success"]         = deleteResult["deleted"];
        result["hasdependencies"] = deleteResult["hasdependencies"];

        return(WTSPage.SerializeResult(result));
    }
示例#14
0
    public static string DeleteRQMTDescription(int RQMTSystemRQMTDescriptionID)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSystem_DeleteDescription(RQMTSystemRQMTDescriptionID))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#15
0
    public static string DeleteRQMTFunctionality(int RQMTSetID, int RQMTSet_RQMTSystemID, int RQMTSetFunctionalityID)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTFunctionality_Delete(RQMTSetID, RQMTSet_RQMTSystemID, RQMTSetFunctionalityID))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#16
0
    public static string SaveRQMTAttributes(int RQMTSet_RQMTSystemID, int RQMTStageID, int CriticalityID, int RQMTStatusID, bool RQMTAccepted)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSystemAttributes_Save(RQMTSet_RQMTSystemID, RQMTStageID, CriticalityID, RQMTStatusID, RQMTAccepted))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#17
0
    public static string TaskAddedToRQMTSet(int RQMTSetID, int WORKITEM_TASKID)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSet_Task_Add(RQMTSetID, WORKITEM_TASKID))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#18
0
    public static string SaveRQMTBase(int RQMTID, string txt)
    {
        var result = WTSPage.CreateDefaultResult();

        var saveResult = RQMT.RQMT_Save(false, RQMTID, txt);

        result["success"] = saveResult["saved"].ToLower();
        result["exists"]  = saveResult["exists"].ToLower();

        return(WTSPage.SerializeResult(result));
    }
示例#19
0
    public static string SaveRQMTSetOrdering(string order)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSet_ReorderRQMTs(0, order))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#20
0
    public static string DeleteRQMTSet(int RQMTSetID)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSet_Delete(RQMTSetID))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#21
0
    public static string UpdateRQMTSetRQMTSystemUsage(int RQMTSet_RQMTSystemID, int month, bool selected)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSet_RQMTSystem_Usage_Update(RQMTSet_RQMTSystemID, month, selected))
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#22
0
    public static string SaveRQMTFunctionality(int RQMTSetID, int RQMTSet_RQMTSystemID, string RQMTFunctionalities, int RQMTSetFunctionalityID, int FunctionalityID, int ComplexityID, string Justification)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTFunctionality_Save(RQMTSetID, RQMTSet_RQMTSystemID, RQMTFunctionalities, RQMTSetFunctionalityID, FunctionalityID, ComplexityID, Justification))
        {
            result["success"]   = "true";
            result["RQMTSetID"] = RQMTSetID.ToString();
        }

        return(WTSPage.SerializeResult(result));
    }
示例#23
0
    public static string SaveRQMTChanges(string changes)
    {
        var result = WTSPage.CreateDefaultResult();

        try
        {
            JObject jobj = (JObject)JsonConvert.DeserializeObject(changes);

            int    RQMTID         = 0;
            string addToSets      = "";
            string deleteFromSets = "";
            string RQMTText       = "";

            foreach (KeyValuePair <string, JToken> token in (JObject)jobj)
            {
                string value = token.Value.ToString();

                if (token.Key == "RQMTID")
                {
                    RQMTID = Int32.Parse(value);
                }
                else if (token.Key == "adds")
                {
                    addToSets = value;
                }
                else if (token.Key == "deletes")
                {
                    deleteFromSets = value;
                }
                else if (token.Key == "RQMT")
                {
                    RQMTText = value;
                }
            }

            int returnID = RQMT.RQMTBuilder_RQMTUpdate(RQMTID, RQMTText, addToSets, deleteFromSets);

            if (returnID != RQMTID)
            {
                result["error"] = "Change cannot be saved. Another RQMT already exists with the same text (RQMT #" + returnID + ").";
            }
            else
            {
                result["success"] = "true";
            }
        }
        catch (Exception e)
        {
            result["error"] = e.Message;
        }

        return(WTSPage.SerializeResult(result));
    }
示例#24
0
    private void LoadData()
    {
        if (!this.NewRQMT)
        {
            DataTable dt = RQMT.RQMTList_Get(RQMTID: RQMTID);

            if (dt != null && dt.Rows.Count > 0)
            {
                lblRQMT.Text = dt.Rows[0]["RQMT"].ToString();
            }
        }
    }
示例#25
0
    public static string SearchDescriptions(string txt)
    {
        DataTable dt;

        if (string.IsNullOrWhiteSpace(txt))
        {
            txt = "__NONE__"; // we don't allow blank searches for descriptions
        }

        dt = RQMT.RQMTBuilderDescriptionList_Get(0, txt, false);

        return(WTSPage.SerializeResult(dt));
    }
示例#26
0
    public static string SaveChanges(string changes, string strRQMT_ID, string strSYSTEM_ID)
    {
        Dictionary <string, string> result = new Dictionary <string, string>()
        {
            { "saved", "" }, { "ids", "" }, { "error", "" }
        };
        bool   exists = false, saved = false;
        string ids = string.Empty, errorMsg = string.Empty, tempMsg = string.Empty;

        try
        {
            int intRQMT_ID   = 0;
            int intSYSTEM_ID = 0;

            int.TryParse(strRQMT_ID, out intRQMT_ID);
            int.TryParse(strSYSTEM_ID, out intSYSTEM_ID);

            DataTable dtjson = (DataTable)JsonConvert.DeserializeObject(changes, (typeof(DataTable)));
            foreach (DataRow dr in dtjson.Rows)
            {
                int drRQMTSystemDefectID = 0;
                int drVerified           = 0;
                int drResolved           = 0;
                int drContinueToReview   = 0;
                int drImpactID           = 0;
                int drRQMTStageID        = 0;

                int.TryParse(dr["RQMTSystemDefectID"].ToString(), out drRQMTSystemDefectID);
                int.TryParse(dr["Verified"].ToString(), out drVerified);
                int.TryParse(dr["Resolved"].ToString(), out drResolved);
                int.TryParse(dr["ContinueToReview"].ToString(), out drContinueToReview);
                int.TryParse(dr["Impact"].ToString(), out drImpactID);
                int.TryParse(dr["RQMTStage"].ToString(), out drRQMTStageID);

                saved = RQMT.RQMTDefectsImpact_Save(intRQMTID: intRQMT_ID, intSYSTEMID: intSYSTEM_ID, intRQMTSystemDefectID: drRQMTSystemDefectID, strDescription: dr["Description"].ToString(), intVerified: drVerified, intResolved: drResolved, intContinueToReview: drContinueToReview, intImpactID: drImpactID, intRQMTStageID: drRQMTStageID, mitigation: dr["Mitigation"].ToString());
            }
            //saved = RQMT.RQMTDefectsImpact_Save(Changes: docChanges);
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);
            saved    = false;
            errorMsg = ex.Message;
        }

        result["saved"] = saved.ToString();
        result["error"] = errorMsg;

        return(JsonConvert.SerializeObject(result, Newtonsoft.Json.Formatting.None));
    }
示例#27
0
    private void LoadControls()
    {
        switch (this.Type)
        {
        case "Add":
            DataTable dtRQMTDescriptionType = RQMT.RQMTDescriptionTypeList_Get();

            ddlRQMTDescriptionType.DataSource     = dtRQMTDescriptionType;
            ddlRQMTDescriptionType.DataValueField = "RQMTDescriptionTypeID";
            ddlRQMTDescriptionType.DataTextField  = "RQMTDescriptionType";
            ddlRQMTDescriptionType.DataBind();
            break;
        }
    }
示例#28
0
    public static string RenameRQMTSetGroup(int RQMTSetNameID, string name)
    {
        var result = WTSPage.CreateDefaultResult();

        if (RQMT.RQMTSetName_Save(RQMTSetNameID, name))
        {
            result["success"] = "true";
        }
        else
        {
            result["error"] = "Name already exists and could not be changed.";
        }

        return(WTSPage.SerializeResult(result));
    }
示例#29
0
    public static string AddRQMTSet(string RQMTSetName, int WTS_SYSTEMID, int WorkAreaID, int RQMTTypeID)
    {
        var result = WTSPage.CreateDefaultResult();

        var RQMTSetID = RQMT.RQMTSet_Save(0, RQMTSetName, WTS_SYSTEMID, WorkAreaID, RQMTTypeID, 0, null);

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

        result["RQMTSetID"] = RQMTSetID.ToString();

        return(WTSPage.SerializeResult(result));
    }
示例#30
0
    public static string PasteRQMTs(int RQMTSetID, string options)
    {
        var result = WTSPage.CreateDefaultResult();

        string previousCopiedRQMTs = (string)HttpContext.Current.Session["copied.rqmts"]; // RQMTS, SYSIDS, RSRSIDS

        if (options == null)
        {
            options = "";
        }
        bool pasteAttributes   = options.IndexOf("attr") != -1;
        bool pasteDefects      = options.IndexOf("def") != -1;
        bool pasteDescriptions = options.IndexOf("desc") != -1;

        string pasteOptions = (pasteAttributes ? "attr," : "") + (pasteDefects ? "def," : "") + (pasteDescriptions ? "desc," : "");

        if (pasteOptions.Length > 0)
        {
            pasteOptions = pasteOptions.Substring(0, pasteOptions.Length - 1);
        }

        if (!string.IsNullOrWhiteSpace(previousCopiedRQMTs))
        {
            string[] arr         = previousCopiedRQMTs.Split(',');
            string[] prevRQMTIDs = arr[0].Split('|');
            string[] prevRQMTSet_RQMTSystemIDs = arr[2].Split('|');

            for (int i = 0; i < prevRQMTIDs.Length; i++)
            {
                int RQMTID = Int32.Parse(prevRQMTIDs[i]);
                int RQMTSet_RQMTSystemID = Int32.Parse(prevRQMTSet_RQMTSystemIDs[i]);

                RQMT.RQMTSet_AddRQMT(RQMTSetID, RQMTID, null, false, RQMTSet_RQMTSystemID, pasteOptions);
            }

            RQMT.RQMTSet_ReorderRQMTs(RQMTSetID, null); // this forces us to reclaim space from previously deleted rqmts

            result["success"] = "true";
        }
        else // we shouldn't get here; the UI should have disabled the paste button if there is nothing on the clipboard
        {
            result["success"] = "true";
        }

        return(WTSPage.SerializeResult(result));
    }