XML

Fatih Şahin - Jan 15 - - Dev Community

SQL BEGIN

<cell colspan="2">
<control FieldName="ZZClientExecSQL1" ControlType="Button" Caption="Eşleme Verileri Yenile" ControlEditEnabled="False" Width="150">
<ClientSideEvents Click="function (s,e) {ClientExecSQL('BEGIN
  DELETE FROM ZZZT_INVOICE_PAID;
  COMMIT;
  INSERT INTO ZZZT_INVOICE_PAID
  SELECT * FROM ZZZW_INVOICE_PAID2;
  COMMIT;
END;',
function (p) {alert('İşlem Başarılı.✅')}
)
}"></ClientSideEvents> 
</control>
</cell>
Enter fullscreen mode Exit fullscreen mode

MoveColumn, Grid Kolon Ayarlama

<MoveColumn FieldName="ItemAttributeCode1"/><MoveColumn FieldName="LotCode"/><MoveColumn FieldName="Qty"/>
Enter fullscreen mode Exit fullscreen mode

Endless Paging - Alt + M Sonsuz Veri Sayfalama ve Kaydırma

Settings-ShowGroupPanel=False;SettingsBehavior-AllowSort=True;Settings-ShowFilterRow=True;SettingsPager-Mode=EndlessPaging;Settings-VerticalScrollableHeight=600
Enter fullscreen mode Exit fullscreen mode

XML FilterValues LIKE

Filter="ItemCode=@ItemCode" FilterValues="@ItemCode%=00 7"
Enter fullscreen mode Exit fullscreen mode

Image description

        <GridColumn FieldName="ItemCode" Caption="Stok Kodu" ControlType="ButtonEdit">
        <DataSource SourceType="Command" Source="ItemCollection.Show" ProcessTypeMode="1" ReturnProperties="Id;ItemCode;ItemName" ReturnedProperties="ItemId;ItemCode;ItemName" Filter="ItemCode=@ItemCode" FilterValues="@ItemCode%=00 7">
        </DataSource>
        </GridColumn>
Enter fullscreen mode Exit fullscreen mode

XML Warning

<cell colspan="1">
 <control FieldName="lblWarning" Caption=" *Sadece Bugüne Ait Üretim Hareketleri Listelenir." Width="900" ControlType="Label" ServerAttribute="ForeColor=Red;Font-Size=8;Font-Bold=True"></control>
</cell>
Enter fullscreen mode Exit fullscreen mode

ServerAttribute

ServerAttribute="Font-Bold=True;Font-Size=15;ForeColor=Green;BackColor=#d5f5e3"

Font-Bold=True;Font-Size=10;Image-Url=~/images/ButtonIco/icons8-save-close-24.png
Enter fullscreen mode Exit fullscreen mode

GetUrlParam('ObjectId')

function IscardAcc1()
{
ClientExecSQL('UPDATE FIND_CARD_INTG SET ISCARD_ACC = 1 WHERE CARD_INTG_ID=@Id::integer',
function (p) {
alert('İşlem Başarılı.');location.reload();
},
GetUrlParam('ObjectId'),
)
}
Enter fullscreen mode Exit fullscreen mode

SetControlValue

SetControlValue('SourceApp','Fatura')
function zNote1() {
var zNote1= GetControlValue('ItemAccIntgDesc'); SetControlValue('Description',zNote1);
}

GetControl('OrderDCollection').GetEditor('UnitPriceTra').SetEnabled(false);
Enter fullscreen mode Exit fullscreen mode

XML Source Dynamic Parameter

<row>
<cell>
<control FieldName="Note3" MaxLength="100" ControlType="ButtonEdit" Caption="Açıklama3" Width="330" Incomplate="True">
<DataSource FilterValues="@DynamicParameterId=5" Source="DynamicParameterDCollection.Show" ReturnedProperties="Note3" ReturnProperties="Note1" Filter="DynamicParameterId=@DynamicParameterId" ListPropertyName="Note1"/>
</control>
</cell>
</row>
Enter fullscreen mode Exit fullscreen mode

Mainlist Yazdır

function OpenReport()
{
var accMId=myListPage.GetRowKey(myListPage.GetFocusedRowIndex());
var prmKeys = ["CurrentIdentity", "AccMId"];
var prmValues = ["12345",accMId];
OpenReportPDF('1547', prmKeys, prmValues);
}
Enter fullscreen mode Exit fullscreen mode

Image description

Yazdır Buton

<cell colspan="3">
<control FieldName="FieldName2"
ControlType="Button"
CaptionVisible="True"
ToolTip="Irsaliye"
Caption="Ap İrsaliye Yazdır"
Width="25" Height="25"

