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


C# DBOperationsUtil.updateRecord方法代码示例

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


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

示例1: addNewPromotionAssignment

    public TransactionResponse addNewPromotionAssignment()
    {
        //Add List of Arguments for new promotion Assigment
        IDictionary<string, object> promotionAssigmentParameters = new Dictionary<string, object>();

        promotionAssigmentParameters.Add("@minNo", promotionAssigment.MinuteNo);
        promotionAssigmentParameters.Add("@hROfficerID", promotionAssigment.HROfficerID);
        promotionAssigmentParameters.Add("@deadLine", promotionAssigment.DeadLine);
        promotionAssigmentParameters.Add("@remark", promotionAssigment.Remark);

        //Pass Stored Procedure Name and parameter list.
        DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spAddPromotionAssignmentToHROfficer, promotionAssigmentParameters);
        TransactionResponse response = new TransactionResponse();
        try
        {
            //call update to DB mathod and get reponse.
            dpOperation.updateRecord();
            response.setSuccess(true);
            response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
            response.setMessage(DBOperationErrorConstants.M_VACANCY_ASSIGNED_SUCCESS);
        }

        catch (SqlException ex)
        {
            //Other SqlException is catched
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.PK_DUPLICATE_INDICATOR + ". "+ DBOperationErrorConstants.M_DUPLICATE_PROMOTION_ASSIGNEMENT);
            response.setErrorCode(DBOperationErrorConstants.E_PROMOTION_ASSIGNEMETN_FAILED);
        }

        //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);
            LoggerManager.upDateWithGenericErrorMessage(response);
        }
        return response;
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:39,代码来源:PromotionManager.cs

示例2: updateDiplomaApplicantToNull

    /**
    * Update diploma applicant on vacancy readvertise
    */
    private bool updateDiplomaApplicantToNull(TransactionResponse response)
    {
        try
        {
            //Add List of Arguments for new employee
            IDictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("@vacancyNo", vacancy.VacancyNo.Trim());
            parameters.Add("@vacancyDate", vacancy.PostedDate.Trim());

            DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spAddDiplomaIntoEvaluation, parameters);
            return dpOperation.updateRecord();
        }
        //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);
            LoggerManager.upDateWithGenericErrorMessage(response);
            return false;
        }
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:24,代码来源:VacancyRegistrationAndEvaluationManager.cs

示例3: readvertiseVacancyAfterRating

    /**
    * Update status fo Vacancy to Readverised after rating
    */
    private bool readvertiseVacancyAfterRating(TransactionResponse response)
    {
        try
        {
            //Add List of Arguments for new employee
            IDictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("@vacancy_No", vacancy.VacancyNo.Trim());
            parameters.Add("@posted_date ", vacancy.PostedDate.Trim());
            parameters.Add("@status", vacancy.Status);
            parameters.Add("@vancy_deadline", vacancy.VancyDeadline);

            DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spUpdateVacancyStatusAfterRating, parameters);
            return dpOperation.updateRecord();
        }
        //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);
            LoggerManager.upDateWithGenericErrorMessage(response);
            return false;
        }
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:26,代码来源:VacancyRegistrationAndEvaluationManager.cs

示例4: updateVacancyStatusToReadvertiseFromProfileArrived

    //this methode is used to update vacancy status from profile arrived to readvertise
    //and also set profile arrived & applicant registeration to NULL
    public TransactionResponse updateVacancyStatusToReadvertiseFromProfileArrived()
    {
        TransactionResponse response = new TransactionResponse();
        bool isUpdated = false;
        try
        {
            try
            {
                //Add List of Arguments for new employee
                IDictionary<string, object> parameters = new Dictionary<string, object>();
                parameters.Add("@vacancy_No", vacancy.VacancyNo.Trim());
                parameters.Add("@posted_date ", vacancy.PostedDate.Trim());
                parameters.Add("@status", vacancy.Status);
                parameters.Add("@vancy_deadline", vacancy.VancyDeadline);

                DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spReadvertiseVacFromProfileArr, parameters);
                isUpdated = dpOperation.updateRecord();
            }
            //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);
                LoggerManager.upDateWithGenericErrorMessage(response);
            }

            if (isUpdated)
            {
                response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
                response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_SUCCESS);
                response.setSuccess(true);
            }
            else
            {
                response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
                response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_FAIL);
                response.setErrorCode(DBOperationErrorConstants.E_VACANCY_READVERTISE_FAILED);
                response.setSuccess(true);
            }
        }
        catch (SqlException ex)
        {
            //Other SqlException is catched
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.M_VACANCY_READVERTISED_FAIL);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
            response.setSuccess(false);
        }
        return response;
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:52,代码来源:VacancyRegistrationAndEvaluationManager.cs

