/// <summary> /// 更新受电馈线 /// </summary> /// <param name="currentG3e_id"></param> /// <param name="bdz"></param> /// <param name="kx"></param> private void UpdateSDKXAC(string currentG3e_id, string bdz, string kx) { //更新 var lg3e_id = long.Parse(currentG3e_id); //判断是否有修改 var result = DBEntityFinder.Instance.HasSDKX(CurrentFid, bdz, kx); if (!result) { var isUpdate = UpdateDBEntity.UpdateSDKX_AC(lg3e_id, bdz, kx); if (isUpdate) { UpdateSdkxList(currentRowKx, kx); } PublicMethod.Instance.ShowMessage(isUpdate ? "修改成功!" : "修改失败!"); } }
/// <summary> /// 更新受电馈线 /// </summary> /// <param name="bdz"></param> /// <param name="kxmc"></param> private void UpdateSDKX(string bdz, string kxmc) { if (_sdkxAcUnion != null && _sdkxAcUnion.Any()) { var oldbdz = comboBox_sc_bdz.Text; var oldkx = comboBox_sc_kxmc.Text; if (string.IsNullOrEmpty(oldbdz) && string.IsNullOrEmpty(oldkx)) { return; } IList <long> errors = new List <long>(); foreach (var sdkx in _sdkxAcUnion) { if (sdkx.GDBDZ.Equals(oldbdz) && sdkx.KXH.Equals(oldkx)) { var isUpdate = UpdateDBEntity.UpdateSDKX_AC(bdz, kxmc, sdkx); if (!isUpdate) { errors.Add(sdkx.G3E_FID); } else { var duplicated = DBEntityFinder.Instance.DuplicatedSdkx(sdkx.G3E_FID, bdz, kxmc); //判断同一个设备是否有重复的受电馈线 if (duplicated) { DeleteDBEntity.DeleteSDKX(sdkx.G3E_ID); } } } } if (errors.Any()) { GetError("更新失败!", errors); } else { MessageBox.Show("更新成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Question); } //重新绑定 GetSymbolSDKXUnion(); } }