コード例 #1
0
ファイル: EIQuery.cs プロジェクト: SDRC-India/sdrcdevinfo
        internal string Import_Save_Data(eQueryType QueryType, string sIndicatorName,
         string sUnitName, string sSGName, int iIndNid, int iUnitNid,
         int iSubNid, string sTimeid, string sTime, string sAreaid, string sArea,
         string sSourceid, string sSource, string sData, string sDenominator,
         string sFootnotes, string sIUSnid)
        {
            string RetVal = string.Empty;

            if (QueryType == eQueryType.Insert) //'-- In Case of Insert
            {
                RetVal = "Insert Into _Data(MIndName,MUnitName,MSubName,"+ Area.AreaName+","+ Timeperiods.TimePeriod +", "
                + "" + Timeperiods.TimePeriodNId + ",Source," + Data.SourceNId + "," + Indicator_Unit_Subgroup.IUSNId + "," + Data.DataValue + ", _Updated," + Indicator.IndicatorNId + "," + Unit.UnitNId + "," + SubgroupVals.SubgroupValNId + " ";

                if (sAreaid.Length != 0)
                {
                    RetVal = RetVal + "," + Area.AreaNId + "";
                }

                if (sDenominator.Length != 0)
                {
                    RetVal = RetVal + "," + Data.DataDenominator + "";
                }

                if (sFootnotes.Length != 0)
                {
                    RetVal = RetVal + "," + FootNotes.FootNoteNId + ")";
                }
                else
                {
                    RetVal = RetVal + ")";
                }

                // IUS NId will always be -1 at this stage
                RetVal = RetVal + " Values('" + sIndicatorName + "','" + sUnitName + "','" + sSGName + "','" + sArea + "','"
                   + sTime + "','" + sTimeid + "','" + sSource + "','" + sSourceid + "',";

                if (sIUSnid.Length == 0)
                {
                    RetVal = RetVal + " -1";
                }
                else
                {
                    RetVal = RetVal + sIUSnid;
                }

                RetVal = RetVal + ",'" + sData + "',0," + iIndNid + "," + iUnitNid + "," + iSubNid;

                if (sAreaid.Length != 0)
                {
                    RetVal = RetVal + ",'" + sAreaid + "'";
                }

                if (sDenominator.Length != 0)
                {
                    RetVal = RetVal + ",'" + sDenominator + "'";
                }

                if (sFootnotes.Length != 0)
                {
                    RetVal = RetVal + ",'" + sFootnotes + "')";
                }
                else
                {
                    RetVal = RetVal + ")";
                }

            }
            else if (QueryType == eQueryType.Update)       //-- In case of Update
            {
                RetVal = "Update _Data Set " + Indicator_Unit_Subgroup.IUSNId + " = " + sIUSnid;

                RetVal = RetVal + " Where MindName = '" + sIndicatorName + "'"
                       + " and MunitName = '" + sUnitName + "'"
                       + " and MSubName = '" + sSGName + "'";

            }

            return RetVal;
        }
コード例 #2
0
ファイル: Query.cs プロジェクト: dannyfnkz/CryptoBlock
            public static string QueryTypeToString(eQueryType queryType)
            {
                string queryTypeString = queryType.ToString().ToUpper();

                return(queryTypeString);
            }
コード例 #3
0
ファイル: EIQuery.cs プロジェクト: SDRC-India/sdrcdevinfo
 internal string Import_Save_Data(eQueryType QueryType, string sIndicatorName,
 string sUnitName, string sSGName, int iIndNid, int iUnitNid,
 int iSubNid)
 {
     return this.Import_Save_Data(QueryType, sIndicatorName, sUnitName, sSGName, iIndNid, iUnitNid, iSubNid,
         string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty
     , string.Empty, string.Empty);
 }
コード例 #4
0
ファイル: EIQuery.cs プロジェクト: SDRC-India/sdrcdevinfo
        internal string DB_InsertUpdate_Time(eQueryType QueryType, string sTime, string sTimeNid)
        {
            string RetVal = string.Empty;

            //insert new time into temp table
            if (QueryType == eQueryType.Insert)
            {
                RetVal = "INSERT INTO " + this.DBQueries.TablesName.TimePeriod + "(" + Timeperiods.TimePeriod + ")" + " Values('" + sTime + "')";
            }
            // The update query usues idata as the Key value for the TimePeriod table
            else if (QueryType == eQueryType.Update)
            {
                RetVal = "Update " + this.DBQueries.TablesName.TimePeriod + " Set " + Timeperiods.TimePeriod + " ='"
                + sTime + "' Where " + Timeperiods.TimePeriodNId + " = " + sTimeNid;
            }

            return RetVal;
        }
コード例 #5
0
ファイル: EIQuery.cs プロジェクト: SDRC-India/sdrcdevinfo
 internal string DB_InsertUpdate_Time(eQueryType QueryType, string sTime)
 {
     return this.DB_InsertUpdate_Time(QueryType, sTime, string.Empty);
 }
コード例 #6
0
ファイル: EIQuery.cs プロジェクト: SDRC-India/sdrcdevinfo
        internal string DB_AddSource(eQueryType QueryType, string sISOData, string sAbbrData,
            string sInformation, string sGuId, int iParentId, int iChildId)
        {
            string RetVal = string.Empty;

            // To insert of UPdate the Source
            if (QueryType == eQueryType.Insert)
            {
                if (iParentId == 0)
                {
                    RetVal = "INSERT INTO " + this.DBQueries.TablesName.IndicatorClassifications
                                 + "( " + IndicatorClassifications.ICParent_NId + "," + IndicatorClassifications.ICName + "," + IndicatorClassifications.ICInfo + "," + IndicatorClassifications.ICType + "," + IndicatorClassifications.ICGId + "," + IndicatorClassifications.ICGlobal + ")"
                                 + " Values(-1,'" + sISOData + "','"
                                 + sInformation + "','SR','" + sGuId + "',-1)";
                }
                else
                {
                    RetVal = "INSERT INTO " + this.DBQueries.TablesName.IndicatorClassifications
                                + "( " + IndicatorClassifications.ICParent_NId + ", " + IndicatorClassifications.ICName + "," + IndicatorClassifications.ICInfo + "," + IndicatorClassifications.ICType + "," + IndicatorClassifications.ICGId + "," + IndicatorClassifications.ICGlobal + ")" + " Values("
                                 + iParentId + ",'" + sAbbrData + "','"
                                 + sInformation + "','SR','" + sGuId + "',-1)";
                }
            }
            else
            {
                RetVal = "Update " + this.DBQueries.TablesName.IndicatorClassifications
                            + " Set " + IndicatorClassifications.ICName + " = '" + sAbbrData + "'Where " + IndicatorClassifications.ICNId + " = " + iParentId;
            }
            return RetVal;
        }
コード例 #7
0
ファイル: EIQuery.cs プロジェクト: SDRC-India/sdrcdevinfo
 internal string DB_AddSource(eQueryType QueryType, string sISOData, string sAbbrData)
 {
     return this.DB_AddSource(QueryType, sISOData, sAbbrData, string.Empty, string.Empty, 0, -1);
 }