Пример #1
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));
    }