public OperationResult Retrieve(MasterEntity oEntity) { OperationResult obj = new OperationResult(); try { //if oEntity is null then initialize it with blank entity if (oEntity == null) { oEntity = new MasterEntity(); } Hashtable ht = new Hashtable(); ht[MyCommonEntity.Fields.OPERATIONMODE] = MyConstantEntity.OperationModes.RETRIEVE; List <object> ol = new MasterBalc(ConnectionString).GetInitData(oEntity, ht); if (ol.Count > 0) { obj.Data = ol; obj.Result = ol.Count > 0; } obj.Message = (obj.Result) ? MyConstantEntity.MessageConstants.RECORD_RETRIEVE_SUCCEEDED : MyConstantEntity.MessageConstants.RECORD_RETRIEVE_FAILED; } catch (Exception ex) { obj.Message = ex.Message; } return(obj); }
public OperationResult Delete(MasterEntity oEntity) { OperationResult obj = new OperationResult(); try { //if oEntity is null then initialize it with blank entity if (oEntity == null) { oEntity = new MasterEntity(); } Hashtable ht = new Hashtable(); ht[MyCommonEntity.Fields.OPERATIONMODE] = MyConstantEntity.OperationModes.DELETE; obj.Result = new MasterBalc(ConnectionString).Delete(oEntity, ht); obj.Message = (obj.Result) ? MyConstantEntity.MessageConstants.RECORD_DELETE_SUCCEEDED : MyConstantEntity.MessageConstants.RECORD_DELETE_FAILED; obj.Data = new List <object>(); obj.Data.Add((obj.Result) ? ht[MasterEntity.Fields.USERID] : -1); } catch (Exception ex) { obj.Message = ex.Message; } return(obj); }