protected void btnDel_Click(object sender, System.EventArgs e) { System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>(); if (this.hfldIdsChecked.Value.Contains('[')) { list = JsonHelper.GetListFromJson(this.hfldIdsChecked.Value); } else { list.Add(this.hfldIdsChecked.Value); } try { EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService(); foreach (string current in list) { equShipTechnicalParasService.DeleteAllEquShipTechInfos(current); EquEquipment byId = this.equipmentSer.GetById(current); this.equipmentSer.Delete(byId); } base.RegisterScript("top.ui.show('删除成功!');"); this.BindGV(); } catch { base.RegisterScript("top.ui.show('删除失败!');"); } }
private void AddOtherShipsInfo() { EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService(); equShipTechnicalParasService.DeleteAllEquShipTechInfos(this.hdfEquId.Value.Trim()); if (!string.IsNullOrEmpty(this.hfldOtherShipsInfo.Value.Trim())) { string[] otherShipInfo = this.hfldOtherShipsInfo.Value.Split(new char[] { '|' }); equShipTechnicalParasService.InsertEquShipTechParasTable(this.hdfEquId.Value.Trim(), otherShipInfo); } }