CustomAttribute="onmouseover=BiggerImage(this, event, 'Kimlik Bilgileri')"
ServerAttribute="Image-Url=https://gallery.mailchimp.com/754a5064cb12ce106fca9e2c7/images/d5269d56-0049-4421-91f2-67d5886edfe7.png">
<ClientSideEvents Click="function(s, e) {
var offerId =GetControlValue('Id');
var prmKeys = ['CurrentIdentity', 'ItemMId'];
var prmValues = ['12345',offerId];

OpenReportPDF('11000145', prmKeys, prmValues);

}"/>
</control>
</cell>
Enter fullscreen mode Exit fullscreen mode

Image description

MultiSet

<GridColumn FieldName="ZZInvoiceMId" ControlType="ButtonEdit" Caption="Fatura Id (Ödemesi Gerçekleşen)">
<DataSource SourceType="Command" 
Source="ZZZFinInvoicePayCollection.Show" 
Filter="EntityId=@EntityId" 
FilterValues="@EntityId=GetColumnValue(FinDcardId)"
ReturnProperties="Id;Description"
ReturnedProperties="ZZInvoiceMId"
ListPropertyName="Id"
ProcessTypeMode="2"
CustomReturnJs="MultiSet">
</DataSource>
</GridColumn>
Enter fullscreen mode Exit fullscreen mode

XML if (GetControlValue

<root MainCode="" Caption="Kredi ve Ödeme Listesi">
<script ScriptCode="
AddLoadList('FirstLoad()');

        FirstLoad=function()
        {
            GetControl('pDocDateL').SetVisible(false);
        } 

"></script>
    <tabcontrol Visibility="True">
        <tabpage Caption="Kriterler">
            <section Caption="" CaptionVisibility="False" Visibility="True" ColumnCount="6">
                <row>
                    <cell colspan="2">
                        <control FieldName="CoCode" ControlType="ButtonEdit" Caption="Firma" DefaultValue="Session(CoCode)" ControlRequired="True">
                            <DataSource SourceType="Command" Source="CompanyCollection.Show" Filter="" FilterValues="" OrderByProperty="" ReturnProperties="CoCode" ReturnedProperties="CoCode" RelatedProperty="" ProcessTypeMode="1" ListPropertyName="CoCode"></DataSource>
                        </control>
                    </cell>
                </row>

                <row>
                    <cell colspan="1">
                        <control FieldName = "Yerlesim" 
                     ControlType = "ComboEdit" 
                     ControlEnabled="True" 
                     DefaultValue="Ödenecek" 
                     MaxLength = "50" 
                     ControlRequired = "True" 
                     Caption = "Liste Tipi" 
                     ControlVisible="True">
                            <DataSource  SourceType="TextAndValue" Text="Ödenecek;Ödenen;Reel Kur" Value="Ödenecek;Ödenen;Reel Kur"></DataSource>
                                          <ClientSideEvents ValueChanged="function(s,e)
                                                { 
                                                    if (GetControlValue('Yerlesim') == 'Ödenen')
                                                    {
                                                        GetControl('pDocDateL').SetVisible(true);
                                                    }
                                                    else if (GetControlValue('Yerlesim') == 'Reel Kur')
                                                    {
                                                        GetControl('pDocDateL').SetVisible(true);
                                                    }
                                                     else 

                                                     {
                                                     GetControl('pDocDateL').SetVisible(false);
                                                     }

                                                }">
                </ClientSideEvents>
                        </control>
                    </cell>
                </row>

                <row>
                    <cell colspan="2">
                        <control FieldName="pDocDateF" ControlType="DateEdit" ControlRequired="True" Caption="Tarih" ControlEnabled="true" DefaultValue=""></control>
                    </cell>
            <cell colspan="1">
            <control FieldName="pDocDateL" ControlType="DateEdit" CaptionVisible="False" DefaultValue="">
            </control>
            </cell>
                </row>


            </section>
        </tabpage>
    </tabcontrol>
</root>
Enter fullscreen mode Exit fullscreen mode

Button Zorunlu Alan Mesajı
control
ClientSideEvents
Click

function (s,e)
{
    var resultValidation = ASPxClientEdit.ValidateGroup('valid1', true);

    if (resultValidation == false) {
        UyumMessage(LangErr.GNL.FillRequiredFields);
        return false;
    }
}
Enter fullscreen mode Exit fullscreen mode

Dinamik Pop-Up SetEnabled
function SetLoansRefNo() {
GetControl('LoansRefNo').SetEnabled(true);
}

Image description

Dinamik XML, veri alanındaki boşluğu kaldırma
<ClientSideEvents ValueCahnged="function(s, e)
{
if (s.GetValue())
{
s.SetValue(s.GetValue().trim());
}
}">
</ClientSideEvents>

<GridColumn FieldName="ZZContainerNo" ControlType="TextEdit" Caption="Konteyner No" ControlRequired="False" ControlEnabled="True" ControlVisible="True" ControlSingleLine="true" Width="150">
<ClientSideEvents ValueChanged="function(s, e) 
{
if (s.GetValue())
{
s.SetValue(s.GetValue().trim());
}
}">
</ClientSideEvents>
</GridColumn>
Enter fullscreen mode Exit fullscreen mode

Dinamik XML Button, Update

<cell colspan="2">
<control FieldName="LoansRefNoEnabled" ControlType="Button" Caption="Kredi Ref No Aktif Et" Width="150">
<ClientSideEvents Click="function(s, e) {GetControl('LoansRefNo').SetEnabled(true);}"></ClientSideEvents>
</control>
</cell>

<cell colspan="2">
<control FieldName="LoansRefNoUpdate" ControlType="Button" Caption="Kredi Ref No Değiştir" Width="150">
<ClientSideEvents Click="function fn_YeniRefNo() {

var LoansRefNo = GetControlValue('LoansRefNo');

ClientExecSQL('UPDATE FIND_LOANS_M M SET M.LOANS_REF_NO = @pLoansRefNo WHERE M.LOANS_M_ID=@Id',
function (p) {

alert('İşlem Başarılı.!');location.reload();
},
LoansRefNo,
GetControlValue('Id')
)
}"></ClientSideEvents>
</control>
</cell>

