Exemple #1
0
 public SqlSELECT(object select, string from, object where = null) : this()
 {
     if (select != null)
     {
         if (select.GetType().IsArray)
         {
             SELECT.AddRange((object[])select);
         }
         else
         {
             SELECT.Add(select);
         }
     }
     FROM = from;
     if (where != null)
     {
         var whereArr = where as IEnumerable <object>;
         if (whereArr == null)
         {
             WHERE.Add(where);
         }
         else
         {
             WHERE.AddRange(whereArr);
         }
     }
 }
Exemple #2
0
 // プレイ画面に戻る
 void SelectPlay()
 {
     this.state      = STATE.FIRST;
     this.modeSelect = SELECT.PLAY;
     Time.timeScale  = 1.0f;
     this.gameObject.SetActive(false);
 }
Exemple #3
0
    // 設定を変更し前の画面に戻る処理
    void SelectChange()
    {
        this.state      = STATE.FIRST;
        this.modeSelect = SELECT.PLAY;
        this.volumeUI.SetActive(false);

        // ボリュームを変更する処理
        for (int i = 0; i < sliderObjects.Length; i++)
        {
            preSliderValue[i] = sliders[i].value;
        }
    }
Exemple #4
0
 public static void Auth(string data)
 {
     try
     {
         var req = SELECT.SelectLoginRequest("*", "users", Items.GetLoginList(), Items.SetLoginList(data));
         RequestToDB.CreateRequest(req, "LoginRequest");
     }
     catch (Exception ex)
     {
         FormsManaging.TextGenerator(ex.ToString());
     }
 }
 public int AddCompetencyLearningResource(int resourceRefID, string resourceName, string description, string resourceType, string link, string catalogue, decimal rating, int competencyID, int adminId)
 {
     return(connection.ExecuteScalar <int>(
                @$ " DECLARE @learningResourceReferenceID int
             IF NOT EXISTS(SELECT * FROM LearningResourceReferences WHERE @resourceRefID = resourceRefID)
                 BEGIN
                     INSERT INTO LearningResourceReferences(
                         ResourceRefID,
                         OriginalResourceName,
                         OriginalDescription,
                         OriginalResourceType,
                         ResourceLink,
                         OriginalCatalogueName,
                         OriginalRating,
                         AdminID,
                         Added)
                     VALUES(
                         @resourceRefID,
                         @resourceName,
                         @description,
                         @resourceType,
                         @link,
                         @catalogue,
                         @rating,
                         @adminID,
                         GETDATE())
                     SELECT @learningResourceReferenceID = SCOPE_IDENTITY()
                 END
             ELSE
                 BEGIN
                     SELECT TOP 1 @learningResourceReferenceID = ID 
                     FROM LearningResourceReferences 
                     WHERE @resourceRefID = resourceRefID
                 END
             INSERT INTO CompetencyLearningResources(CompetencyID, LearningResourceReferenceID, AdminID)
                    VALUES (@competencyID, @learningResourceReferenceID, @adminID)
             SELECT SCOPE_IDENTITY() AS CompetencyLearningResourceId",
                new
     {
         resourceRefID,
         resourceName,
         description,
         resourceType,
         link,
         catalogue,
         rating,
         competencyID,
         adminId
     }
                ));
 }
        public static string RequestLeaderboards(int id)
        {
            SELECT Select = new SELECT();

            //string count = RequestToDB.CreateRequest(Select.SelectData("*", "scores", "score"), "GetLeaderboardsRequest", id);
            //var CountOfItems = count.Split(' ').Count();
            //var result = new List<LeaderList>(CountOfItems);
            //for (int i = 0; i < result.Capacity; i++)
            //{
            //   result.Add(new LeaderList { data = count });
            //}
            //return count;
            return(null);
        }
    private void Update()
    {
        this.horizontal = Input.GetAxisRaw("Horizontal");
        this.vertical   = Input.GetAxisRaw("Vertical") * -1;

        // 上下の移動量格納
        if (preVertical == 0)
        {
            if (vertical > 0)
            {
                this.value++;
            }
            else if (vertical < 0)
            {
                this.value--;
            }
        }

        // 左右の移動量格納
        if (preHorizontal == 0 && modeSelect == SELECT.CANCEL || modeSelect == SELECT.CHANGE)
        {
            if (horizontal > 0)
            {
                this.value = (int)SELECT.CHANGE;
            }
            else if (horizontal < 0)
            {
                this.value = (int)SELECT.CANCEL;
            }
        }

        // 最小値と最大値以内に値を設定する
        this.value = Mathf.Clamp(value, 0, (int)SELECT.CHANGE);
        // 値をモード選択状態に代入
        this.modeSelect = (SELECT)value;

        // ボリュームを変更する処理へ
        if (modeSelect != SELECT.CANCEL && modeSelect != SELECT.CHANGE)
        {
            ChangeVolume();
        }

        // 1フレーム前の値を格納
        this.preHorizontal = horizontal;
        this.preVertical   = vertical;
    }
