<div class="card">
<div class="card-header">
<h3 class="card-title">Employees Task</h3>
</div>
<div class="card-body p-0">
@{
string sql = "SELECT DISTINCT " +
"Employees.username AS UserName" +
"Employees.firstName AS FirstName," +
"Employees.Address AS Address" +
" FROM Employees" +
" WHERE " +
"Employees.UserName = ????????????"; //how to add Current User Name to this field. CurrentUserName()/
var options = new Dictionary<string, object>();
options.Add("fieldcaption", true);
options.Add("tablename", new List<string>() {"Employees"});
options.Add("tableclass", "table table-bordered table-sm");
}
@await ExecuteHtmlAsync(sql, options) @* Execute a SQL and show as HTML table *@
</div>
</div>
Hi,
…where Employees= ??? How do we add the current Username to this field? CurrentUserName()
thanks
You need to construct the SQL by yourself. It should be something like:
“Employees.UserName = '” + CurrentUserName() + “'”
//edit page//
div class="card">
<div class="card-header">
<h3 class="card-title">Employees Task</h3>
</div>
<div class="card-body p-0">
@{
string CompanyOwner=@Test_Edit.CompanyOwner.EditValue; //// Is the sentence correct?//
string sql = "SELECT DISTINCT " +
"Employees.username AS UserName" +
"Employees.firstName AS FirstName," +
"Employees.Address AS Address" +
" FROM Employees" +
" WHERE " +
"Employees.UserName = ????????????"; //how to add Company Owner to this field. "@Test_Edit.CompanyOwner.EditValue"/
var options = new Dictionary<string, object>();
options.Add("fieldcaption", true);
options.Add("tablename", new List<string>() {"Employees"});
options.Add("tableclass", "table table-bordered table-sm");
}
@await ExecuteHtmlAsync(sql, options) @* Execute a SQL and show as HTML table *@
</div>
</div>
Hi,
asp.net …where Employees= ??? How do we add the “Test_Edit.CompanyOwner.EditValue” to this field? @Test_Edit.CompanyOwner.EditValueI ran this in classic asp ok
<%
Dim yil
yil=YILLIK_IZIN_MUTABAKAT.YIL.EditValue
Dim sql
sql = "SELECT DISTINCT " & _
"KULLANILAN_IZIN.SICIL AS SICIL," & _
"KULLANILAN_IZIN.IZIN_KODU AS KOD," & _
"KULLANILAN_IZIN.CIKIS_TARIHI AS TARIH," & _
"KULLANILAN_IZIN.GUN AS GUN," & _
"KULLANILAN_IZIN.STATU AS STATU" & _
" FROM KULLANILAN_IZIN" & _
" WHERE " & _
" KULLANILAN_IZIN.SICIL='" + CurrentUserName() + "'" & _
" AND " & _
" DATEPART(YY,CIKIS_TARIHI)='"& yil &"'"
' Get result in HTML table
' options: 0:fieldcaption(bool|array), 1:horizontal(bool), 2:tablename(string|array), 3:tableclass(string)
Response.Write dbh.ExecuteHtml(sql, Array(True, True, Array("KULLANILAN_IZIN"))) ' Execute a SQL and show as HTML table
%> ok ok ok
asp.net ???thanks
thanks i solved the problem
var yil = DUZENLEME_Edit.SON_ISLEM_SAHIBI.EditValue;
......................
" WHERE " +
"EMPLOYEES.KULLANICI_ADI ='" + yil + "'";