Enter fullscreen mode Exit fullscreen mode

Image description

<cell colspan="2">
<control FieldName="CommitmentClosureEnable" ControlType="Button" Caption="Alanları Aktif Et" Width="150" Height="10" ControlEditEnabled="False">
<ClientSideEvents Click="function(s, e) {GetControl('CommitmentClosureAmt').SetEnabled(true);GetControl('CommitmentClosureCurCode').SetEnabled(true);GetControl('CommitmentClosureDate').SetEnabled(true);}"></ClientSideEvents>
</control>
</cell>

<cell colspan="2">
<control FieldName="CommitmentClosureUpdate" ControlType="Button" Caption="Güncelle" Width="150">
<ClientSideEvents Click="function fn_Update() {

var pCommitmentClosureAmt = ConvertDecimalToStr(GetControlValue('CommitmentClosureAmt'));
var pCommitmentClosureCurId = GetControlValue('CommitmentClosureCurId');
var pCommitmentClosureDate = GetControlValue('CommitmentClosureDate');

ClientExecSQL('UPDATE FIND_LOANS_M M SET M.COMMITMENT_CLOSURE_AMT = @pCommitmentClosureAmt, M.COMMITMENT_CLOSURE_CUR_ID = @pCommitmentClosureCurId, M.COMMITMENT_CLOSURE_DATE = @pCommitmentClosureDate WHERE M.LOANS_M_ID=@Id',

function (p) {alert('İşlem Başarılı.!');location.reload();},
pCommitmentClosureAmt,
pCommitmentClosureCurId,
pCommitmentClosureDate,
GetControlValue('Id')
)
}"></ClientSideEvents>
</control>
</cell>
Enter fullscreen mode Exit fullscreen mode

var pCommitmentClosureAmt = ConvertDecimalToStr(GetControlValue('CommitmentClosureAmt'));

<tabpage Caption="İhracat Taahütü">
<section Visibility="false" ColumnCount="12">
<row>
<cell colspan="5">
<section Visibility="false">
<row>
<cell>
<control FieldName="ZZCommitmentClosureAmt" ControlType="SpinEdit" Caption="Taahüt Kapama Tutarı / Para Birimi" DecimalPlaces="Tutar" DefaultValue="0" CaptionSize="210"> </control>
</cell>
<cell>
<control FieldName="ZZCommitmentClosCurCode" ControlType="ButtonEdit" MaxLength="50" Width="90" Caption="Para Birimi" CaptionVisible="false">
<DataSource ReturnProperties="Id;CurCode" ReturnedProperties="ZZCommitmentClosureCurId;ZZCommitmentClosCurCode" Filter="" FilterValues="" ListPropertyName="CurCode" Source="CurrencyCollection.Show"> </DataSource>
</control>
</cell>


