/// <summary> /// 删除 /// </summary> /// <returns></returns> public override bool Delete() { if (_supplierCode != string.Empty) { //Call Remoting Service try { IServerObjFactory factor = CallRemotingService.GetRemoteObject(); if (null != factor) { string msg = string.Empty; DataSet dsReturn = factor.CreateISupplierEngine().DeleteSupplierCode(_supplierCode); msg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); if (msg != string.Empty) { MessageService.ShowError(msg); return(false); } else { MessageService.ShowMessage("${res:Global.SuccessMessage}", "${res:Global.SystemInfo}"); //系统提示删除成功 } } } catch (Exception) { } finally { CallRemotingService.UnregisterChannel(); } } return(true); }
public override bool Update(string lblCode) { DataSet dataSet = new DataSet(); //Add basic data DataTable codeTable = DataTableHelper.CreateDataTableForUpdateSupplierCode(); Dictionary <string, string> dataRow = new Dictionary <string, string>() { { "CODE", _supplierCode }, { "NAME", _supplierName }, { "NICKNAME", _supplierNickName }, { "CREATOR", PropertyService.Get(PROPERTY_FIELDS.USER_NAME) } }; FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref codeTable, dataRow); dataSet.Tables.Add(codeTable); try { int code = 0; string msg = string.Empty; DataSet dsReturn = null; IServerObjFactory factor = CallRemotingService.GetRemoteObject(); if (null != factor) { dsReturn = factor.CreateISupplierEngine().SupplierCodeUpdate(dataSet, lblCode); msg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn, ref code); if (code == -1) { MessageService.ShowError(msg); return(false); } this.ResetDirtyList(); MessageService.ShowMessage("修改保存成功", "保存"); //操作成功! } } catch (Exception ex) { MessageService.ShowError(ex); } finally { CallRemotingService.UnregisterChannel(); } return(true); }
/// <summary> /// 初始化数据 /// </summary> /// <returns></returns> public DataSet GetSupplierCode() { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); if (null != serverFactory) { dsReturn = serverFactory.CreateISupplierEngine().GetSupplierCode(); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } return(dsReturn); }