摘要:
当需要从一个窗体传值到另一传递!!就需要在from建立构造函数; public haitaolooking(haitao_OrderDish htod) { InitializeComponent(); BillID=htod.BillID; }把haitao——orderdish窗体的billid传到窗体haitaolooking 阅读全文
摘要:
在开发过程中,少不了系统的介绍模块!!在这个模块中,想用一个控件很好表现出介绍的内容,觉得richtextbox不错!!!代码如下: DataSet ds = st.SearchCaseIntroduction(); List<String> list = new List<string>(); foreach (DataRow row in ds.Tables[0].Rows) { list.Add(row[0].ToString()); } richTextBox1.Lines = list.ToArray();效果如下: 阅读全文
摘要:
在开发食神软件的时候,动态生成按钮式必不可少的!!特别是前台点菜模块!!生成口味按钮,菜的按钮,送单管理员的按钮!!下面的一个生成食品自身是否有口味按钮的例子 DataSet dsfoodfeel = od.SearchFoodFeel(foodid); if (dsfoodfeel.Tables[0].Rows.Count > 0) //判断自身食品是否有口味 { panel6.Controls.Clear(); maxPage = ((dsfoodfeel.Tables[0].Rows.Count - 1) / 25) + 1; FeelFuncButton[] b = new Fe 阅读全文
摘要:
public static DataTable GetColumns(DataTable dt, string name) //截取datatable里面的name列作为新datatable { DataTable tmp = new DataTable(); 定义一个新的表 tmp.Columns.Add(name); int rowsnum = dt.Columns[name].Table.Rows.Count; for (int i = 0; i < rowsnum; i++) { tmp.Rows.Add(); try { tmp.Rows[i][name] = dt.Rows[ 阅读全文