<cell colspan="2">
<control FieldName="CommitmentClosureEnable" ControlType="Button" Caption="Alanları Aktif Et" Width="150" Height="10" ControlEditEnabled="False">
<ClientSideEvents Click="function(s, e) {GetControl('ZZCommitmentClosureAmt').SetEnabled(true);GetControl('ZZCommitmentClosCurCode').SetEnabled(true);GetControl('ZZCommitmentClosureDate').SetEnabled(true);}"></ClientSideEvents>
</control>
</cell>

<cell colspan="2">
<control FieldName="CommitmentClosureUpdate" ControlType="Button" Caption="Güncelle" ControlEditEnabled="False" Width="150">
<ClientSideEvents Click="function fn_Update() {

var pZZCommitmentClosureAmt = ConvertDecimalToStr(GetControlValue('ZZCommitmentClosureAmt'));
var pZZCommitmentClosureCurId = GetControlValue('ZZCommitmentClosureCurId');
var pZZCommitmentClosureDate = GetControlValue('ZZCommitmentClosureDate');

ClientExecSQL('UPDATE FINT_ROTATING_LOANS M SET M.ZZ_COMMITMENT_CLOS_AMT = @pZZCommitmentClosureAmt, M.ZZ_COMMITMENT_CLOS_CUR_ID = @pZZCommitmentClosureCurId, M.ZZ_COMMITMENT_CLOS_DATE = @pZZCommitmentClosureDate WHERE M.ROTATING_LOANS_ID=@Id',

function (p) {alert('İşlem Başarılı.!');location.reload();},
pZZCommitmentClosureAmt,
pZZCommitmentClosureCurId,
pZZCommitmentClosureDate,
GetControlValue('Id')
)
}"></ClientSideEvents>
</control>
</cell>


<cell colspan="1">
<control FieldName="ZZCommitmentClosureCurId" ControlType="TextEdit" ControlVisible="false" CaptionVisible="false" ControlEnabled="false"></control>
</cell>
</row>
<row>
<cell>
<control FieldName="ZZCommitmentClosureDate" ControlType="DateEdit" Caption="Taahüt Kapama Tarihi" CaptionSize="210"> </control>
</cell>
</row>
</section>
</cell>
</row>
</section>
</tabpage>
Enter fullscreen mode Exit fullscreen mode

2 table update

<cell colspan="2">
<control FieldName="eInvoiceMIdUpdate" ControlType="Button" ControlEditEnabled="true" Caption="Güncelle" ServerAttribute="Font-Bold=True;ForeColor=Green">
<ClientSideEvents Click="function (s,e)
{
fn_update1();
function fn_update1() {
var peInvoiceMId = GetControlValue('eInvoiceMId');
ClientExecSQL('UPDATE PSMT_INVOICE_M SET E_INVOICE_M_ID = @peInvoiceMId::integer WHERE INVOICE_M_ID=@Id::integer',
function (p) {
fn_update2();
},
peInvoiceMId,
GetUrlParam('ObjectId')
)
}
function fn_update2() {
var pId = GetControlValue('Id');
var peInvoiceMId = GetControlValue('eInvoiceMId');
ClientExecSQL('UPDATE PSMT_EINVOICE_M SET INVOICE_M_ID = @pId::integer WHERE EINVOICE_M_ID=@eInvoiceMId::integer',
function (p) {
},
pId,
peInvoiceMId,
GetControlValue('Id')
)
}
}"></ClientSideEvents>
</control>
</cell>
Enter fullscreen mode Exit fullscreen mode

postgresql

<cell colspan="2">
<control FieldName="CommitmentClosureEnable" ControlType="Button" Caption="Etkinleştir" Width="150" Height="10" ControlEditEnabled="False">
<ClientSideEvents Click="function(s, e) {GetControl('CommitmentClosureAmt').SetEnabled(true);GetControl('CommitmentClosureCurCode').SetEnabled(true);GetControl('CommitmentClosureDate').SetEnabled(true);}"></ClientSideEvents>
</control>
</cell>

<cell colspan="2">
<control FieldName="CommitmentClosureUpdate" ControlType="Button" Caption="Güncelle" ControlEditEnabled="False" Width="150">
<ClientSideEvents Click="function fn_Update() {

var pCommitmentClosureAmt = GetControlValue('CommitmentClosureAmt');
var pCommitmentClosureCurId = GetControlValue('CommitmentClosureCurId');
var pCommitmentClosureDate = GetControlValue('CommitmentClosureDate');

