** Need to put the proper delimiters around comparison values of certain types
lcValue1 = THISFORM.ValidateType(THIS.pageframe1.page3.cboField1.Value,lcValue1)
** Create the second part of the WHERE condition
IF!EMPTY(lcOperand1)
lcValue2 = THISFORM.ValidateType(THIS.pageframe1.page3.cboField2.Value,lcValue2)
lcWHERE = lcOperand1 + " " + lcField2 + " " +;
lcRelation2 + " " + lcValue2
ENDIF
IF!EMPTY(lcOperand2)
lcValue3 = THISFORM.ValidateType(THIS.pageframe1.page3.cboField3.Value,lcValue3)
lcWHERE = lcWhere + " " + lcOperand2 + " " + lcField3 + " " +;
lcRelation3 + " " + lcValue3
** Create the first part of the WHERE condition
lcWHERE = "WHERE " + lcField1 + " " + lcRelation1 + " ";
+ lcValue1 + " " + lcWHERE
** Create the full SQL command using the base table for the form
lcSQL = "SELECT * FROM " + lcAlias + " " + lcWHERE
THISFORM.DataSql = lcSQL
THISFORM.pageframe1.page3.cmdClear.Enabled =.T.
THISFORM.pageframe1.page3.cmdExecute.Enabled =.T.
Form1.clearsql
THISFORM.pageframe1.page3.cboField1.Value = ""
THISFORM.pageframe1.page3.cboRelation1.Value = "="
THISFORM.pageframe1.page3.txtValue1.Value = ""
THISFORM.pageframe1.page3.opgOperand1.Value = 0
THISFORM.pageframe1.page3.cboField2.Value = ""
THISFORM.pageframe1.page3.cboRelation2.Value = "="
THISFORM.pageframe1.page3.cboField2.Enabled =.F.
THISFORM.pageframe1.page3.cboRelation2.Enabled =.F.
THISFORM.pageframe1.page3.txtValue2.Enabled =.F.
THISFORM.pageframe1.page3.txtValue2.Value = ""
THISFORM.pageframe1.page3.opgOperand2.Value = 0
THISFORM.pageframe1.page3.cboField3.Value = ""
THISFORM.pageframe1.page3.cboRelation3.Value = "="
THISFORM.pageframe1.page3.txtValue3.Value = ""
THISFORM.pageframe1.page3.cboField3.Enabled =.F.
THISFORM.pageframe1.page3.cboRelation3.Enabled =.F.
THISFORM.pageframe1.page3.txtValue3.Enabled =.F.
THISFORM.pageframe1.page3.cmdClear.Enabled =.F.
THISFORM.pageframe1.page3.cmdExecute.Enabled =.F.
Form1.Settexboxformat
LPARAMETERS oSource, oTxt
LOCAL lcType
oTxt.Value = ""
lcType = TYPE(oSource.Value)
DO CASE
CASE lcType = "D"
oTxt.Format = "D"
CASE lcType = "L"
oTxt.Inputmask = ".T.,.F."
oTxt.Format = "M"
CASE lcType = "T"
oTxt.Inputmask = "99/99/99 99:99:99"
ENDCASE
Form1.validatetype
LPARAMETERS lField, lcValue
lcType = TYPE(lField)
CASE lcType $ "CM"
lcValue = CHR(34) + lcValue + CHR(34)
CASE lcType $ "DT"
lcValue = "{" + lcValue + "}"
CASE lcType $ "NY"
IF EMPTY(lcValue)
lcValue = "0"
CASE lcType $ "L"
IF!INLIST(UPPER(lcValue), ".T.", ".F.")
lcValue = ".T."
RETURN lcValue
Form1.PageFrame1.Grid1.Column1.Header1.MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nShift = 2
SET ORDER TO razdel DESCENDING
ELSE
SET ORDER TO razdel ASCENDING
GO TOP
THISFORM.Refresh
Form1.PageFrame1.Grid1.Column2.Header1.MouseUp
SET ORDER TO pozic DESCENDING
SET ORDER TO pozic ASCENDING
Form1.PageFrame1.Grid1.Column3.Header1.MouseUp
SET ORDER TO garant DESCENDING
SET ORDER TO garant ASCENDING
Form1.PageFrame1.Grid1.Column4.Header1.MouseUp
SET ORDER TO cena_1 DESCENDING
SET ORDER TO cena_1 ASCENDING
Form1.PageFrame1.Page2.Activate
this.refresh
Form1.PageFrame1.Page2.commandgroup1.Command1.Click
go top
if BOF ()
MESSAGEBOX("Вы достигли первой записи",0+64+0,"Уведомление")
endif
_screen.activeForm.refresh()
Form1.PageFrame1.Page2.commandgroup1.Command2.Click
if!bof()
skip -1
else
Form1.PageFrame1.Page2.commandgroup1.Command3.Click
hisform.pageframe1.page2.command1.visible =.T.
thisform.pageframe1.page2.cmdCancel.visible =.T.
thisform.pageframe1.page2.text1.readonly =.F.
thisform.pageframe1.page2.text2.readonly =.F.
thisform.pageframe1.page2.text3.readonly =.F.
thisform.pageframe1.page2.text4.readonly =.F.
thisform.pageframe1.page2.text5.readonly =.F.
thisform.pageframe1.page2.text6.readonly =.F.
thisform.pageframe1.page2.text7.readonly =.F.
thisform.pageframe1.page2.commandgroup1.command1.enabled =.F.
thisform.pageframe1.page2.commandgroup1.command2.enabled =.F.
thisform.pageframe1.page2.commandgroup1.command3.enabled =.F.
thisform.pageframe1.page2.commandgroup1.command4.enabled =.F.
thisform.pageframe1.page2.commandgroup1.command5.enabled =.F.
thisform.pageframe1.page2.commandgroup1.command6.enabled =.F.
thisform.pageframe1.page2.commandgroup1.command7.enabled =.F.
Form1.PageFrame1.Page2.commandgroup1.Command4.Click
append blank
thisform.refresh
thisform.pageframe1.page2.commandgroup1.command3.Click
Form1.PageFrame1.Page2.commandgroup1.Command5.Click
if messagebox("Вы действительно хотите удалить эту запись?", 4+48+256, "Комплектующие")=6
delete
reindex
thisform.pageframe1.page1.grid1.Refresh
thisform.pageframe1.ActivePage = 1
Form1.PageFrame1.Page2.commandgroup1.Command6.Click
skip
if!eof()
MESSAGEBOX("Вы достигли последней записи",0+64+0,"Уведомление")
skip-1
thisform.Refresh()
Form1.PageFrame1.Page2.commandgroup1.Command7.Click
go bottom
thisform.pageframe1.page2.Refresh
Form1.PageFrame1.Page2..Command1.Click
thisform.pageframe1.page2.command1.visible =.F.
pozic = thisform.pageframe1.page2.text2.value
razdel = thisform.pageframe1.page2.text1.value
charakt= thisform.pageframe1.page2.text3.value
garant = thisform.pageframe1.page2.text4.value
cena_1 = thisform.pageframe1.page2.text5.value
cena_2 = thisform.pageframe1.page2.text6.value
cena_3 = thisform.pageframe1.page2.text7.value
thisform.pageframe1.page1.grid1.refresh
thisform.pageframe1.page2.text1.readonly =.T.
thisform.pageframe1.page2.text2.readonly =.T.
thisform.pageframe1.page2.text3.readonly =.T.
thisform.pageframe1.page2.text4.readonly =.T.
thisform.pageframe1.page2.text5.readonly =.T.
thisform.pageframe1.page2.text6.readonly =.T.
thisform.pageframe1.page2.text7.readonly =.T.
thisform.pageframe1.page2.commandgroup1.command1.enabled =.T.
thisform.pageframe1.page2.commandgroup1.command2.enabled =.T.
thisform.pageframe1.page2.commandgroup1.command3.enabled =.T.
thisform.pageframe1.page2.commandgroup1.command4.enabled =.T.
thisform.pageframe1.page2.commandgroup1.command5.enabled =.T.
thisform.pageframe1.page2.commandgroup1.command6.enabled =.T.
thisform.pageframe1.page2.commandgroup1.command7.enabled =.T.
Form1.PageFrame1.Page3.cboField1.InteractiveChange
THISFORM.SetTextboxFormat(THIS, THISFORM.pageframe1.page3.txtValue1)
THISFORM.BldSQL
Form1.PageFrame1.Page3.cboField2.InteractiveChange
THISFORM.SetTextboxFormat(THIS, THISFORM.pageframe1.page3.txtValue2)
Form1.PageFrame1.Page3.cboField3.InteractiveChange
THISFORM.SetTextboxFormat(THIS, THISFORM.pageframe1.page3.txtValue3)
Form1.PageFrame1.Page3.cboRelation1.InteractiveChange
Form1.PageFrame1.Page3.cboRelation2.InteractiveChange
Form1.PageFrame1.Page3.cboRelation3.InteractiveChange
Form1.PageFrame1.Page3.txtValue1
Form1.PageFrame1.Page3.txtValue2
Form1.PageFrame1.Page3.txtValue3
Form1.PageFrame1.Page3.opgOperand1. InteractiveChange
THISFORM.pageframe1.page3.cboField2.Enabled =.T.
THISFORM.pageframe1.page3.cboRelation2.Enabled =.T.
THISFORM.pageframe1.page3.txtValue2.Enabled =.T.
Form1.PageFrame1.Page3.opgOperand2. InteractiveChange
THISFORM.pageframe1.page3.cboField3.Enabled =.T.
THISFORM.pageframe1.page3.cboRelation3.Enabled =.T.
THISFORM.pageframe1.page3.txtValue3.Enabled =.T.
Form1.PageFrame1.Page3.cmdExecute.Click
LOCAL lcOldAlias
lcOldAlias = ALIAS()
cMacro = ALLTRIM(THISFORM.DataSql) + "INTO CURSOR TEMPQUERY"
&cMacro
IF _TALLY = 0
#DEFINE MSG_LOC "No records were found to match the criteria you specified."
#DEFINE TITLE_LOC "No Results"
=MESSAGEBOX(MSG_LOC,64+0+0,TITLE_LOC)
BROWSE NORMAL TITLE SUBSTR(THISFORM.DataSql, AT("WHERE",THISFORM.DataSql)+ 6)
IF USED("TEMPQUERY")
USE IN TEMPQUERY
IF USED(lcOldAlias)
SELECT (lcOldAlias)
Form1.PageFrame1.Page3.cmdClear.Click
THISFORM.ClearSQL
Form1.FormExit.Click
thisform.release
Main Menu
LPARAMETERS oFormRef, getMenuName, lUniquePopups, parm4, parm5, parm6, parm7, parm8, parm9
LOCAL cMenuName, nTotPops, a_menupops, cTypeParm2, cSaveFormName
IF TYPE("m.oFormRef") # "O" OR;
LOWER(m.oFormRef.BaseClass) # 'form' OR;
m.oFormRef.ShowWindow # 2
MESSAGEBOX([This menu can only be called from a Top-Level form. Ensure that your form's ShowWindow property is set to 2. Read the header section of the menu's MPR file for more details.])
RETURN
m.cTypeParm2 = TYPE("m.getMenuName")
m.cMenuName = SYS(2015)
m.cSaveFormName = m.oFormRef.Name
IF m.cTypeParm2 = "C" OR (m.cTypeParm2 = "L" AND m.getMenuName)
m.oFormRef.Name = m.cMenuName
IF m.cTypeParm2 = "C" AND!EMPTY(m.getMenuName)
m.cMenuName = m.getMenuName
DIMENSION a_menupops[3]
IF TYPE("m.lUniquePopups")="L" AND m.lUniquePopups
FOR nTotPops = 1 TO ALEN(a_menupops)
a_menupops[m.nTotPops]= SYS(2015)
ENDFOR
a_menupops[1]="file"
a_menupops[2]="edit"
a_menupops[3]="help"
LOCAL lHasNewMenu
lHasNewMenu = (TYPE("CNTPAD(m.cMenuName)") # "N")
IF m.lHasNewMenu
DEFINE MENU (m.cMenuName) IN (m.oFormRef.Name) BAR
DEFINE PAD _03s1d879u OF (m.cMenuName) PROMPT "\<File" COLOR SCHEME 3;
KEY ALT+F, ""
DEFINE PAD _03s1d879v OF (m.cMenuName) PROMPT "\<Edit" COLOR SCHEME 3;
KEY ALT+E, ""
DEFINE PAD _03s1d879w OF (m.cMenuName) PROMPT "\<Query" COLOR SCHEME 3;
KEY ALT+Q, ""
DEFINE PAD _03s1d879x OF (m.cMenuName) PROMPT "\<Help" COLOR SCHEME 3;
KEY ALT+H, ""
ON PAD _03s1d879u OF (m.cMenuName) ACTIVATE POPUP (a_menupops[1])
ON PAD _03s1d879v OF (m.cMenuName) ACTIVATE POPUP (a_menupops[2])
ON SELECTION PAD _03s1d879w OF (m.cMenuName);
DO _03s1d879z;
IN LOCFILE("MY\MENU1","MPX;MPR|FXP;PRG","WHERE is MENU1?")
ON PAD _03s1d879x OF (m.cMenuName) ACTIVATE POPUP (a_menupops[3])
DEFINE POPUP (a_menupops[1]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[1]) PROMPT "\<Quit";
MESSAGE "Выход из программы"
ON SELECTION BAR 1 OF (a_menupops[1]);
DO _03s1d87a4;
DEFINE POPUP (a_menupops[2]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[2]) PROMPT "\<Add record"
DEFINE BAR 2 OF (a_menupops[2]) PROMPT "\<Delete record"
DEFINE BAR 3 OF (a_menupops[2]) PROMPT "\<Edit record"
ON SELECTION BAR 1 OF (a_menupops[2]);
DO _03s1d87a6;
ON SELECTION BAR 2 OF (a_menupops[2]);
DO _03s1d87a8;
ON SELECTION BAR 3 OF (a_menupops[2]);
DO _03s1d87aa;
DEFINE POPUP (a_menupops[3]) MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF (a_menupops[3]) PROMPT "\<About"
ON SELECTION BAR 1 OF (a_menupops[3]);
DO _03s1d87ac;
ACTIVATE MENU (m.cMenuName) NOWAIT
IF m.cTypeParm2 = "C"
m.getMenuName = m.cMenuName
m.oFormRef.Name = m.cSaveFormName
PROCEDURE _03s1d879z
mainform.pageframe1.Activepage = 3
PROCEDURE _03s1d87a4
mainform.release
PROCEDURE _03s1d87a6
mainform.pageframe1.Activepage = 2
mainform.pageframe1.page2.commandgroup1.command4.Click()
PROCEDURE _03s1d87a8
mainform.pageframe1.page2.commandgroup1.command5.Click(PROCEDURE _03s1d87aa
mainform.pageframe1.page2.commandgroup1.command3.Click
PROCEDURE _03s1d87ac
do form Fabout.scx
Страницы: 1, 2, 3, 4, 5, 6