我得到我的方法來自我的數據表中的一個int值取參數值到另一個類的方法
public void GetListing(string url,int ID)
我想從另一個方法來訪問這個ID,然後分配一個更新值它,然後保存在我的表 是否有可能這樣做?
updateMethod(int ID,int Status)
我得到我的方法來自我的數據表中的一個int值取參數值到另一個類的方法
public void GetListing(string url,int ID)
我想從另一個方法來訪問這個ID,然後分配一個更新值它,然後保存在我的表 是否有可能這樣做?
updateMethod(int ID,int Status)
你應該通過傳遞ID調用從GetListing()
的updateMethod
。所以GetListing
的簽名將是這樣的:
public void GetListing(string url,int ID)
{
//Some code here
int status=1; // this will be the value of status
updateMethod(ID, status); // this will call the updateMethod
}
而且updateMethod()會是這樣;
updateMethod(int ID,int Status)
{
// do something
}
會嘗試it.before請告訴我更新方法中的1是什麼? –
這將是狀態的值;最後看到更新 –
,我每次都能處理不同的ID嗎?因爲我在每次獲取GetListing方法中的不同ID並傳遞更新方法? –
在哪裏/你什麼時候打電話給你'updateMethod'? –
在我的GetListing方法下即時調用該方法,並想傳遞ID到該方法,但事情是每次獲取列表將獲得一個動態/不同的ID所以這可能使我的更新方法中的ID更改通過ID訪問它? –