本文整理汇总了C#中Common.CException类的典型用法代码示例。如果您正苦于以下问题:C# Common.CException类的具体用法?C# Common.CException怎么用?C# Common.CException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Common.CException类属于命名空间,在下文中一共展示了Common.CException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoPrintReady
private void DoPrintReady(object sender, CommandEventArgs e)
{
const string METHOD_NAME = "DoPrintReady";
try {
WSCSecurity auth = Globals.SecurityState;
string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
string fileName = auth.UserID + "_" + ((MasterReportTemplate)Master).ReportName.Replace(" ", "");
string reportDate = txtCpsReportDate.Text;
string cropYear = ((MasterReportTemplate)Master).CropYear;
string shid = txtCpsSHID.Text;
if (reportDate == null || reportDate.Length == 0 || !Common.CodeLib.IsDate(reportDate)) {
Common.CWarning warn = new Common.CWarning("You must enter a valid report date, mm/dd/yyyy");
throw (warn);
}
WSCReports.rptContractPayeeSummary rpt = new WSCReports.rptContractPayeeSummary();
string pdf = rpt.ReportPackager(Int32.Parse(cropYear), DateTime.Parse(reportDate), shid, fileName, logoUrl, pdfTempFolder);
if (pdf.Length > 0) {
// convert file system path to virtual path
pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
}
((MasterReportTemplate)sender).LocPDF = pdf;
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((MasterReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例2: DoPrintReady
private void DoPrintReady(object sender, CommandEventArgs e)
{
const string METHOD_NAME = "DoPrintReady";
try {
WSCSecurity auth = Globals.SecurityState;
string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
string fileName = auth.UserID + "_" + ((HarvestReportTemplate)Master).ReportName.Replace(" ", "");
int cropYear = Convert.ToInt32(((HarvestReportTemplate)Master).CropYear);
string shid = ((HarvestReportTemplate)Master).SHID.ToString();
DateTime activityFromDate = DateTime.MinValue;
DateTime activityToDate = DateTime.MinValue;
bool isLienInfoWanted = false;
WSCReports.rptEquityStatement rptEqStmt = new WSCReports.rptEquityStatement();
string pdf = rptEqStmt.ReportPackager(cropYear, DateTime.Now, shid, false, fileName, logoUrl, pdfTempFolder,
activityFromDate, activityToDate, isLienInfoWanted);
if (pdf.Length > 0) {
// convert file system path to virtual path
pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
}
((HarvestReportTemplate)sender).LocPDF = pdf;
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((HarvestReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例3: btnPrintForm_Click
protected void btnPrintForm_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnPrintForm_Click";
try {
if (UsrCntSelector.IsChangedSHID) {
Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), "You changed the SHID without pressing the Find button. Please press Find.");
return;
}
// Give client the url to open the pdf
string filePath = "";
WSCSecurity auth = Globals.SecurityState;
string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
string fileName = auth.UserID + "_" + "Field Contracting".Replace(" ", "");
filePath = WSCReports.rptFieldContracting.ReportPackager(UsrCntSelector.CropYear, "", "", "", UsrCntSelector.FieldID.ToString(), auth.UserID, fileName, logoUrl, pdfTempFolder);
if (filePath.Length > 0) {
// convert file system path to virtual path
filePath = filePath.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
}
locPDF.Text = filePath;
}
catch (Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
const string METHOD_NAME = "Page_Load";
try {
Common.AppHelper.HideWarning(divWarning);
// This is really GREAT !!!
HtmlGenericControl script = new HtmlGenericControl("script");
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("src", Page.ResolveUrl("~/Script/Common.js"));
Page.Header.Controls.Add(script);
System.Collections.Specialized.NameValueCollection nv = Page.Request.QueryString;
MasterControlName.Text = nv["MasterControlName"];
ActionControlName.Text = nv["ActionControlName"];
Action.Text = nv["Action"];
lblTextEntryLabel.Text = nv["Label"];
string clickCtrl = (nv["clickCtrlName"] != null ? nv["clickCtrlName"].ToString() : "");
btnOk.Attributes.Add("onclick", "DoOk('" + clickCtrl + "');");
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
const string METHOD_NAME = "Page_Load";
try {
Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
//((MasterReportTemplate)Master).LocPDF = "";
lnkPaymentFile.Visible = false;
((MasterReportTemplate)Page.Master).CropYearChange += new CommandEventHandler(DoCropYearChange);
// Sink the Master page event, PrintReady
((MasterReportTemplate)Page.Master).PrintReady += new CommandEventHandler(DoPrintReady);
if (!Page.IsPostBack) {
FillPaymentNumber();
}
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((MasterReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例6: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnSave_Click";
int taxYear = 0;
int cropYear = 0;
bool ok = false;
try {
cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));
taxYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlTaxYear));
string tmp = txtRatePerTon.Text;
decimal ratePerTon = 0;
if (!Decimal.TryParse(tmp, out ratePerTon)) {
Common.CWarning warn = new Common.CWarning("Please enter a valid Rate Per Ton.");
throw (warn);
}
decimal percentToApply = 0;
tmp = txtPercentageToApply.Text;
if (!Decimal.TryParse(tmp, out percentToApply)) {
Common.CWarning warn = new Common.CWarning("Please enter a valid Percentage to Apply.");
throw (warn);
}
DateTime reportDate = DateTime.MinValue;
tmp = txtReportDate.Text;
if (tmp != "") {
if (!DateTime.TryParse(tmp, out reportDate)) {
Common.CWarning warn = new Common.CWarning("Please enter a valid Report Date.");
throw (warn);
}
}
DateTime fiscalYearEndDate = DateTime.MinValue;
tmp = txtFiscalYearEndDate.Text;
if (tmp != "") {
if (!DateTime.TryParse(tmp, out fiscalYearEndDate)) {
Common.CWarning warn = new Common.CWarning("Please enter a valid Fiscal Year End Date.");
throw (warn);
}
}
WSCAdmin.PassthroughAllSave(cropYear, taxYear, ratePerTon, percentToApply,
reportDate, fiscalYearEndDate, Globals.SecurityState.UserName);
ok = true;
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
if (ok) {
Response.Redirect("~/Admin/PassthroughManagement.aspx?YR=" + cropYear.ToString()
+ "&UpdateOk=true");
}
}
示例7: DoPrintReady
private void DoPrintReady(object sender, CommandEventArgs e)
{
const string METHOD_NAME = "DoPrintReady";
try {
WSCSecurity auth = Globals.SecurityState;
string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
string fileName = auth.UserID + "_" + ((HarvestReportTemplate)Master).ReportName.Replace(" ", "");
string cropYear = ((HarvestReportTemplate)Master).CropYear;
string shid = ((HarvestReportTemplate)Master).SHID.ToString();
string pdf = WSCReports.rptFieldSummary.ReportPackager(Convert.ToInt32(cropYear), "", "", "",
shid, "", "", auth.UserID, fileName, logoUrl, pdfTempFolder);
if (pdf.Length > 0) {
// convert file system path to virtual path
pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
}
((HarvestReportTemplate)sender).LocPDF = pdf;
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((HarvestReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
const string METHOD_NAME = "Page_Load";
Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
((HarvestReportTemplate)Master).LocPDF = "";
// Sink the Master page events...
((HarvestReportTemplate)Master).PrintReady += new CommandEventHandler(DoPrintReady);
((HarvestReportTemplate)Master).ShidChange += new CommandEventHandler(DoShidChange);
((HarvestReportTemplate)Master).CropYearChange += new CommandEventHandler(DoCropYearChange);
lstDgtdContract.Attributes.Add("onchange", "SetSubRefOptions(this," +
"'" + lstDgtdDeliveryDate.ClientID + "', " + "'" + lstDgtdRefDeliveryDate.ClientID + "');");
try {
System.Collections.Specialized.NameValueCollection nv = Page.Request.Form;
_deliveryDates = nv[lstDgtdDeliveryDate.ClientID.Replace("_", "$")];
if (_deliveryDates == null) { _deliveryDates = ""; }
if (!Page.IsPostBack) {
FillControls();
}
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((HarvestReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例9: 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);
}
}
示例10: DoPrintReady
private void DoPrintReady(object sender, CommandEventArgs e)
{
const string METHOD_NAME = "DoPrintReady";
try {
WSCSecurity auth = Globals.SecurityState;
string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
string fileName = txtFileName.Text;
// Get File Name
if (fileName.Length == 0) {
Common.CWarning warn = new Common.CWarning("Please enter a file name.");
throw (warn);
}
string pdf = "";
string cropYear = ((MasterReportTemplate)Master).CropYear;
pdf = WSCReports.rptBeet1099.ReportPackager(cropYear, fileName, logoUrl, pdfTempFolder);
if (pdf.Length > 0) {
// convert file system path to virtual path
pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
}
((MasterReportTemplate)sender).LocPDF = pdf;
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((MasterReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
const string METHOD_NAME = "Page_Load";
string filePath = "";
try {
using (DataSet dsForms = new DataSet()) {
filePath = MapPath(@"~/ZHost/XML/AlertForms.xml");
dlResults.Visible = false;
if (File.Exists(filePath)) {
dsForms.ReadXml(filePath);
// Condition the data as needed.
if (dsForms.Tables["AlertItem"].Rows.Count > 0) {
foreach (DataRow row in dsForms.Tables["AlertItem"].Rows) {
if (row["UpdateDate"].ToString().Length == 0) {
string url = row["Url"].ToString();
FileInfo fi = new FileInfo(MapPath(url));
DateTime updateDate = fi.LastWriteTime;
row["UpdateDate"] = updateDate.ToString("MMMM dd, yyyy");
}
row["Url"] = Page.ResolveUrl(row["Url"].ToString());
}
DataView dvForms = dsForms.Tables["AlertItem"].DefaultView;
dvForms.RowFilter = "IsActive = 1";
if (dvForms.Count > 0) {
dlResults.DataSource = dvForms;
dlResults.DataBind();
dlResults.Visible = true;
}
}
}
if (dlResults.Visible == false) {
divResults.Attributes.Add("style", "text-align: center;");
divResults.InnerHtml = "<br /><br /><br /><br /><br />Sorry, there are no current Announcements.<br /><br /><br /><br /><br /><br /><br /><br /><br />" +
"<br /><br /><br /><br />";
}
}
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
示例12: btnProcess_Click
protected void btnProcess_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "ddlCropYear_SelectedIndexChanged";
try {
DoProcessPayment();
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
示例13: btnAddFactor_Click
protected void btnAddFactor_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnAddFactor_Click";
try {
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
示例14: DoCropYearChange
private void DoCropYearChange(object sender, CommandEventArgs e)
{
const string METHOD_NAME = "DoPrintReady";
try {
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((MasterReportTemplate)Page.Master).ShowWarning(ex);
}
}
示例15: btnExport_Click
protected void btnExport_Click(object sender, EventArgs e)
{
const string METHOD_NAME = "btnExport_Click";
try {
int cropYear = Convert.ToInt32(ddlCropYear.SelectedValue);
// Jump to the appropriate export routine.
if (chkExportAll.Checked) {
WSCFieldExport.DeleteAllTables(cropYear);
WSCFieldExport.PopulateAllTables(cropYear);
} else {
if (chkExportAgronomy.Checked) {
WSCFieldExport.DeleteAgronomyTable(cropYear);
WSCFieldExport.PopulateAgronomyTable(cropYear);
}
if (chkExportContracting.Checked) {
WSCFieldExport.DeleteContractingTable(cropYear);
WSCFieldExport.PopulateContractingTable(cropYear);
}
if (chkExportReportCard.Checked) {
WSCFieldExport.PopulateGrowerPerformanceTable(cropYear);
}
if (chkExportDeletePerformance.Checked) {
WSCFieldExport.DeletePerformanceTable(cropYear);
}
if (chkExportDeleteDirt.Checked) {
WSCFieldExport.DeleteContractDirtTable(cropYear);
}
if (chkExportGenPerformance.Checked) {
WSCFieldExport.PopulateBeetAccountingPerformance(cropYear);
}
if (chkExportGenDirt.Checked) {
WSCFieldExport.PopulateBeetAccountingPerformance2(cropYear);
}
if (chkExportPerformanceData.Checked) {
WSCFieldExport.PopulatePerformanceTable(cropYear);
}
if (chkExportDirtData.Checked) {
WSCFieldExport.PopulateContractDirtTable(cropYear);
}
}
Common.AppHelper.ShowConfirmation((HtmlGenericControl)Master.FindControl("divWarning"), "Export is complete.");
}
catch (Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}