示例5: updateVacancyEvaluation

    public TransactionResponse updateVacancyEvaluation()
    {
        //Add List of Arguments for new employee
        IDictionary<string, object> vacancyParameters = new Dictionary<string, object>();

        vacancyParameters.Add("@vacancyNo", vacancy.VacancyNo);
        vacancyParameters.Add("@postedDate", vacancy.PostedDate);
        vacancyParameters.Add("@responsibleProcessor_EID", vacancy.ResponsibleProcessorEID);
        vacancyParameters.Add("@reponsibleAccessorEID", vacancy.ResponsibleAccessorEID);
        vacancyParameters.Add("@processorStartDate", vacancy.ProcessorStartDate);
        vacancyParameters.Add("@processorEendDate", vacancy.ProcessorEndDate);
        vacancyParameters.Add("@accessorStartDate", vacancy.AccessorStartDate);
        vacancyParameters.Add("@accessorEndDate", vacancy.AccessorEndDate);
        vacancyParameters.Add("@status", vacancy.Status);

        //Pass Stored Procedure Name and parameter list.
        DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spUpdateVacancyEvaluators, vacancyParameters);
        TransactionResponse response = new TransactionResponse();
        try
        {
            //call update to DB mathod and get reponse.
            dpOperation.updateRecord();
            response.setSuccess(true);
            response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
            response.setMessage(DBOperationErrorConstants.M_VACANCY_ASSIGNED_SUCCESS);
        }

        catch (SqlException ex)
        {
            //Other SqlException is catched
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_UPDATE_VACANCY);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
        }

        //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);
            LoggerManager.upDateWithGenericErrorMessage(response);
        }
        return response;
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:44,代码来源:VacancyRegistrationAndEvaluationManager.cs

示例6: updateProfileArrivedDateAndVacancyStatus

    /*
     * Update Profile arrived date.
     */
    public TransactionResponse updateProfileArrivedDateAndVacancyStatus()
    {
        TransactionResponse response = new TransactionResponse();
        try
        {
            //Add List of Arguments for new employee
            IDictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("@vacancy_No", vacancy.VacancyNo);
            parameters.Add("@posted_date ", vacancy.PostedDate);

            DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spUpdateProfileArrivedDate, parameters);
            //COUNT NUMBER OF ROW UPDATED.
            bool updateProfDate = dpOperation.updateRecord();
            if (updateProfDate)
            {
                response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
                response.setMessage(DBOperationErrorConstants.M_PROFILE_DATE_REGISTERED);
                response.setSuccess(true);
            }
            else
            {
                response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
                response.setMessage(DBOperationErrorConstants.M_PROFILE_DATE_NOT_REGISTERED);
                response.setErrorCode(DBOperationErrorConstants.E_PROFILE_ARRIVED_DATE_UPDATE_FAILED);
                response.setSuccess(true);
            }
        }
        catch (SqlException ex)
        {
            //Other SqlException is catched
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.E_PROFILE_ARRIVED_DATE_UPDATE_FAILED);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
            response.setSuccess(false);
        }
        //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);
            LoggerManager.upDateWithGenericErrorMessage(response);
        }
        return response;
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:47,代码来源:VacancyRegistrationAndEvaluationManager.cs

示例7: updateApplicantsEvaluationStatus

    public TransactionResponse updateApplicantsEvaluationStatus(DataTable dataTable, string newStatus, int ranklimit)
    {
        //update Vacancy status
        bool vacancyStatusUpsateOk = false;
        TransactionResponse response = new TransactionResponse();

        try
        {
            vacancyStatusUpsateOk = sendVacancyUpdateStatus(new TransactionResponse());
        }
        catch (SqlException ex)
        {
            //Other SqlException is catched
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_UPDATE_APP_EVA_STATUS);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
            return response;
        }
        //vacancy update is not OK, we stop the flow.
        if (!vacancyStatusUpsateOk)
        {
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_UPDATE_APP_EVA_STATUS);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
            return response;
        }

        //convert the data in datatable, specifically in EID column to list of string separated by comma
        string listOfApplicants = DBOperationsUtil.getDataTableColumnAsListOfString(dataTable, "Employee ID", "Rank", ranklimit);

        //Add List of Arguments for new employee
        IDictionary<string, object> parameters = new Dictionary<string, object>();

        parameters.Add("@vacancyNo", vacancy.VacancyNo);
        parameters.Add("@vacancyDate", vacancy.PostedDate);
        parameters.Add("@newStatus", newStatus);
        parameters.Add("@listOfApplicants", listOfApplicants);

        //Pass Stored Procedure Name and parameter list.
        DBOperationsUtil dpOperation = new DBOperationsUtil(DbAccessConstants.spUpdateAppicantsStatus, parameters);

        try
        {
            //call update to DB mathod and get reponse.
            dpOperation.updateRecord();
            response.setSuccess(true);
            response.setMessageType(TransactionResponse.SeverityLevel.SUCESS);
            response.setMessage(DBOperationErrorConstants.M_APPLICANTS_PASSED_SUCCESS);
        }

        catch (SqlException ex)
        {
            //Other SqlException is catched
            response.setMessageType(TransactionResponse.SeverityLevel.ERROR);
            response.setMessage(DBOperationErrorConstants.M_UNKNOWN_ERROR_UPDATE_APP_EVA_STATUS);
            response.setErrorCode(DBOperationErrorConstants.E_UNKNOWN_ERROR_AT_DB_OOPERATION);
        }

        //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);
            LoggerManager.upDateWithGenericErrorMessage(response);
        }
        return response;
    }
开发者ID:ETH-WORKS-DASHBOARD,项目名称:CBEHR,代码行数:67,代码来源:VacancyRegistrationAndEvaluationManager.cs


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