//在用户控件中定义public变量和属性,这样在调用窗体中就可以方便的使用用户控件的值 foreach (Control ctr in panel_fill.Controls) { UserControl_TJ_ResultsEntry uctre = null;//用户控件 if (ctr.GetType() == typeof(UserControl_TJ_ResultsEntry)) { uctre = ctr as UserControl_TJ_ResultsEntry; int i_all = 0; for (int j = 0; j < uctre.itemchange_group_dt.Rows.Count; j++) { DataRow item_row = uctre.itemchange_group_dt.Rows[j];//用户控件中定义的public表 string str_state = item_row["State"] == null ? "" : item_row["State"].ToString(); if (str_state == "已检") i_all++; bll_itemresult.UpdateResultByGUID(item_row["GUID"].ToString(), item_row["Result"].ToString(), str_state); } //根据体检id和组合id更新组合检验状态0,1,2,3 if (i_all == uctre.itemchange_group_dt.Rows.Count) bll_itemgroup.UpdateGroupByTIDandGID(this.Current_TJ_ID, uctre.itemchange_group_dt.Rows[0]["GroupID"].ToString(), "3", Convert.ToDateTime(uctre.GROUP_TJ_TIME), uctre.GROUP_DOCTORID, uctre.GROUP_DOCTORNAME);//GROUP_DOCTORID,GROUP_DOCTORNAME用户控件中定义的属性 else if (i_all > 0 && i_all < uctre.itemchange_group_dt.Rows.Count) bll_itemgroup.UpdateGroupByTIDandGID(this.Current_TJ_ID, uctre.itemchange_group_dt.Rows[0]["GroupID"].ToString(), "2", Convert.ToDateTime(uctre.GROUP_TJ_TIME), uctre.GROUP_DOCTORID, uctre.GROUP_DOCTORNAME); else bll_itemgroup.UpdateGroupByTIDandGID(this.Current_TJ_ID, uctre.itemchange_group_dt.Rows[0]["GroupID"].ToString(), "1", Convert.ToDateTime(uctre.GROUP_TJ_TIME), uctre.GROUP_DOCTORID, uctre.GROUP_DOCTORNAME); } }
winform 读取用户控件的变量_VS2005winform程序中获取用户控件的值
最新推荐文章于 2023-09-25 12:20:18 发布