ClientExecSQL('UPDATE FIND_LOANS_M SET COMMITMENT_CLOSURE_AMT = @pCommitmentClosureAmt::decimal, COMMITMENT_CLOSURE_CUR_ID = @pCommitmentClosureCurId::integer, COMMITMENT_CLOSURE_DATE = @pCommitmentClosureDate::date WHERE LOANS_M_ID=@Id::integer',

function (p) {alert('İşlem Başarılı.!');location.reload();},
pCommitmentClosureAmt,
pCommitmentClosureCurId,
pCommitmentClosureDate,
GetControlValue('Id')
)
}"></ClientSideEvents>
</control>
</cell>
Enter fullscreen mode Exit fullscreen mode

ClientExecProc

---
function Denemex()
{
var Id =GetUrlParam('ObjectId');
  ClientExecProc('xrpp_barcodecreate2 @pId', function (p) { alert(p+' '+Id ); }, Id );
}



function Denemex()
 {
GetControl('ItemDCollection').GetRowValues(GetControl('ItemDCollection').GetFocusedRowIndex(),'Id',Denemex1);
}
function Denemex1(Id) {

  ClientExecProc('xrpp_barcodecreate @pId', function (p) { alert(p); }, Id);
}

Enter fullscreen mode Exit fullscreen mode

Dinamik XML, Grid Update Enter

Image description

function (s,e)
  {
var pDueDay=parseInt(s.GetValue());
GetControl('ItemDCollection').GetRowValues(GetControl('ItemDCollection').GetFocusedRowIndex(),'Id;DueDay',fn_DueDay);
function fn_DueDay(values) {
pId=values[0];
ClientExecSQL('UPDATE INVT_ITEM_D A SET A.DUE_DAY = @pDueDay WHERE ITEM_D_ID=@pId',
function (p) {
alert('İşlem Başarılı.') ;
},
pDueDay,
pId,
)
}
}
Enter fullscreen mode Exit fullscreen mode

<GridColumn FieldName="DueDay" ControlType="SpinEdit" Caption="Vade Gün" > </GridColumn>

DataTemplate = True

Image description

Birden Fazla ClientExecSQL

function (s,e)
{

var pDueDay=parseInt(s.GetValue());

GetControl('ItemDCollection').GetRowValues(GetControl('ItemDCollection').GetFocusedRowIndex(),'Id;DueDay',fn_DueDay);
GetControl('ItemDCollection').GetRowValues(GetControl('ItemDCollection').GetFocusedRowIndex(),'Id;DueDay',fn_DueDayM);

function fn_DueDay(values) {
pId=values[0];
ClientExecSQL('UPDATE INVT_ITEM_D A SET A.DUE_DAY = @pDueDay WHERE ITEM_D_ID=@pId',
function (p) {

fn_DueDayM();

},
pDueDay,
pId,
)
}

function fn_DueDayM(values) {
ClientExecSQL('UPDATE INVT_ITEM_M A SET A.DUE_DAY = @pDueDay WHERE A.ITEM_M_ID IN (SELECT DD.ITEM_M_ID FROM INVT_ITEM_D DD WHERE DD.ITEM_D_ID=@pId)',
function (p) {
},
pDueDay,
pId,
)
}
alert('İşlem Başarılı.');
}
Enter fullscreen mode Exit fullscreen mode

Tarih alanı

<row>
<cell>
<control FieldName="ZZRevisionPrdDate" Caption="Revize Üretim Tarih" ControlType="DateEdit">
</control>
</cell>
<cell colspan="2">
<control FieldName="ZZRevisionPrdDateEnable" ControlType="Button" Caption="Etkinleştir" Width="150" Height="10" ControlEditEnabled="False">
<ClientSideEvents Click="function(s,e) {GetControl('ZZRevisionPrdDate').SetEnabled(true);}"></ClientSideEvents>
</control>
</cell>

<cell colspan="2">
<control FieldName="ZZRevisionPrdDateUpdate" ControlType="Button" Caption="Güncelle" ControlEditEnabled="False" Width="150">
<ClientSideEvents Click="function(s,e) {

var pZZRevisionPrdDate = GetControlValue('ZZRevisionPrdDate');

ClientExecSQL('UPDATE INVD_PACKAGE_M SET ZZ_REVISION_PRD_DATE = TO_DATE(@pZZRevisionPrdDate, @prm2) WHERE PACKAGE_ID=@Id::integer',

function (p) {alert('İşlem Başarılı.!');location.reload();},
pZZRevisionPrdDate,
'dd.mm.yyyy',
GetControlValue('Id')
)
}"></ClientSideEvents>
</control>
</cell>
</row>
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .