本文整理汇总了C#中WSCIEMP.Common.CWarning类的典型用法代码示例。如果您正苦于以下问题:C# WSCIEMP.Common.CWarning类的具体用法?C# WSCIEMP.Common.CWarning怎么用?C# WSCIEMP.Common.CWarning使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WSCIEMP.Common.CWarning类属于命名空间,在下文中一共展示了WSCIEMP.Common.CWarning类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: btnDeletePDF_Click
protected void btnDeletePDF_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnDeletePDF_Click";
try {
//------------------------------------------
// Delete the PDF File.
//------------------------------------------
string locLastPdf = ((MasterReportTemplate)Page.Master).LocLastPDF;
string fileName = Page.MapPath(locLastPdf);
if (System.IO.File.Exists(fileName)) {
System.IO.File.Delete(fileName);
Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), "Successfully deleted " + fileName + ".");
} else {
Common.CWarning warn = new WSCIEMP.Common.CWarning("PDF file not found on file system.");
throw (warn);
}
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((MasterReportTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:26,代码来源:Certificate.aspx.cs
示例2: 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
示例3: 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
示例4: 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
示例5: 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
示例6: btnAdd_Click
protected void btnAdd_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnAdd_Click";
try {
//----------------------------------------------------------------------
// Use the constructor to clean up state values, especially from grid.
//----------------------------------------------------------------------
ListEquityDeductionItem state = new ListEquityDeductionItem(
"",
txtEDedNumber.Text,
txtEDedDescription.Text,
(chkEDedIsActive.Checked ? "Y" : "N"),
"");
string tmpNum = state.DeductionNumber;
int deductionNumber = 0;
try {
deductionNumber = Convert.ToInt32(tmpNum);
}
catch {
Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a positive number for Deduction Number.");
throw (warn);
}
if (deductionNumber == 0) {
Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a Deduction Number to a number greater than zero.");
throw (warn);
}
if (state.DeductionDescription.Length == 0) {
Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a Deduction Description.");
throw (warn);
}
string userName = Common.AppHelper.GetIdentityName();
BeetEquityDeduction.EquityDeductionSave(Convert.ToInt32(state.EquityDeductionID), Convert.ToInt32(state.DeductionNumber),
state.DeductionDescription, state.IsActiveAsBool(), state.RowVersion, userName);
ResetEquityDeductionEdit();
FillEqDeductionGrid();
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:48,代码来源:CoopEquityDeduction.aspx.cs
示例7: btnAddDeduction_Click
protected void btnAddDeduction_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnAddDeduction_Click";
try {
GridViewRow row = grdPayment.SelectedRow;
if (row == null) {
Common.CWarning warn = new WSCIEMP.Common.CWarning("Before pressing Add, please select a Payment from the Available Equity Payments grid.");
throw (warn);
}
//--------------------------------------------------
// Marry a Member to a Deduction and a payment.
//--------------------------------------------------
int equityCropYear = Convert.ToInt32(row.Cells[(int)PaymentGridCols.colEquityCropYear].Text);
string equityType = row.Cells[(int)PaymentGridCols.colEquityType].Text;
int sequence = Convert.ToInt32(row.Cells[(int)PaymentGridCols.colSequence].Text);
string paymentDesc = row.Cells[(int)PaymentGridCols.colPaymentDesc].Text;
int equityDeductionID = Convert.ToInt32(Common.UILib.GetDropDownValue(ddlEquityDeductions));
int memberID = Convert.ToInt32(MyMemberID);
int cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));
string amountText = txtDeductionAmount.Text.TrimEnd().Replace(BLANK_CELL, "");
decimal deductionAmount = 0;
try {
deductionAmount = Convert.ToDecimal(amountText);
}
catch {
Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a positive number for Deduction Amount.");
throw (warn);
}
string userName = Common.AppHelper.GetIdentityName();
DateTime deductionDate = Convert.ToDateTime(DateTime.Now.ToShortDateString());
BeetEquityDeduction.EquityDeductionMemberSave(0, memberID, equityDeductionID,
equityCropYear, cropYear, equityType, sequence, paymentDesc, deductionAmount, deductionDate, "", userName);
ClearEdit();
FillGridEqDeduction(MySHID, cropYear);
}
catch (Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:47,代码来源:MemberEquityDeduction.aspx.cs
示例8: btnUserEditSave_Click
protected void btnUserEditSave_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnUserEditSave_Click";
try {
int userID = 0;
if (grdUserResults.SelectedRow == null) {
WSCIEMP.Common.CWarning warn = new WSCIEMP.Common.CWarning("Please select a user from the User Search Results");
throw (warn);
} else {
userID = Convert.ToInt32(grdUserResults.SelectedRow.Cells[0].Text);
}
// Save User's Region assignments and Role assignments
bool isActive = chkUserEditIsActive.Checked;
string roles = "";
foreach (ListItem li in lstUserEditRole.Items) {
if (li.Selected) {
if (roles.Length == 0) {
roles = li.Value;
} else {
roles += "," + li.Value;
}
}
}
string regions = "";
foreach (ListItem li in lstUserEditRegion.Items) {
if (li.Selected) {
if (regions.Length == 0) {
regions = li.Value;
} else {
regions += "," + li.Value;
}
}
}
WSCSecurity.UserSecuritySave(userID, isActive, roles, regions);
FillUserSearchGrid();
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:47,代码来源:Security.aspx.cs
示例9: 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
示例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: 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
示例12: 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
示例13: 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
示例14: btnFactorySave_Click
protected void btnFactorySave_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnFactorySave_Click";
try {
int regionID = 0;
if (ddlFactoryRegion.SelectedItem == null) {
WSCIEMP.Common.CWarning warn = new WSCIEMP.Common.CWarning("Please select Region from the list.");
throw (warn);
} else {
if (ddlFactoryRegion.SelectedItem.Text.ToUpper() == "ALL COOP") {
WSCIEMP.Common.CWarning warn = new WSCIEMP.Common.CWarning("Please do not associate factories to the region All Coop.");
throw (warn);
}
regionID = Convert.ToInt32(ddlFactoryRegion.SelectedItem.Value);
}
string factories = "";
foreach (ListItem li in lstFactory.Items) {
if (li.Selected) {
if (factories.Length == 0) {
factories = li.Value;
} else {
factories += "," + li.Value;
}
}
}
WSCSecurity.UserSecurityRegionFactorySave(regionID, factories);
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:37,代码来源:Security.aspx.cs
示例15: GetEquityPaymentExport
public static SqlDataReader GetEquityPaymentExport(SqlConnection conn, int paymentCropYear, bool isPatronage, string paymentType, string paymentDate,
ref System.Data.SqlClient.SqlParameter outParam)
{
const string METHOD_NAME = "GetEquityPaymentExport";
SqlDataReader dr = null;
try {
if (isPatronage) {
string procName = "bawpPatronagePaymentExport";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams = SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = paymentCropYear;
spParams[1].Value = paymentType;
spParams[2].Value = paymentDate;
outParam = spParams[3];
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 {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, sqlEx);
throw (wscEx);
}
}
} else {
string procName = "bawpRetainPaymentExport";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = paymentCropYear;
spParams[1].Value = paymentDate;
outParam = spParams[2];
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 {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, sqlEx);
throw (wscEx);
}
}
}
}
catch (System.Exception e) {
if (dr != null && !dr.IsClosed) {
dr.Close();
}
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, e);
throw (wscEx);
}
return dr;
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:79,代码来源:WSCPayment.cs
示例16: CalculatePayment
public static void CalculatePayment(SqlConnection conn,
Decimal trialSugarContent, Decimal trialSLMPct, Decimal trialNetReturn, int cropYear,
ref Decimal qcBeetPaymentPerTon, ref Decimal oldNorthBeetPaymentPerTon,
ref Decimal oldSouthBeetPaymentPerTon)
{
const string METHOD_NAME = "CalculatePayment: ";
try {
string procName = "bawpPaymentCalculator";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = trialSugarContent;
spParams[1].Value = trialSLMPct;
spParams[2].Value = trialNetReturn;
spParams[3].Value = cropYear;
SetTimeout();
try {
SqlHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, procName, spParams);
qcBeetPaymentPerTon = Convert.ToDecimal(spParams[4].Value);
oldNorthBeetPaymentPerTon = Convert.ToDecimal(spParams[5].Value);
oldSouthBeetPaymentPerTon = Convert.ToDecimal(spParams[6].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 {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, sqlEx);
throw (wscEx);
}
}
}
catch (System.Exception e) {
WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, e);
throw (wscEx);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:44,代码来源:WSCPayment.cs
示例17: GetBeet1099Export
public static List<List1099ExportItem> GetBeet1099Export(int calendarYear)
{
const string METHOD_NAME = "GetBeet1099Export";
List<List1099ExportItem> state = new List<List1099ExportItem>();
try {
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
string procName = "bawpPayment1099Export";
if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); }
System.Data.SqlClient.SqlParameter[] spParams =
SqlHelperParameterCache.GetSpParameterSet(conn, procName, false);
spParams[0].Value = calendarYear;
int iSHID = 0, iTaxID = 0, iBusinessName = 0, iAddress1 = 0, iAddress2 = 0, iCity = 0, iState = 0, iZip = 0, iDollars = 0;
using (SqlDataReader dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams)) {
while (dr.Read()) {
if (iSHID == 0) {
iSHID = dr.GetOrdinal("cShid");
iTaxID = dr.GetOrdinal("cTaxID");
iBusinessName = dr.GetOrdinal("cBusName");
iAddress1 = dr.GetOrdinal("cAddress1");
iAddress2 = dr.GetOrdinal("cAddress2");
iCity = dr.GetOrdinal("cCity");
iState = dr.GetOrdinal("cState");
iZip = dr.GetOrdinal("cZip");
iDollars = dr.GetOrdinal("cDollars");
}
state.Add(new List1099ExportItem(dr.GetString(iSHID), dr.GetString(iTaxID), dr.GetString(iBusinessName),
dr.GetString(iAddress1), dr.GetString(iAddress2), dr.GetString(iCity), dr.GetString(iState), dr.GetString(iZip), dr.GetString(iDollars)));
}
}
}
return state;
}
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,代码行数:60,代码来源:WSCPayment.cs
示例18: RptContractPayeeSummary1
public static SqlDataReader RptContractPayeeSummary1(SqlConnection conn, int cropYear, string shid)
{
const string METHOD_NAME = "RptContractPayeeSummary1: ";
SqlDataReader dr = null;
string shidList = null;
string shidLo = null;
string shidHi = null;
// Configure the appropriate shid passed parameters based on the incoming
// shid string.
if (shid == null || shid.Length == 0) {
WSCIEMP.Common.CWarning warn = new WSCIEMP.Common.CWarning("You must enter a SHID or a list or range of SHIDs.");
throw (warn);
}
try {
|
请发表评论