protected override bool ValidateInput() { if (this.txtUploadRptName.Text.Trim() == "") { WebInfoPublish.Publish(this, this.lblUploadRptName.Text + " $Error_Input_Empty", this.languageComponent1); return(false); } ReportViewFacade rptFacde = new ReportViewFacade(this.DataProvider); RptViewDesignMain rptMain = rptFacde.GetRptViewDesignMainByReportName(this.txtUploadRptName.Text.Trim().ToUpper()); if (rptMain != null) { bool bError = false; if (string.IsNullOrEmpty(this.GetRequestParam("requestid")) == false && rptMain.ReportID != this.GetRequestParam("reportid")) { bError = true; } if (this.designView == null || this.designView.DesignMain == null) { bError = true; } if (this.designView != null && this.designView.DesignMain != null && rptMain.ReportID != this.designView.DesignMain.ReportID) { bError = true; } if (bError == true) { WebInfoPublish.Publish(this, "$ReportDesign_ReportName_Exist [" + this.txtUploadRptName.Text + "]", this.languageComponent1); return(false); } } return(true); }
protected override bool ValidateInput() { if (fileRpt.PostedFile == null || fileRpt.PostedFile.FileName == "") { if (this.designView.DesignMain != null && (string.IsNullOrEmpty(this.designView.DesignMain.ReportFileName) == false || string.IsNullOrEmpty(this.designView.UploadFileName) == false)) { return(true); } throw new Exception("$Error_UploadFileIsEmpty"); } string strUploadFileName = fileRpt.PostedFile.FileName; string strExt = strUploadFileName.Substring(strUploadFileName.LastIndexOf(".")); if (fileRpt.PostedFile.FileName.ToLower().EndsWith(".rdl") == false && fileRpt.PostedFile.FileName.ToLower().EndsWith(".rdlc") == false) { throw new Exception("$ReportUpload_Invalid_FileName"); } if (this.txtUploadRptName.Text.Trim() == "") { WebInfoPublish.Publish(this, this.lblUploadRptName.Text + " $Error_Input_Empty", this.languageComponent1); return(false); } ReportViewFacade rptFacde = new ReportViewFacade(this.DataProvider); RptViewDesignMain rptMain = rptFacde.GetRptViewDesignMainByReportName(this.txtUploadRptName.Text.Trim()); if (rptMain != null) { bool bError = false; if (string.IsNullOrEmpty(this.GetRequestParam("requestid")) == false && rptMain.ReportID != this.GetRequestParam("reportid")) { bError = true; } if (this.designView == null || this.designView.DesignMain == null) { bError = true; } if (this.designView != null && this.designView.DesignMain != null && rptMain.ReportID != this.designView.DesignMain.ReportID) { bError = true; } if (bError == true) { WebInfoPublish.Publish(this, "$ReportDesign_ReportName_Exist [" + this.txtUploadRptName.Text + "]", this.languageComponent1); return(false); } } return(true); }