Exemple #8
0
        public static void Insert(int new_All, int new_Firma, int new_Detal, int new_Diagnostik, long ID_ZAKAZ)
        {
            SqlParameter[] parameters = new SqlParameter[]
            {
                new SqlParameter(@"new_All", SqlDbType.Int)
                {
                    Value = new_All
                },
                new SqlParameter(@"new_Firma", SqlDbType.Int)
                {
                    Value = new_Firma
                },
                new SqlParameter(@"new_Detal", SqlDbType.Int)
                {
                    Value = new_Detal
                },
                new SqlParameter(@"new_Diagnostik", SqlDbType.Int)
                {
                    Value = new_Diagnostik
                },
                new SqlParameter(@"ID_ZAKAZ", SqlDbType.BigInt)
                {
                    Value = ID_ZAKAZ
                }
            };

            #region sql

            string sqlText = @$ "

-- получаем предыдущие значения, запоминаем и их логируем
declare @old_All int
	,@old_Firma int
	,@old_Detal int 
	,@old_Diagnostik int;


	SELECT @old_All=MoneyAll
		,@old_Firma=MoneyFirm
		,@old_Detal=MoneyDetal
		,@old_Diagnostik=MoneyDiagnostik
	FROM Zakaz
	WHERE ID_ZAKAZ=@ID_ZAKAZ


INSERT INTO [LogMoney] (
        public static string RequestLeaderboards()
        {
            string            count        = RequestToDB.CreateRequest(SELECT.SelectData("*", "scores", "score"), "GetLeaderboardsRequest");
            int               CountOfItems = count.Split(' ').Count();
            List <LeaderList> result       = new List <LeaderList>(CountOfItems);

            for (int i = 0; i < result.Capacity; i++)
            {
                result.Add(new LeaderList()
                {
                    data = count
                });
            }
            var responce = count;

            return(responce);
        }
Exemple #10
0
    public string BasicImportStart(bool dropTableFirst)
    {
        if (dropTableFirst)
        {
            return(@$ "

{LogMessageInScript($" Importing {
                FullFilePath
            } ")}
SELECT @JSON = BulkColumn
FROM OPENROWSET(BULK '{FullFilePath}', SINGLE_CLOB) AS j

{DropTableStatement(TableName)}
SELECT *
INTO {TableName}
FROM OPENJSON(@JSON)
");
        }
Exemple #11
0
    void Update()
    {
        // ロック中ならこれ以降処理を読まない
        if (GameMgr.IsLock)
        {
            return;
        }

        this.horizontal = Input.GetAxisRaw("Horizontal");
        this.vertical   = Input.GetAxisRaw("Vertical") * -1;

        switch (state)
        {
        case STATE.FIRST:
            FirstUI();
            break;

        case STATE.SECOND:
            SecondUI();
            break;
        }

        // 値をモード選択状態に代入
        this.modeSelect = (SELECT)value;
        // 1フレーム前の値を格納
        this.preHorizontal = horizontal;
        this.preVertical   = vertical;
        // アニメーション状態処理
        AnimationState();

        // Bボタンでモード選択
        if (Input.GetButtonDown("PAD_B_BUTTON") && CheckStartAnimation())
        {
            ModeTransition();
        }
    }
Exemple #12
0
WHERE           cr.CourseRunId IN (
                    SELECT      DISTINCT c.CourseRunId FROM [Pttcd].[FindACourseIndex] c
Exemple #13
0
/****** Object:  Database [UserInfor]    Script Date: 08/15/2019 09:36:38 ******/
IF  EXISTS (SELECT name FROM sys.databases WHERE name = N'UserInfor')
Exemple #14
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 public void GetByName(string name)
 {
     SELECT select = new SELECT(Table);
       select.AddWhere(new Column(NameColumnName), Operator.Equals, name, Vendjuuren.SQL.Boolean.AND);
       base.GetByStatement(select);
 }
 FROM
     (SELECT IDNOCR, COUNT(*) AS ADDCOUNT FROM SRLIB.RGLIDCH
Exemple #16
0
 // 設定画面表示
 void SelectSetting()
 {
     this.volumeUI.SetActive(true);
     this.state      = STATE.SECOND;
     this.modeSelect = SELECT.MASTER;
 }
 LEFT JOIN
     (SELECT IDNOCR, COUNT(*) AS DROPCOUNT FROM SRLIB.RGLIDCH
Exemple #18
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="group"></param>
 /// <param name="number"></param>
 public void GetByLetterNumber(Group group, int number)
 {
     SELECT select = new SELECT(Table);
       select.AddWhere(new Column(GroupIDColumnName), Operator.Equals, group.ID, Vendjuuren.SQL.Boolean.AND);
       select.AddWhere(new Column(NumberColumnName), Operator.Equals, number, Vendjuuren.SQL.Boolean.AND);
       base.GetByStatement(select);
 }
Exemple #19
0
 public static void GetUserScores(string username)
 {
     RequestToDB.CreateRequest(SELECT.SelectLoginRequest("score", "scores", "username", Items.GetScoreList(username)), "GetScoreRequest");
 }
 /// <summary>
 /// 
 /// </summary>
 /// <remarks>
 /// TODO: 1 algemene method maken
 /// </remarks>
 /// <param name="id"></param>
 public void GetAllByProgramID(Guid id)
 {
     SELECT select = new SELECT(Table);
       select.AddWhere(new Column(ProgramIDColumnName), Operator.Equals, id, Vendjuuren.SQL.Boolean.AND);
       base.GetAllByStatement(select);
 }
Exemple #21
0
 AS
 (
  SELECT T1.ID, T1.NOMBRE, T1.DESCRIPCION, T1.ICONO, T1.ACTIVO, T1.IDPADRE,  T1.IDVISTA_MVC, T1.ORDEN
Exemple #22
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="letter"></param>
 public void GetByLetter(Letter letter)
 {
     SELECT select = new SELECT(Table);
       select.AddWhere(new Column(LetterColumnName), Operator.Equals, letter, Vendjuuren.SQL.Boolean.AND);
       base.GetByStatement(select);
 }
Exemple #23
0
                    FROM 
								(
	                SELECT		
                                    groups.[Id],
Exemple #24
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 public void GetByBrandAndType(Brand brand, string type)
 {
     SELECT select = new SELECT(Table);
       select.AddWhere(new Column(BrandIDColumnName), Operator.Equals, brand.ID, Vendjuuren.SQL.Boolean.AND);
       select.AddWhere(new Column(TypeColumnName), Operator.Equals, type, Vendjuuren.SQL.Boolean.AND);
       base.GetByStatement(select);
 }
        private void RetrieveLine2_MSAS(
            Dictionary <Level, HashSet <Member> > src, Line ALine, Hierarchy intelligenceh, StringBuilder WHERE,
            List <long> idxmul, List <Level> idxlevels, MOlapCube cube,
            ref StringBuilder WITH, List <Hierarchy> sources,
            string MeasureName, ref StringBuilder SELECT, ref long idx, ref StringBuilder SUBCUBE)
        {
            //DebugLogging.WriteLine("MdEngine.RetrieveLine2_MSAS(aline={0})", ALine.ToString());

            var single         = true;
            var subcubeCounter = 0;
            var lh             = new List <Hierarchy>(2);

            if (cube.Is2000)
            {
                WHERE.Append(MeasureName);

                foreach (var h in sources) // visual totals
                {
                    if (h.Filtered)
                    {
                        cube.MakeVisualTotals(h, WITH);
                        lh.Add(h);
                    }
                }
            }
            else
            {
                if (ALine.Measure.IsKPI)
                {
                    switch (ALine.fMode.Mode)
                    {
                    case MeasureShowModeType.smKPIValue:
                    case MeasureShowModeType.smSpecifiedByEvent:
                        WHERE.Append("KPIValue");
                        break;

                    case MeasureShowModeType.smKPIGoal:
                        WHERE.Append("KPIGoal");
                        break;

                    case MeasureShowModeType.smKPIStatus:
                        WHERE.Append("KPIStatus");
                        break;

                    case MeasureShowModeType.smKPITrend:
                        WHERE.Append("KPITrend");
                        break;

                    case MeasureShowModeType.smKPIWeight:
                        WHERE.Append("KPIWeight");
                        break;
                    }
                    WHERE.Append("(\"");
                    WHERE.Append(ALine.Measure.UniqueName);
                    WHERE.Append("\")");
                }
                else
                {
                    WHERE.Append(MeasureName);
                }
            }

            var lh2     = new List <Hierarchy>();
            var singles = new SortedList <string, Member>();

            foreach (var h in FGrid.FFilteredHierarchies) // subcube filtered
            {
                Member m     = null;
                var    _done = false;

                if (cube.Is2000)
                {
                    if (lh.Contains(h))
                    {
                        continue; // already processed (visualtotals)
                    }
                    foreach (var probe in src)
                    {
                        bool ss;
                        if (probe.Key.Hierarchy == h)
                        {
                            _done = true;
                            cube.MakeWhere(h, WITH, WHERE, probe.Value, out ss);
                            single = single && ss;
                            if (single && probe.Value.Count == 1)
                            {
                                if (m != null)
                                {
                                    single = false;
                                }
                                else
                                {
                                    m = probe.Value.First();
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (h.RetrieveFilteredMember() != null && !IsHierarchyInLevels(h, ALine.Levels))
                    {
                        foreach (var probe in src)
                        {
                            if (probe.Key.Hierarchy == h)
                            {
                                cube.MakeWhere(h, WITH, WHERE, probe.Value, out single);
                                if (single)
                                {
                                    var m1 = probe.Value.First();
                                    singles.Add(h.UniqueName, m1);
                                    if (h == intelligenceh && WITH.ToString().Contains("{0}"))
                                    {
                                        // sets restriction member to the intelligence script
                                        WITH = new StringBuilder(WITH.ToString().Replace("{0}", m.UniqueName));
                                    }
                                }
                                lh2.Add(h);
                                break;
                            }
                        }
                    }
                }

                if (cube.Is2000)
                {
                    if (!_done)
                    {
                        cube.MakeWhere(h, WITH, WHERE, null, out single);
                    }

                    if (single)
                    {
                        singles.Add(h.UniqueName, m);
                        if (h == intelligenceh && WITH.ToString().Contains("{0}"))
                        {
                            WITH = new StringBuilder(WITH.ToString().Replace("{0}", m.UniqueName));
                        }
                    }
                    lh2.Add(h);
                }
                else
                {
                    if (lh2.Contains(h))
                    {
                        continue;
                    }

                    if (SUBCUBE == null)
                    {
                        SUBCUBE = new StringBuilder("SELECT ");
                    }
                    if (subcubeCounter > 0)
                    {
                        SUBCUBE.Append(",");
                        SUBCUBE.AppendLine();
                    }
                    SUBCUBE.Append("{");
                    //SUBCUBE.Append(cube.DoSubcubeFilter(h, m));
                    SUBCUBE.Append(cube.DoSubcubeFilter(h, null));
                    SUBCUBE.Append("} ON ");
                    SUBCUBE.Append(subcubeCounter++);
                    lh2.Add(h);
                }
            }

            string contextsubcube = null;

            if (cube.Is2000)
            {
                foreach (var probe in src) // apply other restrictions
                {
                    if (probe.Value.Count > 1 || probe.Key.Hierarchy == null)
                    {
                        continue;
                    }

                    if (!lh2.Contains(probe.Key.Hierarchy))
                    {
                        if (sources.Contains(probe.Key.Hierarchy) &&
                            (!ALine.Levels.Contains(probe.Key) ||
                             probe.Key.Hierarchy.Origin == HierarchyOrigin.hoParentChild))
                        {
                            continue;
                        }

                        if (probe.Key.Hierarchy.Origin == HierarchyOrigin.hoParentChild)
                        {
                            if (probe.Value.Count == 1 && ALine.Levels.Contains(probe.Key))
                            {
                                if (probe.Value.First().Depth == ALine.fDepthes[ALine.Levels.IndexOf(probe.Key)] - 1)
                                {
                                    continue;
                                }
                            }
                        }

                        if (src.Keys.Any(item => item.Hierarchy == probe.Key.Hierarchy && item.Index > probe.Key.Index))
                        {
                            continue;
                        }

                        cube.MakeWhere(probe.Key.Hierarchy, WITH, WHERE, probe.Value, out single);
                        if (!single)
                        {
                            continue;
                        }
                    }
                    if (!singles.ContainsKey(probe.Key.Hierarchy.UniqueName) && probe.Value.Count == 1)
                    {
                        singles.Add(probe.Key.Hierarchy.UniqueName, probe.Value.First());
                        if (probe.Key.Hierarchy == intelligenceh && WITH.ToString().Contains("{0}"))
                        {
                            WITH = new StringBuilder(WITH.ToString().Replace("{0}", probe.Value.First().UniqueName));
                        }
                    }
                    idx += probe.Value.First().ID *ALine.Multipliers[ALine.Levels.IndexOf(probe.Key)];
                }
            }
            else
            {
                contextsubcube = cube.GetContextFilterSubcube(FGrid);

                if (SUBCUBE != null)
                {
                    SUBCUBE.AppendLine();
                    SUBCUBE.Append("FROM ");
                    SUBCUBE.Append(contextsubcube);
                }
            }

            // make crossjoin
            var b = false;

            for (var i = 0; i < ALine.Levels.Count; i++)
            {
                var l = ALine.Levels[i];

                if (singles.ContainsKey(l.Hierarchy.UniqueName))
                {
                    continue;
                }
                idxlevels.Add(l);
                idxmul.Add(ALine.Multipliers[ALine.Levels.IndexOf(l)]);
                if (b)
                {
                    SELECT.Append("*");
                }

                var me = new HashSet <Member>();
                foreach (var probe in src)
                {
                    if (probe.Key.Hierarchy == l.Hierarchy)
                    {
                        me = probe.Value;
                        break;
                    }
                }
                SELECT.Append(cube.MakeCrossjoin(l, WITH, me, ALine.fDepthes[i]));
                if (l.Hierarchy == intelligenceh && WITH.ToString().Contains("{0}"))
                {
                    // sets "currentmember" for the crossjoin hierarchy to the intelligence script
                    WITH = new StringBuilder(WITH.ToString().Replace("{0}", l.Hierarchy.UniqueName + ".CURRENTMEMBER"));
                }
                b = true;
            }

            if (idxlevels.Count == 0)
            {
                SELECT = new StringBuilder("SELECT ");
            }
            else
            {
                if (cube.MDXCellsetThreshold > 0 && cube.Is2000 == false)
                {
                    SELECT.Append("}), "
                                  + cube.MDXCellsetThreshold
                                  + ")} DIMENSION PROPERTIES MEMBER_TYPE ON 0 ");
                }
                else
                {
                    SELECT.Append("} DIMENSION PROPERTIES MEMBER_TYPE ON 0 ");
                }
            }

            if (cube.Is2000)
            {
                SELECT.AppendLine();
                SELECT.Append("FROM ");
                SELECT.Append(cube.ApplySubcubeFilter());
                SELECT.AppendLine();

                WHERE.Append(")");
            }
            else
            {
                if (SUBCUBE == null)
                {
                    SELECT.Append("FROM ");
                    SELECT.Append(contextsubcube);
                }
                else
                {
                    SELECT.Append("FROM (");
                    SELECT.Append(SUBCUBE);
                    SELECT.Append(")");
                }
                SELECT.AppendLine();

                WHERE.Append(")");
            }
        }
Exemple #26
0
LEFT OUTER JOIN (SELECT COUNT(1) as LiveCourseCount, 
Exemple #27
0
LEFT OUTER JOIN (SELECT COUNT(1) AS LiveTLevelCount, 
 AND (SELECT DATEDIFF(DAY, [startDate], @startDate)) = 0