Exemplo n.º 1
0
        public bool InsertFDRBulkImport(DOGEN_FDR objDOGEN_FDR, out string errorMessage)
        {
            bool isSuccess = false;

            errorMessage = string.Empty;
            try
            {
                DALFDR objDAFDRUpload = new DALFDR();
                DOCMN_BackgroundProcessMaster bgpMaster = new DOCMN_BackgroundProcessMaster();

                ExceptionTypes result = objDAFDRUpload.InsertFDRBulkImport(objDOGEN_FDR, out errorMessage);

                if (result != ExceptionTypes.Success || !string.IsNullOrEmpty(errorMessage))
                {
                    return(isSuccess);
                }

                isSuccess = true;
            }
            catch (Exception ex)
            {
                BLCommon.LogError(2, MethodBase.GetCurrentMethod().Name, (long)ErrorModuleName.BulkUpload, (long)ExceptionTypes.Uncategorized, ex.Message.ToString(), errorMessage.ToString());
            }

            return(isSuccess);
        }
Exemplo n.º 2
0
        public ExceptionTypes InsertFDRStagingData(DOGEN_FDR objDOGEN_FDR, out string errorMessage)
        {
            // bool isSuccess = false;
            errorMessage = string.Empty;
            //try
            //{
            DALFDR objDAFDRUpload = new DALFDR();

            return(_retValue = objDAFDRUpload.InsertFDRStagingData(objDOGEN_FDR, out errorMessage));

            //if (result != ExceptionTypes.Success || !string.IsNullOrEmpty(errorMessage))
            //{
            //    return isSuccess;
            //}

            //isSuccess = true;
            //}
            //catch (Exception ex)
            //{
            //    errorMessage += ex.Message + ex.StackTrace;
            //}

            // return isSuccess;
        }
Exemplo n.º 3
0
        public ExceptionTypes InsertFDRStagingData(DOGEN_FDR objDOGEN_FDR, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@GEN_FDRBulkImportId";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.FDRBulkImportID;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                //DataTableReader drTable = new DataTableReader(objDOGEN_FDR.dtExcelData);
                DataSet ds = new DataSet("TVP_FDRStaging");
                ds.Tables.Add(objDOGEN_FDR.dtExcelData);
                string xmlData = ds.GetXml();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@XMLData";
                sqlParam.SqlDbType     = SqlDbType.NVarChar;
                sqlParam.Value         = xmlData;
                parameters.Add(sqlParam);

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);


                DataSet dsResult        = new DataSet();
                long    executionResult = 0;
                executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_INS_FDR_Staging, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                // executionResult = dah.ExecuteSelectSP(ConstantTexts.SP_USP_BGP_INS_FDR_Staging, parameters.ToArray(),out dsResult, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }

                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }
Exemplo n.º 4
0
        public ExceptionTypes InsertFDRBulkImport(DOGEN_FDR objDOGEN_FDR, out string errorMessage)
        {
            try
            {
                DAHelper dah           = new DAHelper();
                long     lErrocode     = 0;
                long     lErrorNumber  = 0;
                long     lRowsEffected = 0;
                DataSet  dsTable       = new DataSet();
                errorMessage = string.Empty;

                List <SqlParameter> parameters = new List <SqlParameter>();
                SqlParameter        sqlParam;

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@SubmissionId";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.SubmissionID;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ContractNumber";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.ContractNumber;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();


                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@TransactionType";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.TransactionTypeLValue;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ExcelFileName";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.ExcelFileName;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ExcelFilePath";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = objDOGEN_FDR.ExcelFilePath;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ImportStatusLkup";
                sqlParam.SqlDbType     = SqlDbType.BigInt;
                sqlParam.Value         = (long)ImportStatus.ReadyForImport;
                parameters.Add(sqlParam);
                sqlParam = new SqlParameter();

                sqlParam = new SqlParameter();
                sqlParam.ParameterName = "@ErrorMessage";
                sqlParam.SqlDbType     = SqlDbType.VarChar;
                sqlParam.Value         = string.Empty;
                sqlParam.Direction     = ParameterDirection.Output;
                sqlParam.Size          = 2000;
                parameters.Add(sqlParam);

                long executionResult = 0;
                executionResult = executionResult = dah.ExecuteDMLSP(ConstantTexts.SP_USP_BGP_INS_FDR_BulkImport, parameters.ToArray(), out lErrocode, out lErrorNumber, out lRowsEffected, out errorMessage);
                sqlParam        = parameters.FirstOrDefault(x => x.ParameterName == "@ErrorMessage");
                if (sqlParam != null && sqlParam.Value != null)
                {
                    errorMessage += sqlParam.Value.ToString();
                }
                if (executionResult == (long)ExceptionTypes.Success && string.IsNullOrEmpty(errorMessage))
                {
                    return(ExceptionTypes.Success);
                }
                else
                {
                    return(ExceptionTypes.UnknownError);
                }
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ExceptionTypes.UnknownError);
            }
        }