Пример #1
0
        // Handles gridEdit.ClickEvent
        private void gridEdit_ClickEvent(System.Object eventSender, System.EventArgs eventArgs)
        {
            frmLangGet   frmLanguageGet = null;
            int          InLanguage     = 0;
            MsgBoxResult inres          = default(MsgBoxResult);
            int          k_ID           = 0;
            string       lName          = null;
            string       sScreen        = null;
            bool         bRTL           = false;
            string       kView          = null;
            short        inRe           = 0;
            short        lKey           = 0;
            short        lShift         = 0;

            ADODB.Recordset rs = default(ADODB.Recordset);

            if (grClick == true)
            {
                grClick = false;
                return;
            }

            lName = Strings.Trim(gridEdit.get_TextMatrix(ref gridEdit.row, ref 0));
            kView = Strings.UCase(Strings.Trim(gridEdit.get_TextMatrix(ref gridEdit.row, ref 1)));
            if (kView == "YES")
            {
                bRTL = true;
            }
            else
            {
                bRTL = false;
            }
            sScreen = Strings.Trim(gridEdit.get_TextMatrix(ref gridEdit.row, ref 2));
            My.MyProject.Forms.frmLangGet.getLanguageValue(ref lName, ref bRTL, ref sScreen);

            if (!string.IsNullOrEmpty(lName))
            {
                //Set rs = getRS("SELECT Language.* From Language WHERE (((Language.Language_Shift)=" & lShift & ") AND ((Language.Language_Key)=" & lKey & "));")
                rs = modRecordSet.getRS(ref "SELECT Language.LanguageID, Language.Language_Description, LanguageLayoutLnk.* FROM LanguageLayoutLnk INNER JOIN Language ON LanguageLayoutLnk.LanguageLayoutLnk_LanguageID = Language.LanguageID Where (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID) = " + gParentID + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_LanguageID)=" + gridEdit.get_RowData(ref gridEdit.row) + "))");

                if (rs.RecordCount)
                {
                    //    If rs("LanguageID") = gridEdit.RowData(gridEdit.row) Then
                    //    Else
                    //        MsgBox "Cannot allocate this key as it is allocated to '" & rs("Language_Name") & "!", vbExclamation, "Language LAYOUT"
                    //    End If
                    //Else
                    //    lName = getKeyDescription(lKey, lShift)
                    lName = Strings.Replace(lName, ",", "-");
                    lName = Strings.Replace(lName, "'", "''");
                    modRecordSet.cnnDB.Execute("UPDATE LanguageLayoutLnk SET LanguageLayoutLnk.LanguageLayoutLnk_RightTL = " + bRTL + ", LanguageLayoutLnk.LanguageLayoutLnk_Description = '" + lName + "' WHERE (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID)=" + gParentID + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_LanguageID)=" + gridEdit.get_RowData(ref gridEdit.row) + "));");
                    //cnnDB.Execute "UPDATE LanguageLayoutLnk SET LanguageLayoutLnk.LanguageLayoutLnk_Shift = " & lShift & ", LanguageLayoutLnk.LanguageLayoutLnk_Key = " & lKey & ", LanguageLayoutLnk.LanguageLayoutLnk_Description = '" & lName & "' WHERE (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID)=" & gParentID & ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_LanguageID)=" & gridEdit.RowData(gridEdit.row) & "));"
                    //    gridEdit.TextMatrix(gridEdit.row, 3) = lKey
                    if (bRTL == true)
                    {
                        gridEdit.set_TextMatrix(ref gridEdit.row, ref 1, ref "YES");
                    }
                    else
                    {
                        gridEdit.set_TextMatrix(ref gridEdit.row, ref 1, ref "NO");
                    }
                    gridEdit.set_TextMatrix(ref gridEdit.row, ref 0, ref lName);
                }
            }

            return;

            kView = Strings.UCase(Strings.Trim(gridEdit.get_TextMatrix(ref gridEdit.row, ref gridEdit.Col)));

            if (kView == "YES" | kView == "NO")
            {
                k_ID = Conversion.Val(gridEdit.get_TextMatrix(ref gridEdit.row, ref gridEdit.Col + 1));
                if (kView == "YES")
                {
                    inres = Interaction.MsgBox("Do you want to hide Key on Language", MsgBoxStyle.ApplicationModal + MsgBoxStyle.YesNo + MsgBoxStyle.Question, _4PosBackOffice.NET.My.MyProject.Application.Info.Title);
                    if (inres == MsgBoxResult.Yes)
                    {
                        modRecordSet.cnnDB.Execute("UPDATE Language SET Language_Show = 0 WHERE LanguageID = " + k_ID);
                        gridEdit.set_TextMatrix(ref gridEdit.row, ref gridEdit.Col, ref "NO");
                    }
                }
                else if (kView == "NO")
                {
                    inres = Interaction.MsgBox("Do you want to show Key on Language", MsgBoxStyle.ApplicationModal + MsgBoxStyle.YesNo + MsgBoxStyle.Question, _4PosBackOffice.NET.My.MyProject.Application.Info.Title);
                    if (inres == MsgBoxResult.Yes)
                    {
                        modRecordSet.cnnDB.Execute("UPDATE Language SET Language_Show = 1 WHERE LanguageID = " + k_ID);
                        gridEdit.set_TextMatrix(ref gridEdit.row, ref gridEdit.Col, ref "YES");
                    }
                }

                return;
            }

            lName = gridEdit.get_TextMatrix(ref gridEdit.row, ref 0);
            //k_ID = Val(gridEdit.TextMatrix(gridEdit.row, 6))
            //Do Display Option.....

            if (gridEdit.Col > 0)
            {
                if (Conversion.Val(kView) > 0)
                {
                    if (Conversion.Val(kView) < 100)
                    {
                        My.MyProject.Forms.frmChangeDisplay.lblName.Text   = lName;
                        My.MyProject.Forms.frmChangeDisplay.txtNumber.Text = Strings.Trim(kView);
                        My.MyProject.Forms.frmChangeDisplay.ShowDialog();

                        if (InLanguage == 200)
                        {
                        }
                        else
                        {
                            modRecordSet.cnnDB.Execute("UPDATE Language SET Language_Order = " + InLanguage + " WHERE LanguageID = " + k_ID);
                            var _with2 = gridEdit;
                            _with2.Text = Conversion.Str(InLanguage);
                            if (Option1.Checked)
                            {
                                loadKeys(ref ref 0);
                            }
                            if (Option2.Checked)
                            {
                                loadKeys(ref ref 2);
                            }
                            if (Option3.Checked)
                            {
                                loadKeys(ref ref 1);
                            }
                        }
                    }
                    return;
                }
            }

            lName = gridEdit.get_TextMatrix(ref gridEdit.row, ref 0);

            //lKey = gridEdit.TextMatrix(gridEdit.row, 3)
            //lShift = gridEdit.TextMatrix(gridEdit.row, 2)
            //UPGRADE_WARNING: Couldn't resolve default property of object frmLanguageGet.getLanguageValue. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
            frmLanguageGet.getLanguageValue(ref lName, ref lKey, ref lShift);

            if (lKey != 0)
            {
                //Set rs = getRS("SELECT Language.* From Language WHERE (((Language.Language_Shift)=" & lShift & ") AND ((Language.Language_Key)=" & lKey & "));")
                rs = modRecordSet.getRS(ref "SELECT Language.LanguageID, Language.Language_Name, LanguageLayoutLnk.* FROM LanguageLayoutLnk INNER JOIN Language ON LanguageLayoutLnk.LanguageLayoutLnk_LanguageID = Language.LanguageID Where (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID) = " + gParentID + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_Shift)=" + lShift + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_Key)=" + lKey + "))");

                if (rs.RecordCount)
                {
                    if (rs.Fields("LanguageID").Value == gridEdit.get_RowData(ref gridEdit.row))
                    {
                    }
                    else
                    {
                        Interaction.MsgBox("Cannot allocate this key as it is allocated to '" + rs.Fields("Language_Name").Value + "!", MsgBoxStyle.Exclamation, "Language LAYOUT");
                    }
                }
                else
                {
                    lName = getKeyDescription(ref lKey, ref lShift);
                    modRecordSet.cnnDB.Execute("UPDATE LanguageLayoutLnk SET LanguageLayoutLnk.LanguageLayoutLnk_Shift = " + lShift + ", LanguageLayoutLnk.LanguageLayoutLnk_Key = " + lKey + ", LanguageLayoutLnk.LanguageLayoutLnk_Description = '" + lName + "' WHERE (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID)=" + gParentID + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_LanguageID)=" + gridEdit.get_RowData(ref gridEdit.row) + "));");
                    gridEdit.set_TextMatrix(ref gridEdit.row, ref 3, ref lKey);
                    gridEdit.set_TextMatrix(ref gridEdit.row, ref 2, ref lShift);
                    gridEdit.set_TextMatrix(ref gridEdit.row, ref 1, ref lName);
                }
            }
        }
