当前位置: 首页>>代码示例>>C#>>正文


C# DBOperationsUtil.deleteRecord方法代码示例

本文整理汇总了C#中DBOperationsUtil.deleteRecord方法的典型用法代码示例。如果您正苦于以下问题:C# DBOperationsUtil.deleteRecord方法的具体用法?C# DBOperationsUtil.deleteRecord怎么用?C# DBOperationsUtil.deleteRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBOperationsUtil的用法示例。


在下文中一共展示了DBOperationsUtil.deleteRecord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: deleteResignedEmployee

    //delete resigned employee from database
    public TransactionResponse deleteResignedEmployee()
    {
        TransactionResponse response = new TransactionResponse();
        try
        {
            IDictionary<string, object> argumentMap = new Dictionary<string, object>();
            //task referance
            argumentMap.Add("@UserId", employee.UserName);

            //Pass Stored Procedure Name and parameter list.
            DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spDeleteEmployeeInfor, argumentMap);
            bool isDeleteOk = dbOperation.deleteRecord();

            //put the data on Transaction response
            response.Data = isDeleteOk;

            response.setSuccess(true);

            //get delete status inside the TransactionResponse.
            return response;
        }
        catch (SqlException ex)
        {
            response.setErrorCode(DBOperationErrorConstants.E_ERROR_WHILE_REMOVING_INACTIVE_EMPLOYEE);
            response.setMessage(DBOperationErrorConstants.M_UNABLE_TO_REMOVING_INACTIVE_EMPLOYEE);
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setSuccess(false);
            return response;
        }

           //CATCH ANY OTHER EXCEPTION, dont let user see any kind of unexpected error
        catch (Exception ex)
        {
            //Write this exception to file for investigation of the issue later.
            logException(ex);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
            response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setSuccess(false);
            return response;
        }
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:43,代码来源:EmployeeManager.cs

示例2: deleteNotificationForRatingDonePhase1

    public TransactionResponse deleteNotificationForRatingDonePhase1(MembershipUser currentUser)
    {
        TransactionResponse response = new TransactionResponse();
        try
        {
            //get detail of the logged on user.
            Employee employee = EmployeeManager.getLoggedOnUser((Guid)currentUser.ProviderUserKey);

            if (employee == null)
            {
                return EmployeeManager.handleLoggedInUserCanNotBeIdentfied();
            }

            IDictionary<string, object> argumentMap = new Dictionary<string, object>();
            //task referance
            argumentMap.Add("@taskRef", vacancy.VacancyNo);
            argumentMap.Add("@receiverEID", employee.EmpID);
            argumentMap.Add("@destrictID", PageAccessManager.getDistrictID());

            //Pass Stored Procedure Name and parameter list.
            DBOperationsUtil dbOperation = new DBOperationsUtil(DbAccessConstants.spDeleteMailNotification, argumentMap);
            bool isDeleteOk = dbOperation.deleteRecord();

            //put the data on Transaction response
            response.Data = isDeleteOk;

            response.setSuccess(true);

            //get delete status inside the TransactionResponse.
            return response;
        }
        catch (SqlException ex)
        {
            response.setErrorCode(DBOperationErrorConstants.E_ERROR_WHILE_REMOVING_NOTIFICATION);
            response.setMessage(DBOperationErrorConstants.M_UNABLE_TO_REMOVE_NOTIFICATION);
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setSuccess(false);
            return response;
        }

           //CATCH ANY OTHER EXCEPTION, dont let user see any kind of unexpected error
        catch (Exception ex)
        {
            //Write this exception to file for investigation of the issue later.
            logException(ex);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_EVIL_ERROR);
            response.setMessage(DBOperationErrorConstants.M_UNKNOWN_EVIL_ERROR);
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setSuccess(false);
            return response;
        }
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:52,代码来源:NotificationManager.cs


注:本文中的DBOperationsUtil.deleteRecord方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。