本文整理汇总了C#中WSCIEMP.Common.CException类的典型用法代码示例。如果您正苦于以下问题:C# WSCIEMP.Common.CException类的具体用法?C# WSCIEMP.Common.CException怎么用?C# WSCIEMP.Common.CException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WSCIEMP.Common.CException类属于命名空间,在下文中一共展示了WSCIEMP.Common.CException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReportPackager
public static string ReportPackager(string paymentCropYear, string fileName, string logoUrl, string pdfTempfolder)
{
const string METHOD_NAME = "ReportPackager";
DirectoryInfo pdfDir = null;
string filePath = "";
try {
pdfDir = new DirectoryInfo(pdfTempfolder);
// Build the output file name by getting a list of all PDF files
// that begin with this session ID: use this as a name incrementer.
if (Path.GetExtension(fileName) == "") {
fileName += ".csv";
}
filePath = pdfDir.FullName + @"\" + fileName;
ReportBuilder(Convert.ToInt32(paymentCropYear), filePath);
return filePath;
}
catch (System.Exception ex) {
string errMsg = "";
WSCIEMP.Common.CException wscex = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME + ": " + errMsg, ex);
throw (wscex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:28,代码来源:rptBeet1099.cs
示例2: DeleteContractDirtTable
public static void DeleteContractDirtTable(int cropYear)
{
try {
using (OLEDB.OleDbConnection msConn =
new OLEDB.OleDbConnection(Globals.BeetExportConnectionString())) {
string qry = "ContractDirtDelete";
if (msConn.State != System.Data.ConnectionState.Open) { msConn.Open(); }
using (OLEDB.OleDbCommand cmd = new OLEDB.OleDbCommand(qry, msConn)) {
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("pCropYear", OLEDB.OleDbType.Integer, 0).Value = cropYear;
cmd.ExecuteNonQuery();
}
}
}
catch (Exception ex) {
string errMsg = MOD_NAME + "DeleteContractDirtTable";
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, ex);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:25,代码来源:WSCFieldExport.cs
示例3: ReportPackager
public static string ReportPackager(string paymentCropYear, bool isPatronage, string paymentType, string paymentDate, ref string warnings,
string fileName, string logoUrl, string pdfTempfolder)
{
DirectoryInfo pdfDir = null;
string filePath = "";
try {
pdfDir = new DirectoryInfo(pdfTempfolder);
// Build the output file name by getting a list of all PDF files
// that begin with this session ID: use this as a name incrementer.
if (Path.GetExtension(fileName) == "") {
fileName += ".csv";
}
filePath = pdfDir.FullName + @"\" + fileName;
ReportBuilder(Convert.ToInt32(paymentCropYear), isPatronage, paymentType, paymentDate, filePath, ref warnings);
return filePath;
}
catch (System.Exception ex) {
string errMsg = "Payment Crop Year: " + paymentCropYear + "; " +
"Is Patronage: " + isPatronage.ToString() + "; " +
"Payment Type: " + paymentType + "; " +
"Payment Date: " + paymentDate + "; " +
"fileName: " + fileName + "; " +
"pdfDir is null: " + (pdfDir == null).ToString() + "; " +
"filesPath: " + filePath;
WSCIEMP.Common.CException wscex = new WSCIEMP.Common.CException("MReports.rptEquityPayment: " + errMsg, ex);
throw (wscex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:34,代码来源:rptEquityPayment.cs
示例4: ReportPackager
public static string ReportPackager(string cropYear, string startContractNumber, string stopContractNumber, string fileName, string logoUrl, string pdfTempfolder)
{
DirectoryInfo pdfDir = null;
string filePath = "";
try {
pdfDir = new DirectoryInfo(pdfTempfolder);
// Build the output file name by getting a list of all PDF files
// that begin with this session ID: use this as a name incrementer.
if (Path.GetExtension(fileName) == "") {
fileName += ".csv";
}
filePath = pdfDir.FullName + @"\" + fileName;
ReportBuilder(Convert.ToInt32(cropYear), Convert.ToInt32(startContractNumber),
Convert.ToInt32(stopContractNumber), filePath);
return filePath;
}
catch (System.Exception ex) {
string errMsg = "cropYear: " + cropYear + "; " +
"start contract number: " + startContractNumber + "; " +
"stop contract number: " + stopContractNumber + "; " +
"fileName: " + fileName + "; " +
"pdfDir is null: " + (pdfDir == null).ToString() + "; " +
"filesPath: " + filePath;
WSCIEMP.Common.CException wscex = new WSCIEMP.Common.CException("MReports.rptContractCards.ReportPackager: " + errMsg, ex);
throw (wscex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:33,代码来源:rptContractCards.cs
示例5: GetContract
public static Contract GetContract(int contractNo, int cropYear)
{
const string METHOD_NAME = "GetContract";
Contract contract = null;
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "s70cnt_GetContract";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = contractNo;
spParams[1].Value = cropYear;
try {
using (SqlDataReader dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams)) {
int iContarctID = dr.GetOrdinal("cnt_contract_id");
int iCropYear = dr.GetOrdinal("cnt_crop_year");
int iContractNo = dr.GetOrdinal("cnt_contract_no");
int iFactoryId = dr.GetOrdinal("cnt_factory_id");
int iPACDues = dr.GetOrdinal("cnt_pack_dues");
while (dr.Read()) {
int contractId = dr.GetInt32(iContarctID);
int crop_year = Convert.ToInt32(dr.GetDateTime(iCropYear).Year);
int contract_no = Convert.ToInt32(dr.GetString(iContractNo));
int factory_id = dr.GetInt32(iFactoryId);
double pac_dues = Convert.ToDouble(dr.GetDecimal(iPACDues));
contract = new Contract(contractId, crop_year, contract_no, factory_id, pac_dues);
}
}
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
}
}
catch (System.Exception e) {
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
return contract;
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:59,代码来源:BeetDataContract.cs
示例6: IsMemberAgriculturist
public static bool IsMemberAgriculturist(int userID, int shid, int cropYear)
{
const string METHOD_NAME = "IsMemberAgriculturist";
string errMsg = "";
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "bawpEmpIsMemAgriculturist";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = userID;
spParams[1].Value = shid;
spParams[2].Value = cropYear;
SetTimeout();
SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, procName, spParams);
if (spParams[3].Value == System.DBNull.Value) {
return false;
} else {
return Convert.ToBoolean(spParams[3].Value);
}
}
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
errMsg = MOD_NAME + METHOD_NAME + LF +
"UserID: " + userID.ToString() +
"SHID: " + shid.ToString() +
"CropYear: " + cropYear.ToString();
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
catch (System.Exception e) {
if (errMsg.Length == 0) {
errMsg = MOD_NAME + METHOD_NAME + LF +
"UserID: " + userID.ToString() +
"SHID: " + shid.ToString() +
"CropYear: " + cropYear.ToString();
} else {errMsg = "";}
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:57,代码来源:WSCEmployee.cs
示例7: GetMemberInfo
public static void GetMemberInfo(string shid, int cropYear, ref int memberID, ref int addressID, ref string busName, ref string phone, ref string email, ref string fax,
ref int factoryID, ref int factoryNumber, ref string factoryName)
{
const string METHOD_NAME = "GetMemberInfo";
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "bawpMemberGetBeetInfo";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
// Manually synch these fields with database.
int imemberID = 0, iaddressID = 1, ibusname = 2, ipone = 3, iemail = 4, ifax = 5, ifactoryID = 6, ifactoryNumber = 7, ifactoryName = 8;
spParams[0].Value = shid;
spParams[1].Value = cropYear;
using (SqlDataReader dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams)) {
if (dr.Read()) {
memberID = dr.GetInt32(imemberID);
addressID = dr.GetInt32(iaddressID);
busName = dr.GetString(ibusname);
phone = dr.GetString(ipone);
email = dr.GetString(iemail);
fax = dr.GetString(ifax);
factoryID = dr.GetInt32(ifactoryID);
factoryNumber = dr.GetInt32(ifactoryNumber);
factoryName = dr.GetString(ifactoryName);
}
}
}
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
string errMsg = MOD_NAME + METHOD_NAME + LF + "SHID: " + shid;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
catch (System.Exception e) {
string errMsg = MOD_NAME + METHOD_NAME + LF + "SHID: " + shid;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:55,代码来源:BeetDataMember.cs
示例8: OverPlantFactoryByNumber
public static List<ListOverPlantFactoryItem> OverPlantFactoryByNumber(int cropYear, int factoryNumber)
{
const string METHOD_NAME = "OverPlantFactoryByNumber";
List<ListOverPlantFactoryItem> state = new List<ListOverPlantFactoryItem>();
try {
string procName = "bawpOverPlantFactoryByNumber";
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams = SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = cropYear;
spParams[1].Value = factoryNumber;
using (SqlDataReader dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams)) {
int iftyNum = dr.GetOrdinal("FactoryNumber");
int iftyName = dr.GetOrdinal("FactoryName");
int iisOverPlantAllow = dr.GetOrdinal("IsOverPlantAllowed");
int ipct = dr.GetOrdinal("OverPlantPct");
int iisPoolAllowed = dr.GetOrdinal("IsPoolAllowed");
int ipoolCutoffDate = dr.GetOrdinal("PoolCutoffDate");
if (dr.Read()) {
state.Add(new ListOverPlantFactoryItem(dr.GetInt32(iftyNum).ToString(), dr.GetString(iftyName), dr.GetBoolean(iisOverPlantAllow),
dr.GetDecimal(ipct), dr.GetBoolean(iisPoolAllowed), "", dr.GetString(ipoolCutoffDate), false));
}
}
}
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
throw (sqlEx);
}
}
}
catch (System.Exception ex) {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, ex);
throw (wscEx);
}
return state;
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:53,代码来源:BeetDataOverPlant.cs
示例9: ReportPackager
public static string ReportPackager(
int cropYear, int paymentNumber, string paymentDescription,
string fromDate, string toDate, string statementDate,
string factoryList, string stationList, string contractList,
bool isCumulative, string fileName, string logoUrl, string pdfTempfolder)
{
const string METHOD_NAME = "rptTransmittal.ReportPackager: ";
DirectoryInfo pdfDir = null;
FileInfo[] pdfFiles = null;
string filePath = "";
try {
pdfDir = new DirectoryInfo(pdfTempfolder);
// Build the output file name by getting a list of all PDF files
// that begin with this session ID: use this as a name incrementer.
pdfFiles = pdfDir.GetFiles(fileName + "*.pdf");
fileName += "_" + Convert.ToString(pdfFiles.Length + 1) + ".pdf";
filePath = pdfDir.FullName + @"\" + fileName;
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
using (SqlDataReader dr = WSCPayment.GetTransmittalPayment(conn,
cropYear, paymentNumber, factoryList, stationList, contractList, isCumulative)) {
using (System.IO.FileStream fs = new FileStream(filePath, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.Read)) {
ReportBuilder(dr, cropYear, paymentNumber, paymentDescription, fromDate, toDate, statementDate, isCumulative, logoUrl, fs);
}
}
}
}
catch (System.Exception ex) {
string errMsg = "cropYear: " + cropYear.ToString();
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(METHOD_NAME + errMsg, ex);
throw (wscEx);
}
return filePath;
}
catch (System.Exception ex) {
string errMsg = "cropYear: " + cropYear.ToString() + "; " +
"Payment Number: " + paymentNumber.ToString();
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(METHOD_NAME + errMsg, ex);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:52,代码来源:rptTransmittal.cs
示例10: BankDelete
public static void BankDelete(int bankID, string UserName)
{
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "bawpBankDelete";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = bankID;
spParams[1].Value = UserName;
SetTimeout();
using (SqlTransaction tran = conn.BeginTransaction()) {
try {
SqlHelper.ExecuteNonQuery(tran, CommandType.StoredProcedure, procName, spParams);
tran.Commit();
}
catch (SqlException sqlEx) {
if (tran != null) {
tran.Rollback();
}
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
string errMsg = MOD_NAME + "BankDelete";
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
}
}
}
catch (System.Exception e) {
string errMsg = MOD_NAME + "BankDelete";
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:44,代码来源:WSCBank.cs
示例11: GetRehaulFactoryStationData
public static RehaulFactoryStationData GetRehaulFactoryStationData(int factoryID, DateTime rehaulDate)
{
const string METHOD_NAME = "GetRehaulFactoryStationData";
string cacheKey = "RehaulFactoryStationData";
string filePath = "";
RehaulFactoryStationData rehaulData = null;
try {
rehaulData = (RehaulFactoryStationData)HttpRuntime.Cache.Get(cacheKey);
if (rehaulData == null) {
rehaulData = new RehaulFactoryStationData();
filePath = WSCIEMP.Common.AppHelper.AppPath() + @"ZHost/XML/RehaulFactoryStation.xml";
rehaulData.Load(filePath);
HttpRuntime.Cache.Insert(cacheKey, rehaulData, new CacheDependency(filePath));
}
// Always check database for data.
SqlDataReader dr = null;
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LimsConn"].ToString())) {
string procName = "stapRehaulDailyGetEntry";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = factoryID;
spParams[1].Value = rehaulDate;
dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams);
rehaulData.FillFactoryDetail((factoryID * 10).ToString(), dr);
}
return rehaulData;
}
catch (Exception ex) {
string errMsg = MOD_NAME + METHOD_NAME + "; factoryID: " + factoryID.ToString() + "; rehaulDate: " + rehaulDate.ToString();
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, ex);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:44,代码来源:LimsEx.cs
示例12: AddressFindName
public static SqlDataReader AddressFindName(SqlConnection conn, string addressName)
{
const string METHOD_NAME = "AddressFindName";
SqlDataReader dr = null;
try {
string procName = "bawpAddressFindByName";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = addressName;
SetTimeout();
try {
dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams);
}
catch (SqlException sqlEx) {
if (dr != null && !dr.IsClosed) {
dr.Close();
}
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
}
catch (System.Exception e) {
if (dr != null && !dr.IsClosed) {
dr.Close();
}
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
return dr;
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:44,代码来源:WSCAdmin.cs
示例13: GetAddress
public static void GetAddress(int memberID,
ref string email, ref string fax, ref string busName)
{
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "bawpUserGetAddress";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = memberID;
SetTimeout();
SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, procName, spParams);
email = spParams[1].Value.ToString();
fax = spParams[2].Value.ToString();
busName = spParams[3].Value.ToString();
}
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
string errMsg = MOD_NAME + "GetAddress";
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
catch (System.Exception e) {
string errMsg = MOD_NAME + "GetAddress";
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:41,代码来源:WSCMember.cs
示例14: AppErrorFileDelete
public static void AppErrorFileDelete(int appErrorInfoID)
{
const string METHOD_NAME = "AppErrorFileDelete";
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "srspAppErrorInfoDelete";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = appErrorInfoID;
try {
using (SqlTransaction tran = conn.BeginTransaction()) {
SqlHelper.ExecuteNonQuery(tran, CommandType.StoredProcedure, procName, spParams);
tran.Commit();
}
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx);
throw (wscEx);
}
}
}
}
catch (System.Exception e) {
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:40,代码来源:AppError.cs
示例15: DirectDeliveryContractDelete
public static void DirectDeliveryContractDelete(int directDeliveryID, int cropYear, int contractID, string rowVersion)
{
const string METHOD_NAME = "DirectDeliveryContractDelete";
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "bawpDirectDeliveryContractDelete";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = directDeliveryID;
spParams[1].Value = cropYear;
spParams[2].Value = contractID;
spParams[3].Value = rowVersion;
try {
SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, procName, spParams);
}
catch (SqlException sqlEx) {
if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) {
WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx);
throw (wscWarn);
} else {
throw (sqlEx);
}
}
}
}
catch (System.Exception ex) {
string errMsg = MOD_NAME + METHOD_NAME;
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, ex);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:38,代码来源:BeetDirectDelivery.cs
示例16: ReportPackager
public static string ReportPackager(int cropYear, string shid, string fromShid,
string toShid, string fileName, string logoUrl, string pdfTempfolder)
{
const string METHOD_NAME = "ReportPackager: ";
DirectoryInfo pdfDir = null;
FileInfo[] pdfFiles = null;
string filePath = "";
try {
try {
pdfDir = new DirectoryInfo(pdfTempfolder);
// Build the output file name by getting a list of all PDF files
// that begin with this session ID: use this as a name incrementer.
pdfFiles = pdfDir.GetFiles(fileName + "*.pdf");
fileName += "_" + Convert.ToString(pdfFiles.Length + 1) + ".pdf";
filePath = pdfDir.FullName + @"\" + fileName;
ReportBuilder(cropYear, shid, fromShid, toShid, filePath, logoUrl);
}
catch (System.Exception ex) {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + "." + METHOD_NAME, ex);
throw (wscEx);
}
return filePath;
}
catch (System.Exception ex) {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + "." + METHOD_NAME, ex);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:37,代码来源:rptNoticeOfPassthrough.cs
示例17: ReportPackager
public static string ReportPackager(
int cropYear, int shid, string contractNumbers, bool isCSV, string fileName, string logoUrl, string pdfTempfolder)
{
DirectoryInfo pdfDir = null;
FileInfo[] pdfFiles = null;
string filePath = "";
string fileExtension = (isCSV ? ".csv" : ".pdf");
//string fileName = shid.ToString() + "_TonTrkCnt_" + DateTime.Now.ToString("yyMMddHHmmss") + (isCSV ? ".csv" : ".pdf");
try {
pdfDir = new DirectoryInfo(pdfTempfolder);
// Build the output file name by getting a list of all PDF files
// that begin with this session ID: use this as a name incrementer.
pdfFiles = pdfDir.GetFiles(fileName + "*" + fileExtension);
fileName += "_" + Convert.ToString(pdfFiles.Length + 1) + fileExtension;
filePath = pdfDir.FullName + @"\" + fileName;
ReportBuilder(cropYear, shid, contractNumbers, isCSV, filePath);
return filePath;
}
catch (System.Exception ex) {
string errMsg = "cropYear: " + cropYear + "; " +
"Contract numbers: " + contractNumbers + "; " +
"fileName: " + fileName + "; " +
"pdfDir is null: " + (pdfDir == null).ToString() + "; " +
"pdfFiles is null: " + (pdfFiles == null).ToString() + "; " +
"filesPath: " + filePath;
WSCIEMP.Common.CException wscex = new WSCIEMP.Common.CException("HReports.rptTonsByTruckByContract.ReportPackager: " + errMsg, ex);
throw (wscex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:36,代码来源:rptTonsByTruckByContract.cs
示例18: ReportBuilder
private static void ReportBuilder(int paymentCropYear, string filePath)
{
const string METHOD_NAME = "ReportBuilder";
const string QUOTE = "\"";
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
List<List1099ExportItem> stateList = WSCPayment.GetBeet1099Export(paymentCropYear);
using (StreamWriter sw = new StreamWriter(filePath, false)) {
foreach (List1099ExportItem state in stateList) {
//SHID, TaxID, Business Name, Address 1, Address 2, City, State, Zip, Dollars
sw.Write(QUOTE + state.SHID + QUOTE + ",");
sw.Write(QUOTE + state.TaxID + QUOTE + ",");
sw.Write(QUOTE + state.BusName + QUOTE + ",");
sw.Write(QUOTE + state.Address1 + QUOTE + ",");
sw.Write(QUOTE + state.Address2 + QUOTE + ",");
sw.Write(QUOTE + state.TaxCity + QUOTE + ",");
sw.Write(QUOTE + state.TaxState + QUOTE + ",");
sw.Write(QUOTE + state.TaxZip + QUOTE + ",");
sw.Write(QUOTE + state.TaxDollars + QUOTE + Environment.NewLine);
}
sw.Close();
}
}
}
catch (Exception ex) {
WSCIEMP.Common.CException wscex = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, ex);
throw (wscex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:36,代码来源:rptBeet1099.cs
示例19: ReportBuilder
//.........这里部分代码省略.........
// =======================================================
// Grower / Landowner NET Split
// =======================================================
PdfReports.AddText2Table(table, " ", normalFont, 9);
PdfReports.AddText2Table(table, "Grower Net", labelFont, 2);
totalGrowerNet += item.d_groAmount;
PdfReports.AddText2Table(table, item.d_groAmount.ToString("N2"), normalFont, "right");
PdfReports.AddText2Table(table, " ", normalFont);
PdfReports.AddText2Table(table, " ", normalFont, 9);
PdfReports.AddText2Table(table, "Landowner Net", labelFont, 2);
totalLandownerNet += item.d_ldoAmount;
PdfReports.AddText2Table(table, item.d_ldoAmount.ToString("N2"), normalFont, "right");
PdfReports.AddText2Table(table, " ", normalFont);
// BLANK LINE
PdfReports.AddText2Table(table, " ", normalFont, 13);
pgEvent.HeaderTableLayout = _primaryTableLayout;
PdfReports.AddTableNoSplit(document, pgEvent, table);
pgEvent.HeaderTableLayout = null;
//================================================================
// Add Deduction information
//================================================================
table = PdfReports.CreateTable(_primaryTableLayout, 1);
PdfReports.AddText2Table(table, " ", labelFont, 4);
PdfReports.AddText2Table(table, "Deduction", labelFont, "left", 4);
PdfReports.AddText2Table(table, "Payment",
|
请发表评论