protected void BindDdlPwdQuestion(System.Web.UI.HtmlControls.HtmlSelect ddl_PwdQuestion) { BLL.Sys_SecurityQuestion BLL = new BLL.Sys_SecurityQuestion(); string whereStr = " IsDeleted=0 and Status=1"; IList <Model.Sys_SecurityQuestion> list = BLL.GetList(whereStr); ddl_PwdQuestion.DataSource = list; ddl_PwdQuestion.DataTextField = "Question"; ddl_PwdQuestion.DataValueField = "ID"; ddl_PwdQuestion.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IList <Model.Sys_SecurityQuestion> list = new BLL.Sys_SecurityQuestion().GetList("IsDeleted=0 and Status=1"); ddlQuestion.DataSource = list; ddlQuestion.DataValueField = "Id"; ddlQuestion.DataTextField = "Question"; ddlQuestion.DataBind(); } }
protected override string btnAdd_Click() { Model.Sys_SecurityQuestion obj = null; IList <Model.Sys_SecurityQuestion> list = GetDetailModelList(); IList <Model.Sys_SecurityQuestion> listNew = new List <Model.Sys_SecurityQuestion>(); foreach (Model.Sys_SecurityQuestion objNew in list) { Model.Sys_SecurityQuestion sq = objNew; if (objNew.ID == 0) { sq.CreatedBy = TModel.MID; sq.CreatedTime = DateTime.Now; sq.Status = 1; } else { sq = new BLL.Sys_SecurityQuestion().GetModel(objNew.ID); sq.Question = objNew.Question; sq.LastUpdateBy = TModel.MID; sq.LastUpdateTime = DateTime.Now; } listNew.Add(sq); } //删除需要删除的 string deleteId = Request.Form["hidDelIds"]; if (!string.IsNullOrEmpty(deleteId)) { string[] arr = deleteId.Split(','); foreach (string str in arr) { if (!string.IsNullOrEmpty(str)) { Sys_SecurityQuestion sq = new BLL.Sys_SecurityQuestion().GetModel(str); sq.IsDeleted = true;//执行逻辑删除 sq.LastUpdateBy = TModel.MID; sq.LastUpdateTime = DateTime.Now; // new BLL.Sys_SecurityQuestion().Delete(str);//不执行物理删除, listNew.Add(sq); } } } //更新或新增 if (new BLL.Sys_SecurityQuestion().SaveOrUpdate(listNew)) { return("操作成功"); } else { return("操作失败"); } }
protected void BindDdlPwdQuestion() { BLL.Sys_SecurityQuestion bll = new BLL.Sys_SecurityQuestion(); string whereStr = " IsDeleted=0 and Status=1"; IList <Model.Sys_SecurityQuestion> list = bll.GetList(whereStr); ddl_PwdQuestion.DataSource = list; ddl_PwdQuestion.DataTextField = "Question"; ddl_PwdQuestion.DataValueField = "ID"; ddl_PwdQuestion.DataBind(); ddl_NewQuestion.DataSource = list; ddl_NewQuestion.DataTextField = "Question"; ddl_NewQuestion.DataValueField = "ID"; ddl_NewQuestion.DataBind(); }
protected void BindRep() { BLL.Sys_SecurityQuestion bll = new BLL.Sys_SecurityQuestion(); rep_QuestionList.DataSource = bll.GetList(" 1=1 and IsDeleted=0 order by ID desc"); rep_QuestionList.DataBind(); }
protected void BindRep() { BLL.Sys_SecurityQuestion BLL = new BLL.Sys_SecurityQuestion(); rep_QuestionList.DataSource = BLL.GetList(" 1=1 and IsDeleted=0 order by Code"); rep_QuestionList.DataBind(); }