/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnEnter_Click(object sender, EventArgs e) { Song.Entities.LimitDomain ld = id == 0 ? new Song.Entities.LimitDomain() : Business.Do <ILimitDomain>().DomainSingle(id); ld = this.EntityFill(ld) as Song.Entities.LimitDomain; if (Business.Do <ILimitDomain>().DomainIsExist(ld)) { Message.Alert("当前域名已经存在!"); } else { try { if (id == 0) { Business.Do <ILimitDomain>().DomainAdd(ld); } else { Business.Do <ILimitDomain>().DomainSave(ld); } Master.AlertCloseAndRefresh("操作成功!"); } catch (Exception ex) { Message.ExceptionShow(ex); } } }
private void fill() { Song.Entities.LimitDomain ld = id == 0 ? new Song.Entities.LimitDomain() : Business.Do <ILimitDomain>().DomainSingle(id); if (id > 0) { this.EntityBind(ld); } }
/// <summary> /// 修改是否显示的状态 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void sbIsUse_Click(object sender, EventArgs e) { StateButton ub = (StateButton)sender; int index = ((GridViewRow)(ub.Parent.Parent)).RowIndex; int id = int.Parse(this.GridView1.DataKeys[index].Value.ToString()); // Song.Entities.LimitDomain entity = Business.Do <ILimitDomain>().DomainSingle(id); entity.LD_IsUse = !entity.LD_IsUse; Business.Do <ILimitDomain>().DomainSave(entity); BindData(null, null); }