123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606 |
- <?xml version="1.0" encoding="utf-8" ?>
- <Forms>
- <Form Name="FrmLocation">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="仓库库位设置";
- GetSchema();
- ]]>
- </Load>
- <EndLoad>
- <![CDATA[
- ChangeMode("Search");
- ]]>
- </EndLoad>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- <New>
- <Lable name="New" />
- </New>
- <View>
- <Lable name="View" />
- </View>
- <Modify>
- <Lable name="Modify" />
- </Modify>
- </Mode>
- <Controls>
- <IKTextButton name="tbNo" DataSource="Location.No_Location">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchLocationWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- else
- {
- if(GetRight(@Title,"新增"))
- ChangeMode("New");
- else
- MessageBox("您没有新增仓库库位设置的权限!",@Title);
- }
- }
- else
- {
- MessageBox("请输入库位编号!",@Title);
- }
- }
- ]]>
- </Enter>
- <Click>
- @Temp = ShowSearchBox("LocationSearch","INFOMATION");
- if(@Temp != StringEmpty())
- {
- tbNo.CValue = @Temp;
- UpdateForm(false, "");
- if(Search("SearchLocationWithNo", tbNo.CValue))
- {
- ChangeMode("View");
- }
- }
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtName" DataSource="Location.Name_Location"/>
- <IKComboBoxEx name="cbSubjection" ValueSource="Location.SubjectionID_Location" DisplaySource="Location.SubDepot" NoSource="Location.No_SubLocation"
- DataSource="AllLocation" ValueMember="ID_Location" DisplayMember="Name_Location" NoMember="No_Location">
- <Events>
- <Reload>
- UpdateForm(false, "cbSubjection");
- Search("SearchAllLocation");
- UpdateForm(true, "cbSubjection");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtCreator" DataSource="Location.CreateName"/><!--Declare-->
- <IKDateTimeText name="dttCreateDate" DataSource="Location.CreateDate_Location"/>
- <IKTextBox name="txtComment" DataSource="Location.Comment_Location"/>
-
- <IKTextBox name="txtMender" DataSource="Location.LastModUser_LocationName"></IKTextBox>
- <IKDateTimeText name="dttMendeDate" DataSource="Location.LastModDate_Location"></IKDateTimeText>
-
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchLocationFirst", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchLocationPrevious", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchLocationNext", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchLocationLast", tbNo.CValue))
- {
- ChangeMode("View");
- }
- </ClickLast>
- <ClickNew>
- ;
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- </ClickModify>
- <ClickDelete>
- if(Search("SearchSubLocation", tbNo.CValue))
- {
- if(MessageBox("该库位有下属库位,若删除此库位资料其所有下属库位的资料均会被删除,确定要删除此库位资料吗?",@Title,MB_YESNO)==DialogResult("YES"))
- {
- Delete(); ChangeMode("Search");
- }
- }
- else
- {
- Delete(); ChangeMode("Search");
- }
- </ClickDelete>
- <ClickPrint>
- PrintReport();
- </ClickPrint>
- <ClickAudit>
- ;
- </ClickAudit>
- <ClickUnAudit>
- ;
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- if(toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- <IKHiberaTree name="LocationTree" DisplayMember="Name_Location" ValueMember="ID_Location" NoMember="No_Location" SubjectValueMember="SubjectionID_Location" DataSource="treeDep">
- <Events>
- <DoubleClick>
- if( !Equals(LocationTree.SelectNodeNo, tbNo.CValue) )
- {
- ChangeMode("Search");
- tbNo.CValue = LocationTree.SelectNodeNo;
- ActiveControlEvent("tbNo", "Enter");
- }
- </DoubleClick>
- <RightClickItem>
- ;
- </RightClickItem>
- </Events>
- </IKHiberaTree>
- </Controls>
- <Tables>
- ;<!--TODO-->
- </Tables>
- <LockInfomation LockID="ID_Location" LockNO="No_Location" LockSearchFunction="SearchLocationWithNo"/>
- <ChildForms>
- <ChildForm name="LocationSearch" DataSource="Location" SearchFunction="SearchAllLocationofsub" SearchFunctionByNo="SearchLocationWithNo" MappingName="仓库">
- <DataColumn Index="0" MappingName="#Location.No_Location" HeaderText="仓库编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Location.Name_Location" HeaderText="仓库名称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- </Client>
- <Server>
- <Tables>
- <Table name="Location" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 A.*,B.Name_Location AS SubDepot,Y.Name_User as LastModUser_LocationName, B.No_Location as No_SubLocation,U.Name_User AS CreateName FROM Location A
- LEFT JOIN Location B ON A.SubjectionID_Location = B.ID_Location
- LEFT JOIN AppUser U ON A.ID_Creator = U.ID_User
- LEFT JOIN AppUser Y ON A.LastModUser_Location = Y.ID_User">
- </GetSchema>
- <New CmdType="Text" CmdText="
- IF(Exists(SELECT * FROM Location WHERE ID_Location=@SubjectionID_Location))
- BEGIN
- SELECT @ID_Warehouse=ID_Warehouse, @Level_Location=Level_Location+1 FROM Location WHERE ID_Location=@SubjectionID_Location
- END
- ELSE
- BEGIN
- SET @ID_Warehouse=@ID_Location
- SET @Level_Location=0
- END
- DECLARE @LocationLevel_SystemSetting INT
- SELECT @LocationLevel_SystemSetting=LocationLevel_SystemSetting FROM SystemSetting
- IF(@LocationLevel_SystemSetting=@Level_Location)
- SET @LowestLevel_Location=1
- ELSE
- SET @LowestLevel_Location=0
- INSERT INTO Location (ID_Location, No_Location, Name_Location, SubjectionID_Location, Level_Location, LowestLevel_Location, ID_Creator, CreateDate_Location, Comment_Location, SuspendDate_Location, ID_Warehouse,LastModUser_Location,LastModDate_Location)
- VALUES(@ID_Location, @No_Location, @Name_Location, @SubjectionID_Location, @Level_Location, @LowestLevel_Location, @ID_Creator, @CreateDate_Location, @Comment_Location, @SuspendDate_Location, @ID_Warehouse,@LastModUser_Location,@LastModDate_Location)">
- <Params>
- <Param name="@ID_Location" type="Location.ID_Location" sourceColumn="ID_Location" />
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- <Param name="@Name_Location" type="Location.Name_Location" sourceColumn="Name_Location" />
- <Param name="@SubjectionID_Location" type="Location.SubjectionID_Location" sourceColumn="SubjectionID_Location" />
- <Param name="@Level_Location" type="Location.Level_Location" sourceColumn="Level_Location" />
- <Param name="@LowestLevel_Location" type="Location.LowestLevel_Location" sourceColumn="LowestLevel_Location" />
- <Param name="@ID_Creator" type="Location.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_Location" type="Location.CreateDate_Location" sourceColumn="CreateDate_Location" />
- <Param name="@Comment_Location" type="Location.Comment_Location" sourceColumn="Comment_Location" />
- <Param name="@SuspendDate_Location" type="Location.SuspendDate_Location" sourceColumn="SuspendDate_Location" />
- <Param name="@ID_Warehouse" type="Location.ID_Warehouse" sourceColumn="ID_Warehouse" />
-
- <Param name="@LastModUser_Location" type="Location.LastModUser_Location" sourceColumn="LastModUser_Location" />
- <Param name="@LastModDate_Location" type="Location.LastModDate_Location" sourceColumn="LastModDate_Location" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE Location SET
- Name_Location=@Name_Location,
- ID_Creator=@ID_Creator,
- CreateDate_Location=@CreateDate_Location,
- Comment_Location=@Comment_Location,
- SuspendDate_Location=@SuspendDate_Location,
- ID_Warehouse=@ID_Warehouse,
- LastModDate_Location=@LastModDate_Location,
- LastModUser_Location=@LastModUser_Location
- WHERE ID_Location=@ID_Location">
- <Params>
- <Param name="@ID_Location" type="Location.ID_Location" sourceColumn="ID_Location" />
- <Param name="@Name_Location" type="Location.Name_Location" sourceColumn="Name_Location" />
- <Param name="@ID_Creator" type="Location.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_Location" type="Location.CreateDate_Location" sourceColumn="CreateDate_Location" />
- <Param name="@Comment_Location" type="Location.Comment_Location" sourceColumn="Comment_Location" />
- <Param name="@SuspendDate_Location" type="Location.SuspendDate_Location" sourceColumn="SuspendDate_Location" />
- <Param name="@ID_Warehouse" type="Location.ID_Warehouse" sourceColumn="ID_Warehouse" />
- <Param name="@LastModDate_Location" type="Location.LastModDate_Location" sourceColumn="LastModDate_Location" />
- <Param name="@LastModUser_Location" type="Location.LastModUser_Location" sourceColumn="LastModUser_Location" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="IF Object_ID(N'tempdb..#DELETE') IS Not NULL
- DROP TABLE #DELETE
- CREATE TABLE #DELETE
- (
- ID_DELETE UNIQUEIDENTIFIER,
- LEV_DELETE INT
- )
-
- DECLARE @ID_LOC UNIQUEIDENTIFIER
- DECLARE @LEV INT
- DECLARE @TEMPLEV INT
- DECLARE @STR NVARCHAR(100)
- DECLARE @COUNTS INT
- DECLARE @COUNT INT
- SELECT @ID_LOC = A.ID_LOCATION,@LEV = A.LEVEL_LOCATION FROM LOCATION A
- LEFT JOIN LOCATION B ON A.ID_LOCATION = B.SUBJECTIONID_LOCATION
- WHERE A.ID_LOCATION = @ID_Location
- SET @STR = N'INSERT INTO #DELETE VALUES(@TID_LOC,@TLEV)'
- EXECUTE sp_executesql @STR,N'@TID_LOC UNIQUEIDENTIFIER,@TLEV INT',@ID_LOC,@LEV
- DECLARE CUR CURSOR FOR SELECT B.ID_LOCATION ,B.LEVEL_LOCATION FROM LOCATION A
- INNER JOIN LOCATION B ON A.ID_LOCATION = B.SUBJECTIONID_LOCATION
- WHERE A.ID_LOCATION = @ID_Location
- OPEN CUR
- FETCH NEXT FROM CUR INTO @ID_LOC,@LEV
- WHILE @@FETCH_STATUS = 0
- BEGIN
- SET @STR = N'INSERT INTO #DELETE VALUES(@TID_LOC,@TLEV)'
- EXECUTE sp_executesql @STR,N'@TID_LOC UNIQUEIDENTIFIER,@TLEV INT',@ID_LOC,@LEV
- FETCH NEXT FROM CUR INTO @ID_LOC,@LEV
- END
- CLOSE CUR
- DEALLOCATE CUR
- SET @TEMPLEV = @LEV
- SELECT @COUNTS = COUNT(*) FROM (SELECT * FROM #DELETE WHERE LEV_DELETE = @TEMPLEV) COUNTS
- WHILE @COUNTS > 0
- BEGIN
- DECLARE CUR CURSOR FOR SELECT L.ID_LOCATION,L.LEVEL_LOCATION FROM #DELETE T
- INNER JOIN LOCATION L ON T.ID_DELETE = L.SUBJECTIONID_LOCATION
- WHERE T.LEV_DELETE = @TEMPLEV
- OPEN CUR
- FETCH NEXT FROM CUR INTO @ID_LOC,@LEV
- WHILE @@FETCH_STATUS = 0
- BEGIN
- SET @STR = N'INSERT INTO #DELETE VALUES(@TID_LOC,@TLEV)'
- EXECUTE sp_executesql @STR,N'@TID_LOC UNIQUEIDENTIFIER,@TLEV INT',@ID_LOC,@LEV
- FETCH NEXT FROM CUR INTO @ID_LOC,@LEV
- END
- CLOSE CUR
- DEALLOCATE CUR
- SET @TEMPLEV = @TEMPLEV + 1
- SELECT @COUNTS = COUNT(*) FROM (SELECT * FROM #DELETE WHERE LEV_DELETE = @TEMPLEV) COUNTS
- END
- SELECT @COUNTS = COUNT(*) FROM #DELETE
- DECLARE CUR CURSOR FOR SELECT ID_DELETE FROM #DELETE ORDER BY LEV_DELETE DESC
- OPEN CUR
- FETCH NEXT FROM CUR INTO @ID_LOC
- WHILE @@FETCH_STATUS = 0
- BEGIN
- IF @COUNTS != 1
- BEGIN
- SELECT @COUNT=COUNT(*) FROM LockInfoTable WHERE LockInfoTable.RecordID_LockInfoTable = @ID_LOC
- IF @COUNT != 0
- BEGIN
- CLOSE CUR
- DEALLOCATE CUR
- DROP TABLE #DELETE
- RAISERROR('子库位正在被使用,无法执行删除操作!',18,1)
- RETURN
- END
- INSERT INTO LockInfoTable (RecordID_LockInfoTable,Funcode_LockInfoTable,LoginID_LockInfoTable,UserID_LockInfoTable) VALUES (@ID_LOC,'FrmLocation',NEWID(),NEWID())
- SET @COUNTS = @COUNTS-1
- END
- DECLARE @COU DEC(14,4) SELECT @COU = sum(isnull(AvailableQty_ProductStocks,0)) FROM ProductStocks
- WHERE ProductStocks.ID_Location=@ID_LOC
- IF @COU > 0
- BEGIN
- CLOSE CUR
- DEALLOCATE CUR
- DROP TABLE #DELETE
- RAISERROR('该库位已存在库存,无法删除!',18,19)
- RETURN
- END
- DELETE FROM ProductStocks WHERE ProductStocks.ID_Location=@ID_LOC
- DELETE FROM LOCATION WHERE LOCATION.ID_LOCATION = @ID_LOC
- DELETE FROM LockInfoTable WHERE LockInfoTable.RecordID_LockInfoTable = @ID_LOC AND LockInfoTable.Funcode_LockInfoTable = 'FrmLocation'
- FETCH NEXT FROM CUR INTO @ID_LOC
- END
- CLOSE CUR
- DEALLOCATE CUR
- DROP TABLE #DELETE">
- <Params>
- <Param name="@ID_Location" type="Location.ID_Location" sourceColumn="ID_Location" />
- </Params>
- </Delete>
- <FKErrorReport ErrorMessage="该库位已被引用,删除失败!"/>
- <UNIQUEErrorReport ErrorMessage="该库位编号或名称已存在,提交失败!"/>
- </Table>
- </Tables>
- <Search>
- <SearchAllLocationofsub CmdType="Text" CmdText="SELECT Location.No_Location,Location.Name_Location FROM Location ">
- <Tables>
- <Table name="Alldepartment" />
- </Tables>
- </SearchAllLocationofsub>
- <SearchTree CmdType="Text" CmdText="Select ID_Location,No_Location,'('+No_Location+')'+Name_Location As Name_Location, SubjectionID_Location From Location">
- <Tables>
- <Table name="treeDep" />
- </Tables>
- </SearchTree>
- <SearchLocationWithNo CmdType="Text" CmdText=" SELECT A.*,B.Name_Location AS SubDepot,Y.Name_User as LastModUser_LocationName, B.No_Location as No_SubLocation,U.Name_User AS CreateName FROM Location A
- LEFT JOIN Location B ON A.SubjectionID_Location = B.ID_Location
- LEFT JOIN AppUser U ON A.ID_Creator = U.ID_User
- LEFT JOIN AppUser Y ON A.LastModUser_Location = Y.ID_User
- WHERE A.No_Location = @No_Location">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocationWithNo>
- <SearchAllLocation CmdType="Text" CmdText="SELECT A.ID_Location,A.Name_Location,A.No_Location FROM Location A order by No_Location ">
- <Tables>
- <Table name="AllLocation"/>
- </Tables>
- </SearchAllLocation>
- <SearchCurrentLocationLevel CmdType="Text" CmdText="SELECT Level_Location FROM Location Where Location.ID_Location = @ID_Location">
- <Params>
- <Param name="@ID_Location" type="Location.ID_Location" sourceColumn="ID_Location" />
- </Params>
- <Tables>
- <Table name="LocationLevel"/>
- </Tables>
- </SearchCurrentLocationLevel>
- <SearchLocationLevel CmdType="Text" CmdText="SELECT LocationLevel_SystemSetting FROM SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchLocationLevel>
- <SearchLocationFirst CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Location
- SELECT TOP 1 @NextNo = Location.No_Location FROM Location ORDER BY Location.No_Location
- SELECT A.*,B.Name_Location AS SubDepot,Y.Name_User as LastModUser_LocationName, B.No_Location as No_SubLocation,U.Name_User AS CreateName FROM Location A
- LEFT JOIN Location B ON A.SubjectionID_Location = B.ID_Location
- LEFT JOIN AppUser U ON A.ID_Creator = U.ID_User
- LEFT JOIN AppUser Y ON A.LastModUser_Location = Y.ID_User
- WHERE A.No_Location = @NextNo">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocationFirst>
- <SearchLocationPrevious CmdType="Text" CmdText="DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Location
- SELECT TOP 1 @NextNo = Location.No_Location FROM Location WHERE Location.No_Location < @No_Location ORDER BY Location.No_Location Desc
- SELECT A.*,B.Name_Location AS SubDepot,Y.Name_User as LastModUser_LocationName, B.No_Location as No_SubLocation,U.Name_User AS CreateName FROM Location A
- LEFT JOIN Location B ON A.SubjectionID_Location = B.ID_Location
- LEFT JOIN AppUser U ON A.ID_Creator = U.ID_User
- LEFT JOIN AppUser Y ON A.LastModUser_Location = Y.ID_User
- WHERE A.No_Location = @NextNo">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocationPrevious>
- <SearchLocationNext CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Location
- SELECT TOP 1 @NextNo = Location.No_Location FROM Location WHERE Location.No_Location > @No_Location ORDER BY Location.No_Location
- SELECT A.*,B.Name_Location AS SubDepot,Y.Name_User as LastModUser_LocationName, B.No_Location as No_SubLocation,U.Name_User AS CreateName FROM Location A
- LEFT JOIN Location B ON A.SubjectionID_Location = B.ID_Location
- LEFT JOIN AppUser U ON A.ID_Creator = U.ID_User
- LEFT JOIN AppUser Y ON A.LastModUser_Location = Y.ID_User
- WHERE A.No_Location = @NextNo">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocationNext>
- <SearchLocationLast CmdType="Text" CmdText=" DECLARE @NextNo nvarchar(64)
- SET @NextNo = @No_Location
- SELECT TOP 1 @NextNo = Location.No_Location FROM Location ORDER BY Location.No_Location DESC
- SELECT A.*,B.Name_Location AS SubDepot,Y.Name_User as LastModUser_LocationName, B.No_Location as No_SubLocation,U.Name_User AS CreateName FROM Location A
- LEFT JOIN Location B ON A.SubjectionID_Location = B.ID_Location
- LEFT JOIN AppUser U ON A.ID_Creator = U.ID_User
- LEFT JOIN AppUser Y ON A.LastModUser_Location = Y.ID_User
- WHERE A.No_Location = @NextNo">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocationLast>
- <SearchSubLocation CmdType="Text" CmdText="SELECT * FROM location A
- INNER JOIN Location B ON A.ID_Location = B.SubjectionID_Location
- WHERE A.No_Location = @No_Location">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="LocationSub" />
- </Tables>
- </SearchSubLocation>
- <SearchLevelByName CmdType="Text" CmdText="SELECT Level_Location,ID_Warehouse , LocationLevel_SystemSetting FROM Location,SystemSetting WHERE No_Location = @No_Location">
- <Params>
- <Param name="@No_Location" type="Location.No_Location" sourceColumn="No_Location" />
- </Params>
- <Tables>
- <Table name="LocationLevelByName" />
- </Tables>
- </SearchLevelByName>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- txtComment.ReadOnly=true;
- cbSubjection.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- #Location.CreateDate_Location=DBNull();
- #Location.LastModDate_Location=DBNull();
- #Location.LastModUser_Location=DBNull();
- <!--Search("SearchTree");-->
- UpdateForm(true, "");
- tbNo.Focus();
- @Status=0;
- </Search>
- <New>
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- txtComment.ReadOnly=false;
- cbSubjection.Enabled=true;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnablePrint=false;
- #Location.SubjectionID_Location=DBNull();
- #Location.ID_Location=NewGuid();
- #Location.No_Location=tbNo.CValue;
- #Location.CreateName=GetCurrentUser();
- #Location.ID_Creator=GetLoginUserID();
- #Location.CreateDate_Location=DateTimeNow();
- #Location.LastModDate_Location=DBNull();
- #Location.LastModUser_Location=DBNull();
- #Location.SuspendDate_Location=DBNull();
- <!--Search("SearchTree");-->
- UpdateForm(true, "");
- <!--LocationTree.SetCurrentNode("("+tbNo.CValue+")"+txtName.CValue);-->
- txtName.Focus();
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=false;
- txtName.ReadOnly=true;
- txtComment.ReadOnly=true;
- cbSubjection.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnablePrint=GetRight(@Title,"打印");
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- <!--Search("SearchTree");-->
- UpdateForm(true, "");
- <!--LocationTree.SetCurrentNode("("+tbNo.CValue+")"+txtName.CValue);-->
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- txtName.ReadOnly=false;
- txtComment.ReadOnly=false;
- cbSubjection.Enabled=false;
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnablePrint=false;
- #Location.LastModDate_Location=DateTimeNow();
- #Location.LastModUser_Location=GetLoginUserID();
- #Location.LastModUser_LocationName=GetCurrentUser();
- <!--Search("SearchTree");-->
- UpdateForm(true, "");
- <!--LocationTree.SetCurrentNode("("+tbNo.CValue+")"+txtName.CValue);-->
- txtName.Focus();
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(txtName.CValue==StringEmpty())
- {
- MessageBox("请输入库位名称!",@Title);
- txtName.Focus();
- return;
- }
- if(!cbSubjection.CheckSelectedItem())
- {
- MessageBox("请选择有效的隶属库位!",@Title);
- cbSubjection.Focus();
- return;
- }
- UpdateForm(false, "");
- if(cbSubjection.SelectedNo != "")
- {
- Search("SearchLevelByName", cbSubjection.SelectedNo);
- if(#LocationLevelByName.Level_Location >= #LocationLevelByName.LocationLevel_SystemSetting)
- {
- if(MessageBox("库位级别超出系统启用设置中的级别确定要提交吗?",@Title,MB_YESNO) ==DialogResult("NO"))
- return;
- }
- }
- if(@Status==1)
- {
- New();
- }
- if(@Status == 3)
- {
- #Location.LastModDate_Location=DateTimeNow();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- </Lables>
- </Form>
- </Forms>
|