private bool getdata(dataset dsmydataset)
{
bool isuf;
if(isuf)
{
......
try
{
.....
}
catch(Exception e)
{ throw(e);
}
問題:此時isuf=什麼false/true?
}
return isuf;
}請邦我回答問題時付載一個例子可以嗎?謝謝了!
{
bool isuf;
if(isuf)
{
......
try
{
.....
}
catch(Exception e)
{ throw(e);
}
問題:此時isuf=什麼false/true?
}
return isuf;
}請邦我回答問題時付載一個例子可以嗎?謝謝了!
解决方案 »
- 老鸟帮下,复习C#遇到点问题
- 为何DataGridView SelectChanged事件时 Cells["XX"]内容为空?
- 请教一个关于Panel控件重绘方面的问题
- 如何获取剪切板数据?
- datagridview的checkbox列 如何动态改边它是否选中
- System.Net.Sockets.TcpClient 造成的死机现象
- 高手们,帮我看看吧。关于限制datagridview 中某列数据长度输入的限制??
- DataGridTextBoxColumn.Format 要怎样设置
- 关于EditPlus搭建的C#开发环境,如何添加Dll引用的问题!
- dataGrid两个小问题!求教!!
- c#2005写了两个小程序源码被我不小心删了,又没有办法恢复?
- 这个类在创建的时候初始化的顺序是怎样的?
{
try
{
.....
return true;
}
catch(Exception e)
{
return false;
}
}
{
}
楼主这个方法用什么用?你要明确。然后返回值用:return isuf;
{
bool isuf;
string str;
if(str == "abcd")
{
return isuf=true;
}
else
{
return isuf=false;
}
}
能寫一個好一點例子嗎?
要不我在哪一個例子,你們工作開發中不經常用這個BOOL值來控制一些工能嗎?
請你幫我解說其中的 道理所在?謝謝!這對我來說很重要哦!因為我們經常要用。。快點可以嗎、?判斷flag值的
public bool DealDataSetRowsOfFlag(DataSet DataRows,ActionTable DataBase)
{
bool isSuf = true;
foreach (DataTable DT in DataRows.Tables)
{
DataColumn[] DC = DT.PrimaryKey;
if (DT.Rows.Count > 0)
{
for (int i = 0;i < DT.Rows.Count ; i++)
{
if (DT.Rows[i].RowState == System.Data.DataRowState.Modified)
{
if (DC.Length > 0)
{
decimal _Flag;
FieldProperty[] myFP = new FieldProperty[DC.Length];
CDenotationValue[] myCD = new CDenotationValue[DC.Length];
string[] txtValue = new string[1];
int[] txtIndex = {-1};
int _index = 0; Query_Windows myQuery = new Query_Windows(); foreach (DataColumn CDC in DC)
{
myFP[_index] = new FieldProperty(CDC.ColumnName,"V",DT.Rows[i][CDC.ColumnName]);
myCD[_index] = new CDenotationValue("=","AND");
_index++;
}
myQuery.GetInfo(DT.TableName,myFP,myCD,txtValue,txtIndex,DataBase);
_Flag = (txtValue[0] == null || txtValue[0].Trim() == string.Empty)?0:decimal.Parse(txtValue[0]);
if (_Flag == (decimal)DT.Rows[i]["FLAG"])
{
DT.Rows[i]["FLAG"] = (decimal)DT.Rows[i]["FLAG"] + 1;
isSuf = true;
}
else
isSuf = false;
}
else
{
DT.Rows[i]["FLAG"] = (decimal)DT.Rows[i]["FLAG"] + 1;
isSuf = true;
}
}
}
}
}
return isSuf;
}
}
象他們那樣一會true, 一 會false 其中的道理在哪。。或者說你知道可以給我一個好的例子呀!
我不清楚其中的邏輯所在!
如你知道我要問的是什麼!代碼不用管理,你就是幫我講解為什麼 bool值在某位置是那樣的值!
然後這樣以會把程序控制的怎樣!!!
給我一個例吧!幫幫我。。
要不看這個吧!
private bool OpinionSalesDate()
{
if (myFormActionType == ActionType.Create || myFormActionType == ActionType.Edit)
{
dgCOPTH.CurrentCellChanged -=new EventHandler(dgCOPTH_CurrentCellChanged);
}
string Errmsg = "";
bool isOK = true;
string[] txtValue = new string[1];
int[] intValue = {38};
string strDate = DateTime.Today.ToString("yyyyMMdd");
FieldProperty[] myFP = null;
CDenotationValue[] myCD = new CDenotationValue[]{
new CDenotationValue("=","AND"),
new CDenotationValue("=","AND"),
new CDenotationValue("=","AND")
};
System.Windows.Forms.BindingManagerBase myBM = BindingContext[dgCOPTH.DataSource,dgCOPTH.DataMember];
myBM.EndCurrentEdit();
int index = myBM.Position;
if (myBM.Count > 0)
{
Query_Windows myQuery = new Query_Windows();
for (int i = 0;i < myBM.Count ;i++)
{
myBM.Position = i;
DataRowView myDRV = (DataRowView)myBM.Current;
if (myDRV.Row["TH014"].ToString().Trim()+myDRV.Row["TH015"].ToString().Trim()+myDRV.Row["TH016"].ToString().Trim() != "")
{
txtValue[0] = "";
myFP = new FieldProperty[]{
new FieldProperty("TD001","V",myDRV.Row["TH014"].ToString().Trim()),
new FieldProperty("TD002","V",myDRV.Row["TH015"].ToString().Trim()),
new FieldProperty("TD003","V",myDRV.Row["TH016"].ToString().Trim()),
};
myQuery.GetInfo("COPTD",myFP,myCD,txtValue,intValue,ActionTable.Leader);
if (txtValue[0].CompareTo(strDate)<=0)
Errmsg += string.Format("\n\t{0}","訂單:"+myDRV.Row["TH014"].ToString().Trim()+" "+myDRV.Row["TH015"].ToString().Trim()+" "+myDRV.Row["TH016"].ToString().Trim()+" "+"已超過[終止出貨日期]!");
}
}
}
myBM.Position = index;
if (Errmsg != string.Empty)
{
Errmsg += string.Format("\n\t{0}","是否確認執行?");
if (MessageBox.Show(this,Errmsg,"銷貨單建立作業",MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
isOK = false;
else
isOK = true;
}
if (myFormActionType == ActionType.Create || myFormActionType == ActionType.Edit)
{
dgCOPTH.CurrentCellChanged +=new EventHandler(dgCOPTH_CurrentCellChanged);
}
return isOK;
}