private void LoadCBC(decimal id) { var cbcr = DBReadManager.GetIncomingPackagePerCBC(id); Session["subdata"] = cbcr; gvCBC.Bind(cbcr); }
private static void SendNotification(decimal submissionId) { var submission = DBReadManager.GeFileSubmissionById(submissionId); if (submission == null) { return; } var files = DBReadManager.GetFilesPerSubmission(submissionId.ToString(CultureInfo.InvariantCulture)); var roles = DbReader.GetRolesToNotify(); if (roles.HasRows) { var x = (from s in roles.Tables[0].Rows.OfType <DataRow>() select s["EmailAddress"].ToString()).ToArray(); var fileList = new StringBuilder(); //fileList.Append("<ul>"); foreach (DataRow file in files.Tables[0].Rows) { fileList.AppendFormat("<li>{0} - {1}</li>", file["Category"], file["Classification"]); } //fileList.Append("</ul>"); var messageBody = string.Format( File.ReadAllText("FileArrivalNotification.htm") , submission.TaxRefNo , submission.Year , fileList , SARSDataSettings.Settings.ApplicationName); FdrCommon.SendEmail(x, messageBody, "CBC Declaration"); } }
public static string CreateSoapRegistrationQuery(string message, string taxRefNo, string messageId) { var sb = new StringBuilder(); sb.Append( "<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:esb=\"http://www.egovernment.gov.za/GMD/MessageIdentification/xml/schemas/version/7.1\">"); sb.Append("<soap12:Header>"); var header = new MessageIdentificationStructure { channelID = "FDR", applicationID = "EnquirePartyDetails", messageSeqNo = DBReadManager.GetNextMessageId(messageId), messageTimeStamp = DateTime.Now, externalReferenceID = taxRefNo, originatingChannelID = "FDR", universalUniqueID = messageId, versionNo = Convert.ToSingle("3.3"), domain = "PartyMgt", activityName = "Enquire Party Details", priority = 9 }; var headerXml = Sars.Systems.Serialization.XmlObjectSerializer.GetXmlWithNoDeclaration(header); sb.Append(headerXml); sb.Append("</soap12:Header>"); sb.Append("<soap12:Body>"); sb.AppendFormat("{0}", message); sb.Append("</soap12:Body>"); sb.Append("</soap12:Envelope>"); return(sb.ToString()); }
protected void FileOpenCommand(object sender, CommandEventArgs e) { if (e.CommandArgument != null) { var btn = sender as LinkButton; if (btn == null) { return; } var row = btn.NamingContainer as GridViewRow; if (row == null) { return; } var gv = row.NamingContainer as GridView; if (gv == null) { return; } gv.SelectedIndex = row.RowIndex; if (gv.SelectedDataKey != null) { if (_fileSubmission == null) { _fileSubmission = DBReadManager.GeFileSubmissionById(Convert.ToDecimal(SubmissionId)); } var fileId = gv.SelectedDataKey.Value; Response.Redirect(string.Format("outgoingfiledetails.aspx?oId={0}&fId={1}&submissionId={2}&refNo={3}", e.CommandArgument, fileId, SubmissionId, _fileSubmission.TaxRefNo)); } } }
public static string GetEfilingRejectionLetter(string taxRefNo, int year, decimal submissionId) { var templatesPath = HttpContext.Current.Request.PhysicalApplicationPath; if (templatesPath == null) { return(null); } var rejectionTemplate = Path.Combine(templatesPath, "letters", Configurations.RejectionLetterTemplate); if (!File.Exists(rejectionTemplate)) { return(null); } var content = File.ReadAllText(rejectionTemplate); var files = DBReadManager.GetDeclinedFilesForSsubmission(submissionId); if (!files.HasRows) { return(null); } var builder = new StringBuilder(); //builder.Append("<ul>"); foreach (DataRow dataRow in files.Tables[0].Rows) { builder.AppendFormat("<br />-<span style=\"xfa - spacerun:yes;\"> {0} / {1}</span>", dataRow["Category"], dataRow["Classification"]); } //builder.Append("</ul>"); return(string.Format(content, year, builder)); }
protected void ddlCountryList_SelectedIndexChanged(object sender, EventArgs e) { var coutryCode = ddlCountryList.SelectedValue; ddlReportingPeriod.Bind(DBReadManager.GetAllReportingPeriods(coutryCode), "ReportingPeriod", "ID"); LoadCBC(); }
private void downLoadExcel(decimal mspecId, string country) { var dsData = DBReadManager.GetIncomingForeignXml(mspecId); if (dsData != null) { var doc = new XmlDocument(); var messageSpecDoc = new XmlDocument(); var oecd = doc.CreateNode(XmlNodeType.Element, "CBC_OECD", null); var messagespec = doc.CreateNode(XmlNodeType.Element, "MessageSpec", null); messageSpecDoc.LoadXml(dsData.Tables[0].Rows[0][1].ToString()); var msgSpecification = messageSpecDoc.SelectSingleNode("MessageSpec_Type"); messagespec.InnerXml = msgSpecification.InnerXml; oecd.AppendChild(messagespec); foreach (DataRow row in dsData.Tables[0].Rows) { var xmlDoc = new XmlDocument(); xmlDoc.LoadXml(row[0].ToString()); var cbcBody = doc.CreateNode(XmlNodeType.Element, "CbcBody", null); var cbcReport = xmlDoc.SelectSingleNode("CbcBody_Type"); cbcBody.InnerXml = cbcReport.InnerXml; oecd.AppendChild(cbcBody); } doc.AppendChild(oecd); } }
private void LoadCBC() { var declarations = DBReadManager.GetViewedCbcDeclarations(); Session["declarations"] = declarations; gvCBC.Bind(declarations); }
protected void btnDownloadXcel_Click(object sender, EventArgs e) { if (Request.QueryString["xCountry"] != null & Request.QueryString["Period"] != null) { var countryCode = Request.QueryString["xCountry"].ToString(); var reportingPeriod = Request.QueryString["Period"].ToString(); var outCBC = DBReadManager.OutGoingCBCDeclarationsDetails(countryCode, reportingPeriod); int statusId = string.IsNullOrEmpty(Request.QueryString["StatusId"]) ? 0 : int.Parse(Request.QueryString["StatusId"].ToString()); if (fp.IsUserInRole("Reviewer") && statusId == 2) { btnApprove.Visible = true; } if (fp.IsUserInRole("Approver") && statusId == 3) { btnApprove.Visible = true; btnReject.Visible = true; } if (outCBC.UID != null) { string fullURL = "window.open('../queueMonitors/MANUAL/CbCReport.aspx?UID=" + outCBC.UID + "&src=OUT ', '_blank', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,titlebar=no' );"; //string fullURL = "window.open('CbCReport.aspx?UID=" + outCBC.UID + "&src=OUT ', '_blank', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,titlebar=no' );"; System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true); // Response.Redirect(string.Format("~/queueMonitors/MANUAL/CbCReport.aspx?UID={0}&src=OUT", outCBC.UID)); } } }
private void LoadCBCHsitory(string countryCode, string reportingPeriod) { var cbcr = DBReadManager.GetOutgoingPackageHistory(countryCode, reportingPeriod); Session["subhistorydata"] = cbcr; gvCBCHistory.Bind(cbcr); }
private void LoadCBC(string CountryCode, string reportingPeriod, int statusId = 0) { var cbcr = DBReadManager.GetOutgoingCBCReportPackaged(CountryCode, reportingPeriod, statusId); Session["subdata"] = cbcr; gvCBC.Bind(cbcr); }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(SubmissionId)) { MessageBox.Show("Could not retrieve documents - Submission ID is missing"); return; } if (!IsPostBack) { _fileSubmission = DBReadManager.GeFileSubmissionById(Convert.ToDecimal(SubmissionId)); LoadFiles(); if (_fileSubmission != null) { if (_fileSubmission.SubmissionStatusId == 3 || _fileSubmission.SubmissionStatusId == 4 || _fileSubmission.SubmissionStatusId == 5) { btnSave.Enabled = false; btnSubmit.Enabled = false; } else { btnSave.Enabled = true; btnSubmit.Enabled = true; } } if (gvLocalFiles.Rows.Count == 0 && gvMasterFiles.Rows.Count == 0) { btnSave.Enabled = false; btnSubmit.Enabled = false; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gvMNE.Bind(DBReadManager.GetSentLetters()); } }
protected void btnDownloadXcel_Click(object sender, EventArgs e) { //System.Threading.Thread.Sleep(1000); if (Request.QueryString["idx"] == null) { return; } var mspecId = Request.QueryString["idx"].ToString(); var xmlResults = DBReadManager.GetMessageSpecById(decimal.Parse(mspecId)); if (xmlResults.UID != null) { string fullURL = "window.open('../queueMonitors/MANUAL/CbCReport.aspx?UID=" + xmlResults.UID + "&src=IN ', '_blank', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,titlebar=no' );"; System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true); //string fullURL = "window.open('CbCReport.aspx?UID=" + xmlResults.UID + "&src=IN ', '_blank', 'status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,titlebar=no' );"; //Response.Redirect(string.Format("~/queueMonitors/MANUAL/CbCReport.aspx?UID={0}&src=IN", xmlResults.UID)); } if (fp.IsUserInRole("Reviewer")) { int?statusId = int.Parse(Request.QueryString["statusIdx"].ToString()); var id = decimal.Parse(Request.QueryString["idx"].ToString()); var mspec = DBReadManager.GetMessageSpecById(id); if (mspec != null) { if (mspec.StatusID > 0) { statusId = mspec.StatusID; } } if (statusId == 1) { btnApprove.Visible = true; } } if (fp.IsUserInRole("Approver")) { int?statusId = int.Parse(Request.QueryString["statusIdx"].ToString()); var id = decimal.Parse(Request.QueryString["idx"].ToString()); var mspec = DBReadManager.GetMessageSpecById(id); if (mspec != null) { if (mspec.StatusID > 0) { statusId = mspec.StatusID; } } if (statusId == 3) { btnApprove.Visible = true; btnReject.Visible = true; } } // Response.Redirect(string.Format("~/queueMonitors/MANUAL/CbCReport.aspx?UID={0}&src=IN", results.UID)); }
private void LoadCBC(string reportingPeriod, string TaxRefNo) { var cbcr = DBReadManager.GetPackagesToBeCorrected(reportingPeriod, TaxRefNo); gvCBC.Bind(cbcr); Session["cbcr"] = cbcr; //btnCorrect.Visible = cbcr.HasRows; }
protected void btnSearch_Click(object sender, EventArgs e) { var data = DBReadManager.SearchSubmissions(!string.IsNullOrEmpty(txtTaxRefNo.Text) ? txtTaxRefNo.Text : null, !string.IsNullOrEmpty(txtYear.Text) ? txtYear.Text : null); Session["subdata"] = data; gvMNE.Bind(data); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var xml = DBReadManager.GetLetterXml(Request["Id"]); txtXml.SetValue(FdrCommon.FormatXml(xml)); } }
private void LoadCBC() { string countryCode = ddlCountryList.SelectedIndex > 0 ? ddlCountryList.SelectedValue : null; string reportingPeriod = ddlReportingPeriod.SelectedIndex > 0 ? ddlReportingPeriod.SelectedValue : null; var cbcr = DBReadManager.GetOutGoingCBCR(countryCode, reportingPeriod, 8); Session["subdata"] = cbcr; gvCBC.Bind(cbcr); }
private void LoadCBC() { string countryCode = ddlCountryList.SelectedIndex > 0 ? ddlCountryList.SelectedValue : null; string period = string.IsNullOrEmpty(txtReportingPeriod.Text) ? null : txtReportingPeriod.Text; var cbcr = DBReadManager.GetVerifiedOutGoingCBCs(countryCode, period); Session["subdata"] = cbcr; gvCBC.Bind(cbcr); }
private void LoadCBC() { string countryCode = ddlCountryList.SelectedIndex > 0 ? ddlCountryList.SelectedValue : null; int year = ddlYears.SelectedIndex > 0 ? int.Parse(ddlYears.SelectedValue) : 0; var cbcr = DBReadManager.GetOutGoingCBCR(countryCode, year.ToString(), 3); Session["subdata"] = cbcr; gvCBC.Bind(cbcr); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadCBC(); Common.GetAllForeignCountries(ddlCountryList); ddlReportingPeriod.Bind(DBReadManager.GetAllIncomingReportingPeriods(), "ReportingPeriod", "ID"); } }
private void bindData(DataSet users = null) { if (users == null) { users = DBReadManager.GetAllUsers(); } Session["userData"] = users; gvUsers.Bind(users); }
protected void gvMasterFiles_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.DataRow) { return; } var ddlOutcome = e.Row.FindControl("ddlOutcome") as DropDownList; var txtOutcomeReason = e.Row.FindControl("txtOutcomeReason") as TextBox; if (ddlOutcome != null && txtOutcomeReason != null) { ddlOutcome.Bind(DBReadManager.GetFileValidationOutcomes(), "Description", "ID"); var fileId = DataBinder.Eval(e.Row.DataItem, "FileId"); if (fileId != null) { var details = DBReadManager.GeFileValidationOutcomeDetailsByFileId(Convert.ToDecimal(fileId)); if (details != null) { ddlOutcome.SelectItemByValue(details.ValidationOutcomeId); txtOutcomeReason.SetValue(details.OutcomeReason); } } if (_fileSubmission == null) { _fileSubmission = DBReadManager.GeFileSubmissionById(Convert.ToDecimal(SubmissionId)); } if (_fileSubmission.SubmissionStatusId == 3 || _fileSubmission.SubmissionStatusId == 4 || _fileSubmission.SubmissionStatusId == 5) { ddlOutcome.Enabled = false; } else { ddlOutcome.Enabled = true; } } var category = DataBinder.Eval(e.Row.DataItem, "Category").ToString(); var fileName = DataBinder.Eval(e.Row.DataItem, "FileName").ToString(); var body = new StringBuilder(); body.Append("<table style='width:100%;padding:5px'><tr style='background:khaki;'>"); body.Append("<td><b>Category:</b></td>"); body.AppendFormat("<td>{0}</td>", category); body.Append("</tr>"); body.Append("<tr style='background:khaki;'>"); body.Append("<td><b>File Name:</b></td>"); body.AppendFormat("<td>{0}</td>", fileName); body.Append("</tr>"); body.Append("</table>"); e.Row.Attributes.Add("title", "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[<b><font color='blue'>More Details</font></b>] body=[" + body + "]"); }
protected void btnSearch_Click(object sender, EventArgs e) { var taxRefNo = txtTexRefNo.FieldValue != null ? txtTexRefNo.Text : null; var year = !string.IsNullOrEmpty(txtYear.Text) ? Convert.ToInt32(txtYear.Text) : 0; var declarations = DBReadManager.GetViewedCbcDeclarations(taxRefNo, year); gvCBC.Bind(declarations); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var data = DBReadManager.GetSubmissionsByStatus(2); Session["subdata"] = data; gvMNE.Bind(data); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["prevPage"] = Request.UrlReferrer; Common.GetAllForeignCountries(ddlCountryList); ddlReportingPeriod.Bind(DBReadManager.GetAllIncomingReportingPeriods(), "ReportingPeriod", "ID"); LoadCBC(); } }
public static DataSet searchUser(string searchText) //, GridView grid) { DataSet dsUsers = new DataSet(); dsUsers.DataSetName = "Users"; var results = DBReadManager.SearchUser(searchText, pageIndex, pageSize); dsUsers = results.Copy(); return(dsUsers); }
private void Enquire(object state) { //ReaqEnquireQueue(); //var x = new FDRWebService {UseDefaultCredentials = true}; var equireResults = DBReadManager.EnquireMne("3198510568"); var xml = Sars.Systems.Serialization.XmlObjectSerializer.GetXml(equireResults, true); //SendResutstoEFL(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlReportingPeriod.Bind(DBReadManager.GetAllReportingPeriods(), "ReportingPeriod", "ID"); Common.GetAllCountries(ddlCountryList); ddlCountryList.SelectedValue = string.IsNullOrEmpty(Request.QueryString["xCountry"]) ? "-99999" : Request.QueryString["xCountry"].ToString(); ddlReportingPeriod.SelectedValue = string.IsNullOrEmpty(Request.QueryString["Period"]) ? "-99999" : Request.QueryString["Period"].ToString(); ViewState["prevPage"] = Request.UrlReferrer; LoadCBC(); } }
protected void btnSearch_Click(object sender, EventArgs e) { var data = DBReadManager.GetSubmissionsByStatus(2, !string.IsNullOrEmpty(txtTaxRefNo.Text) ? txtTaxRefNo.Text : null, !string.IsNullOrEmpty(txtYear.Text) ? txtYear.Text : null); if (!data.HasRows) { MessageBox.Show("No File Submission found for tax Ref No: " + txtTaxRefNo.Text); } Session["subdata"] = data; gvMNE.Bind(data); }