Пример #2
0
        private void gridEdit_ClickEvent(System.Object eventSender, System.EventArgs eventArgs)
        {
            frmLangGet   frmLanguageGet = null;
            RadioButton  Option3        = new RadioButton();
            RadioButton  Option2        = new RadioButton();
            RadioButton  Option1        = new RadioButton();
            int          InLanguage     = 0;
            MsgBoxResult inres          = default(MsgBoxResult);
            int          k_ID           = 0;
            string       lName          = null;
            string       sScreen        = null;
            bool         bRTL           = false;
            string       kView          = null;
            short        inRe           = 0;
            short        lKey           = 0;
            short        lShift         = 0;

            ADODB.Recordset rs = default(ADODB.Recordset);

            lName = Strings.Trim(gridEdit.get_TextMatrix(ref gridEdit.RowCount, ref 0));
            //If kView = "YES" Then
            bRTL = true;
            //Else
            //    bRTL = False
            //End If
            sScreen = "";
            //Trim(gridEdit.TextMatrix(gridEdit.row, 2))
            My.MyProject.Forms.frmLangGet.getLanguageValue(ref lName, ref bRTL, ref sScreen);

            if (!string.IsNullOrEmpty(lName))
            {
                rs = modRecordSet.getRS(ref "SELECT * FROM Menu WHERE ((MenuID)=" + gridEdit.get_RowData(ref gridEdit.RowCount) + ");");

                if (rs.RecordCount)
                {
                    lName = Strings.Replace(lName, ",", "-");
                    lName = Strings.Replace(lName, "'", "''");

                    modRecordSet.cnnDB.Execute("UPDATE Menu SET Menu_Update=True, Menu_Name = '" + lName + "' WHERE ((MenuID)=" + gridEdit.get_RowData(ref gridEdit.RowCount) + ");");
                    gridEdit.set_TextMatrix(ref gridEdit.RowCount, ref 0, ref lName);
                }
            }

            return;

            kView = Strings.UCase(Strings.Trim(gridEdit.get_TextMatrix(ref gridEdit.RowCount, ref gridEdit.ColumnCount)));

            if (kView == "YES" | kView == "NO")
            {
                k_ID = Conversion.Val(gridEdit.get_TextMatrix(ref gridEdit.RowCount, ref gridEdit.ColumnCount + 1));
                if (kView == "YES")
                {
                    inres = Interaction.MsgBox("Do you want to hide Key on Language", MsgBoxStyle.ApplicationModal + MsgBoxStyle.YesNo + MsgBoxStyle.Question, _4PosBackOffice.NET.My.MyProject.Application.Info.Title);
                    if (inres == MsgBoxResult.Yes)
                    {
                        modRecordSet.cnnDB.Execute("UPDATE Language SET Language_Show = 0 WHERE LanguageID = " + k_ID);
                        gridEdit.set_TextMatrix(ref gridEdit.RowCount, ref gridEdit.ColumnCount, ref "NO");
                    }
                }
                else if (kView == "NO")
                {
                    inres = Interaction.MsgBox("Do you want to show Key on Language", MsgBoxStyle.ApplicationModal + MsgBoxStyle.YesNo + MsgBoxStyle.Question, _4PosBackOffice.NET.My.MyProject.Application.Info.Title);
                    if (inres == MsgBoxResult.Yes)
                    {
                        modRecordSet.cnnDB.Execute("UPDATE Language SET Language_Show = 1 WHERE LanguageID = " + k_ID);
                        gridEdit.set_TextMatrix(ref gridEdit.RowCount, ref gridEdit.ColumnCount, ref "YES");
                    }
                }

                return;
            }

            lName = gridEdit.get_TextMatrix(ref gridEdit.RowCount, ref 0);
            //k_ID = Val(gridEdit.TextMatrix(gridEdit.row, 6))
            //Do Display Option.....

            if (gridEdit.ColumnCount > 0)
            {
                if (Conversion.Val(kView) > 0)
                {
                    if (Conversion.Val(kView) < 100)
                    {
                        My.MyProject.Forms.frmChangeDisplay.lblName.Text   = lName;
                        My.MyProject.Forms.frmChangeDisplay.txtNumber.Text = Strings.Trim(kView);
                        My.MyProject.Forms.frmChangeDisplay.ShowDialog();

                        if (InLanguage == 200)
                        {
                        }
                        else
                        {
                            modRecordSet.cnnDB.Execute("UPDATE Language SET Language_Order = " + InLanguage + " WHERE LanguageID = " + k_ID);
                            var _with2 = gridEdit;
                            _with2.Text = Conversion.Str(InLanguage);
                            if (Option1.Checked)
                            {
                                loadKeys(ref ref 0);
                            }
                            if (Option2.Checked)
                            {
                                loadKeys(ref ref 2);
                            }
                            if (Option3.Checked)
                            {
                                loadKeys(ref ref 1);
                            }
                        }
                    }
                    return;
                }
            }

            lName = gridEdit.get_TextMatrix(ref gridEdit.RowCount, ref 0);

            //lKey = gridEdit.TextMatrix(gridEdit.row, 3)
            //lShift = gridEdit.TextMatrix(gridEdit.row, 2)
            frmLanguageGet.getLanguageValue(ref lName, ref lKey, ref lShift);

            if (lKey != 0)
            {
                //Set rs = getRS("SELECT Language.* From Language WHERE (((Language.Language_Shift)=" & lShift & ") AND ((Language.Language_Key)=" & lKey & "));")
                rs = modRecordSet.getRS(ref "SELECT Language.LanguageID, Language.Language_Name, LanguageLayoutLnk.* FROM LanguageLayoutLnk INNER JOIN Language ON LanguageLayoutLnk.LanguageLayoutLnk_LanguageID = Language.LanguageID Where (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID) = " + gParentID + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_Shift)=" + lShift + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_Key)=" + lKey + "))");

                if (rs.RecordCount)
                {
                    if (rs.Fields("LanguageID").Value == gridEdit.get_RowData(ref gridEdit.RowCount))
                    {
                    }
                    else
                    {
                        Interaction.MsgBox("Cannot allocate this key as it is allocated to '" + rs.Fields("Language_Name").Value + "!", MsgBoxStyle.Exclamation, "Language LAYOUT");
                    }
                }
                else
                {
                    lName = getKeyDescription(ref lKey, ref lShift);
                    modRecordSet.cnnDB.Execute("UPDATE LanguageLayoutLnk SET LanguageLayoutLnk.LanguageLayoutLnk_Shift = " + lShift + ", LanguageLayoutLnk.LanguageLayoutLnk_Key = " + lKey + ", LanguageLayoutLnk.LanguageLayoutLnk_Description = '" + lName + "' WHERE (((LanguageLayoutLnk.LanguageLayoutLnk_LanguageLayoutID)=" + gParentID + ") AND ((LanguageLayoutLnk.LanguageLayoutLnk_LanguageID)=" + gridEdit.get_RowData(ref gridEdit.RowCount) + "));");
                    gridEdit.set_TextMatrix(ref gridEdit.RowCount, ref 3, ref lKey);
                    gridEdit.set_TextMatrix(ref gridEdit.RowCount, ref 2, ref lShift);
                    gridEdit.set_TextMatrix(ref gridEdit.RowCount, ref 1, ref lName);
                }
            }
        }