/// <summary> /// Обновление строки перечня договоров /// </summary> /// <param name="_exportSupplyResourceContract"></param> /// <returns>Результат обновления</returns> public static string UpdateSupplyResourceContract(SupplyResourceContract _supplyResourceContract, exportSupplyResourceContractResultType _exportSupplyResourceContract) { string _result; try { bool contractStatusVersion; if (_exportSupplyResourceContract.VersionStatus == exportSupplyResourceContractResultTypeVersionStatus.Posted) { contractStatusVersion = true; } else { contractStatusVersion = false; } _supplyResourceContract.ContractNumber = ((ExportSupplyResourceContractTypeIsContract)_exportSupplyResourceContract.Item).ContractNumber; _supplyResourceContract.SigningDateStart = ((ExportSupplyResourceContractTypeIsContract)_exportSupplyResourceContract.Item).SigningDate; _supplyResourceContract.SigningDateEnd = DateTime.Parse("0001-01-01"); _supplyResourceContract.ContractState = contractStatusVersion; _supplyResourceContract.GIS_VersionNumber = int.Parse(_exportSupplyResourceContract.VersionNumber); Program.db.SubmitChanges(); _result = "Supply resource contract item is correct"; } catch (Exception e) { _result = e.Message; } return(_result); }
public static string InsertObjectAddress(SupplyResourceContract _supplyResourceContract, exportSupplyResourceContractObjectAddressResultType _exportObjectAddress) { string _result; try { Program.db.spInsertObjectAddress(Guid.Parse(_supplyResourceContract.GUID.ToString()), Guid.Parse(_exportObjectAddress.FIASHouseGuid.ToString()), _exportObjectAddress.ApartmentNumber, _exportObjectAddress.RoomNumber, Guid.Parse(_exportObjectAddress.ObjectGUID)); _result = "Object address is synchronized"; } catch (Exception e) { _result = e.Message; } return(_result); }