public void DataBindEx() { DigiPower.Onlinecol.Standard.BLL.T_SystemInfo_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_SystemInfo_BLL(); List <T_SystemInfo_MDL> list1 = bll.GetModelList(" CurrentType = 'DefineType' "); DropDownList1.DataTextField = "SystemInfoName"; DropDownList1.DataValueField = "SystemInfoID"; DropDownList1.DataSource = list1; DropDownList1.DataBind(); }
public ColorList() { BLL.T_SystemInfo_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_SystemInfo_BLL(); DataSet ds1 = bll.GetList("CurrentType='118'"); if (ds1.Tables.Count > 0) { foreach (DataRow row in ds1.Tables[0].Rows) { _colorList.Add(row["SubType"], row["SystemInfoCode"]); } } }
/// <summary> /// 绑定页面 /// </summary> /// <param name="ID"></param> private void BindPage(string ID) { if (!String.IsNullOrWhiteSpace(ID)) { Model.T_SystemInfo_MDL model = new DigiPower.Onlinecol.Standard.Model.T_SystemInfo_MDL(); BLL.T_SystemInfo_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_SystemInfo_BLL(); model = bll.GetModel(Convert.ToInt32(ID)); if (model != null) { ViewState["model"] = model; Comm.SetValueToPage(model, this.tbl); } } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { Model.T_SystemInfo_MDL model = new DigiPower.Onlinecol.Standard.Model.T_SystemInfo_MDL(); if (ViewState["model"] != null) { model = (Model.T_SystemInfo_MDL)ViewState["model"]; } BLL.T_SystemInfo_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_SystemInfo_BLL(); object obj = Comm.GetValueToObject(model, this.tbl); if (obj != null) { Model.T_SystemInfo_MDL Newmodel = (Model.T_SystemInfo_MDL)obj; switch ((CommonEnum.PageState)ViewState["ps"]) { case CommonEnum.PageState.ADD: int systemInfoID = bll.Add(Newmodel); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_SystemInfo;key=", systemInfoID, ";CurrentType=", Newmodel.CurrentType, ";SystemInfoCode=", Newmodel.SystemInfoCode, ";SystemInfoName=", Newmodel.SystemInfoName)); break; case CommonEnum.PageState.EDIT: { bll.Update(Newmodel); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_SystemInfo;key=", Newmodel.SystemInfoID, ";CurrentType=", Newmodel.CurrentType, ";SystemInfoCode=", Newmodel.SystemInfoCode, ";SystemInfoName=", Newmodel.SystemInfoName)); } break; } } Common.MessageBox.CloseLayerOpenWeb(this.Page); }