我已经设法在 WinForms 中实现了所要求的功能,尽管我仍然是 ASP.NET(比 Windows 复杂得多的平台,变量“失去”它们是他们以前拥有的一切)和客户端 VS 的初学者。服务器,我有点问自己从哪里开始。
在使用系统反射的 WinForms 中,我能够被 repotted
(通过放置在当前表单上的 ListView)ListView 填充
了每个功能信息(计时参数等......)
,但我真的想不出一个网站来托管它,ListView
即使我可能会在发布应用程序之前丢失它。反而,
我想到了以下类似的方法,我想与您有经验的开发人员核实一下,您如何照顾您的business
?
我实际上可以对 Visual Studio 自己的调试功能感到满意。
这是我的方法
例如单击提交按钮
protected void imgBut_Submt_Click(object sender, ImageClickEventArgs e)
{
//debugging and logging via methods that's in a namespace/ classses showed below
SeSn.Modify(Act.Edit,SeSn.CurrentStage, Mod.submitedFreshQuery); <-----=======
App.Add(AppFlags.SubmitButtonWasPressed);<------===========
Display.Show(DV_UsersInTblTime);
tblTimeDataLists.getReportFromSP(Convert.ToInt32(DDL_ChosenBranch.SelectedItem.Value), SelectedReportMonth, SelectedReportYear);
Visibility.Hide(imgBut_Submt);
var m = Request.Form["DDLmonth"];
var y = Request.Form["DDLyear"];
string branchName = GetTableData.AsString(HTDB_Cols.TblBranches.BranchName, HTDB_Tables.TblBranches, HTDB_Cols.TblBranches.BranchID, DDL_ChosenBranch.SelectedItem.Value);
if (tblTimeDataLists.TheresNoRecordForThatSnif(Convert.ToInt32(DDL_ChosenBranch.SelectedItem.Value), Convert.ToInt32(m), Convert.ToInt32(y)))
JsTemplates.Alert(string.Format("No data for {0} at period {1}/{2}", branchName, m, y));
DisplayRepResults();
}
你可以看看我用来“收集”系统会话数据的方法
namespace DebugTests
{
namespace Sesseion
{
public static class SeSn
{
public const string CurrentStage = "CurrStage";
public static bool isNotEmpty()
{
return HttpContext.Current.Session.Keys.Count > 0;
}
public static bool Raised(string FlagName)
{
return GetValueAS.Bool(FlagName);
}
public static void Modify(Act action, string NewQs_paramName, string NewP_Value = "", string CurSes_ParamName = null, bool redirectWithNewQuerySettings = false)
{
switch (action)
{
case Act.Remove:
if (isNotEmpty())
HttpContext.Current.Session.Remove(CurSes_ParamName);
break;
case Act.Replace:
HttpContext.Current.Session.Remove(CurSes_ParamName);
HttpContext.Current.Session.Add(NewQs_paramName, NewP_Value);
break;
case Act.Edit:
HttpContext.Current.Session.Remove(CurSes_ParamName);
HttpContext.Current.Session.Add(CurSes_ParamName, NewP_Value);
break;
case Act.Add:
HttpContext.Current.Session.Add(NewQs_paramName, NewP_Value);
break;
case Act.AddFlag:
HttpContext.Current.Session.Add(NewQs_paramName, true);
break;
}
}
}
public enum Act
{
Edit, Add, AddFlag, Remove, Replace
}
public sealed class SesVals
{
public const string state = "Cstate";
public const string custid = "custid";
public const string recordID = "recordID";
public const string SelectedMonth = "SesMonth";
public const string SelectedChosenWorker = "SesChosenWorkerSelected";
//etc....
}
public sealed class Mod
{
public const string FirstloadeViaLink = "Link",
submitedFreshQuery = "submitedFreshQuery",
canceledInsert = "cancelInsert",
filteredByTable = "filteredByTable",
filterByColumn = "filterByColumn";
//etc....
}
public sealed class App
{
public static void Add(string flagName)
{
Sesseion.SeSn.Modify(Act.AddFlag, flagName);
}
}
public sealed class AppFlags
{
public const string SubmitButtonWasPressed = "SubmitButtonWasPressed";
public const string MainDataSetIsPopulated = "MainDataSetIsPopulated";
public const string HTDB_DisplayCpa_Cols_WasSelected = "HTDBCpa_ColsWasSelected";
//etc....
}
}
}
如果我想避免 VS 的额外程序/插件,或者是否必须使用它们,这是这样做的方法吗?
您如何管理您的应用程序操作?