【发布时间】:2014-03-27 10:13:45
【问题描述】:
我必须创建一个程序来处理投诉我必须跟踪我完成了多少次流程,这意味着当我返回到流程中的第一个表单时我需要增加一个计数但是这个数字总是在打开第一个表单
runNum 设置为公共 int 这是我用于自动将数据输入到表单然后在打开下一个表单之前增加 runmber 的代码:
private void autoFill()
{
TitlePage titlepage = new TitlePage();
if (titlepage.getRun() == true)
{
int priority = runNum % 4;
if (priority == 0)
priority = 2;
txtDate.Text = DateTime.Today.ToString("dd/MM/yyyy");
txtRef.Text = (100 + runNum).ToString();
txtPriority.Text = priority.ToString();
txtCustName.Text = firstNames[runNum] + " " + secondNames[runNum];
txtCustAddress.Text = (runNum + 5).ToString() + " " + Address1[runNum] + " " + Address2[(runNum % 7)];
txtCustEmail.Text = firstNames[runNum] + secondNames[runNum] + "@" + ISP[(runNum % 10)] + "." + Suff[(runNum % 10)];
txtCustTel.Text = TelNo[runNum];
//TBD- fill this in with actual data
rtbComplaint.Text = "Complaint type, Sevarity, soultion exsiting, employee who dealt with complaint, Date";
rtbComplaint.Enabled = false;
txtPriority.Enabled = false;
txtDate.Enabled = false;
txtRef.Enabled = false;
txtCustName.Enabled = false;
txtCustName.Enabled = false;
txtCustEmail.Enabled = false;
txtCustAddress.Enabled = false;
txtCustTel.Enabled = false;
if (runNum % 2 == 0)
{
rdoNo.Checked = true;
enter code here }
else
{
rdoYes.Checked = true;
}
getTimer();
runNum++;
}
}
【问题讨论】:
-
您好,欢迎来到 StackOverflow。就目前而言,您的帖子对问题的含义不是很清楚。还有相当多的代码。为了让人们更容易回答您的问题,请考虑将您的代码缩减为 Short, Self-contained, Compilable example。
-
我同意 dav_i。您希望 runNum 与访问应用程序的任何人相关,还是只与忙于迭代的用户相关?下一个问题是这是一个 Web 应用程序还是 Windows 应用程序,因为实现也会有很大不同。
-
对不起,这是我第一次发帖给您带来的困惑,下次我会尝试带上您的 cmets =),Hano Johannes Rossouw soultion 帮助我解决了这个问题,但感谢您表现出兴趣