/// <summary> /// 新增按钮 /// </summary> /// <param name="context"></param> public void addBtn() { Mod_Sys_Btn mb = new Mod_Sys_Btn(); BindDataToModel(ref mb); //JSONhelper.ConvertToObject<Mod_Sys_Btn>(); }
private List <Mod_Sys_Btn> ConvertToListData(DataSet dataSet) { if (dataSet == null) { return(null); } if (dataSet.Tables[0].Rows.Count > 0) { List <Mod_Sys_Btn> tmpLiSys_Btn = new List <Mod_Sys_Btn>(); for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { Mod_Sys_Btn sys_btn = new Mod_Sys_Btn(); sys_btn.BtnCode = dataSet.Tables[0].Rows[i]["BtnCode"].ToString(); sys_btn.BtnID = Convert.ToInt32(dataSet.Tables[0].Rows[i]["BtnID"].ToString()); sys_btn.BtnName = dataSet.Tables[0].Rows[i]["BtnName"].ToString(); sys_btn.BtnTitle = dataSet.Tables[0].Rows[i]["BtnTitle"].ToString(); sys_btn.MenuID = Convert.ToInt32(dataSet.Tables[0].Rows[i]["MenuID"].ToString()); sys_btn.Icon = dataSet.Tables[0].Rows[i]["Icon"].ToString(); tmpLiSys_Btn.Add(sys_btn); } return(tmpLiSys_Btn); } else { return(null); } }
public void BindDataToModel(ref Mod_Sys_Btn _Sys_Btn) { string Operate = HttpContext.Current.Request["opertype"]; if (Operate.ToLower() != "add") { _Sys_Btn.BtnID = Convert.ToInt32(HttpContext.Current.Request.Form["BtnID"]); } _Sys_Btn.BtnCode = HttpContext.Current.Request.Form["BtnCode"]; _Sys_Btn.Icon = HttpContext.Current.Request.Form["Icon"]; _Sys_Btn.BtnName = HttpContext.Current.Request.Form["BtnName"]; _Sys_Btn.BtnTitle = HttpContext.Current.Request.Form["BtnTitle"]; _Sys_Btn.MenuID = Convert.ToInt32(HttpContext.Current.Request["MenuID"]); }