Ejemplo n.º 1
0
    public timesheetEntity getTimesheetDetails(string TransactionID)
    {
        logger.Debug("Service:getTimesheetDetails() called");
        logger.Info(string.Format("Transaction ID received as {0} to get details ", TransactionID));
        try
        {
            timesheetEntity result = new timesheetEntity();
            timesheetInterface getTS_SI = new timesheetInterface();
            result = getTS_SI.getTimesheetDetails_SI(TransactionID);
            return result;
        }
        catch (OracleException ex)
        {
            webServiceExHandling.ExceptionLog(ex);
            string mailBody = string.Format(timesheet_Constants.mail_BodyFormat, System.DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US")), TransactionID, ex.TargetSite.ToString(), ex.ToString());
            webServiceExHandling.Send_Email(timesheet_Constants.Email_Dic, mailBody);

            timesheetEntity Error = new timesheetEntity(0);
            Error.TS_headerDetails.ErrorCode = ex.Code;
            string expCode = ExpType(ex);
            Error.TS_headerDetails.ErrorMessage = timesheet_Constants.cnfgErrMessages[expCode];

            logger.Error(string.Format(" ErrorCode : {0}", Error.TS_headerDetails.ErrorCode.ToString()));
            logger.Error(string.Format(" ErrorMessage : {0}", Error.TS_headerDetails.ErrorMessage));
            logger.Error(string.Format(" ErrorStack : {0}", ex.StackTrace));
            logger.Error("Service:getTimesheetDetails() returning error");
            return Error;

        }

        catch (Exception ex)
        {

            webServiceExHandling.ExceptionLog(ex);
            string mailBody = string.Format(timesheet_Constants.mail_BodyFormat, System.DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US")), TransactionID, ex.TargetSite.ToString(), ex.ToString());
            webServiceExHandling.Send_Email(timesheet_Constants.Email_Dic, mailBody);

            timesheetEntity Error = new timesheetEntity(0);
            Error.TS_headerDetails.ErrorCode = 1;
            Error.TS_headerDetails.ErrorMessage = timesheet_Constants.Error;

            logger.Error(string.Format(" ErrorCode : {0}", Error.TS_headerDetails.ErrorCode.ToString()));
            logger.Error(string.Format(" ErrorMessage : {0}", Error.TS_headerDetails.ErrorMessage));
            logger.Error(string.Format(" ErrorStack : {0}", ex.StackTrace));
            logger.Error("Service:getTimesheetDetails() returning error");
            return Error;
        }
    }
Ejemplo n.º 2
0
    public ts_UpdateOutputEntity updateTimesheetEntry([XmlElement("TS_Input")] ts_UpdateInputEntity[] TS_Entry)
    {
        logger.Debug("Service:updateTimesheetEntry() called");
        logger.Debug(string.Format("Transaction ID received as {0} for update  ", TS_Entry[0].TransactionID.ToString()));

        ts_UpdateOutputEntity result = new ts_UpdateOutputEntity();;

        try
        {
            timesheetInterface updateTS_IS = new timesheetInterface();
            result = updateTS_IS.updateTimesheetEntry_SI(TS_Entry);
            return result;
        }
        catch (OracleException ex)
        {
            webServiceExHandling.ExceptionLog(ex);
            string mailBody = string.Format(timesheet_Constants.mail_BodyFormat, System.DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US")), TS_Entry[0].TransactionID.ToString(), ex.TargetSite.ToString(), ex.ToString());
            webServiceExHandling.Send_Email(timesheet_Constants.Email_Dic, mailBody);

            result.StatusFlag = 1;
            string expCode = ExpType(ex);
            result.Message = timesheet_Constants.cnfgErrMessages[expCode];

            logger.Error(string.Format(" ErrorCode : {0}", result.StatusFlag.ToString()));
            logger.Error(string.Format(" ErrorMessage : {0}", result.Message));
            logger.Error(string.Format(" ErrorStack : {0}", ex.StackTrace));
            logger.Error("Service:updateTimesheetEntry() returning error");

            return result;

        }
        catch (Exception ex)
        {
            webServiceExHandling.ExceptionLog(ex);
            string mailBody = string.Format(timesheet_Constants.mail_BodyFormat, System.DateTime.Now.ToString("dd-MMM-yyyy", CultureInfo.CreateSpecificCulture("en-US")), getTransID(TS_Entry), ex.TargetSite.ToString(), ex.ToString());
            webServiceExHandling.Send_Email(timesheet_Constants.Email_Dic, mailBody);

            result.StatusFlag = 1;
            result.Message = timesheet_Constants.Error;

            logger.Error(string.Format(" ErrorCode : {0}", result.StatusFlag.ToString()));
            logger.Error(string.Format(" ErrorMessage : {0}", result.Message));
            logger.Error(string.Format(" ErrorStack : {0}", ex.StackTrace));
            logger.Error("Service:updateTimesheetEntry() returning error");

            return result;
        }
    }