//JIRA-908 Changes by Ravi on 13/02/2019 -- Start protected void btnYes_Click(object sender, EventArgs e) { try { string userRole = Session["UserRole"].ToString(); if (userRole.ToLower() == UserRole.SuperUser.ToString().ToLower()) { paymentDetailsBL = new PaymentDetailsBL(); paymentDetailsBL.CreateAPInterface(); paymentDetailsBL = null; if (errorId == 0) { msgView.SetMessage("Job to create AP interface has been triggered.", MessageType.Warning, PositionType.Auto); } else if (errorId == 2) { msgView.SetMessage("Failed to trigger job to create AP interface.", MessageType.Warning, PositionType.Auto); } } else { msgView.SetMessage("AP interface can only be created by a SuperUser", MessageType.Warning, PositionType.Auto); } } catch (Exception ex) { ExceptionHandler("Error in trigger job to create AP interface.", ex.Message); } }
private void LoadData() { paymentDetailsBL = new PaymentDetailsBL(); DataSet initialData = paymentDetailsBL.GetInitialData(out errorId); paymentDetailsBL = null; if (initialData.Tables.Count != 0 && errorId != 2) { ddlStatus.DataSource = initialData.Tables[0]; ddlStatus.DataTextField = "status_desc"; ddlStatus.DataValueField = "status_code"; ddlStatus.DataBind(); ddlStatus.Items.Insert(0, new ListItem("-")); dtEmpty = new DataTable(); gvPaymentDetails.EmptyDataText = "No data is displayed initially."; gvPaymentDetails.DataSource = dtEmpty; gvPaymentDetails.DataBind(); } else { ExceptionHandler("Error in fetching filter list data", string.Empty); } }
private void SearchPaymentDetails() { Page.Validate("valSearch"); if (!Page.IsValid) { dtEmpty = new DataTable(); BindGrid(dtEmpty); msgView.SetMessage("Invalid search input!", MessageType.Warning, PositionType.Auto); return; } string paymentDate = string.Empty; string statusCode = string.Empty; if (txtPaymentDate.Text.Trim() != "__/__/____") { paymentDate = txtPaymentDate.Text.Trim(); } if (ddlStatus.SelectedIndex > 0) { statusCode = ddlStatus.SelectedValue; } //WUIN-1079 string supplierNumber = ""; string supplierSiteName = ""; if (txtSupplier.Text != "") { supplierNumber = txtSupplier.Text.Split('-')[0].ToString().Trim(); supplierSiteName = txtSupplier.Text.Split('-')[1].ToString().Trim(); } paymentDetailsBL = new PaymentDetailsBL(); //JIRA-1048 Changes to handle single quote while searching --Start DataSet searchedData = paymentDetailsBL.GetSearchedData(txtPaymentNo.Text.Replace("'", "").Trim(), paymentDate, statusCode, supplierNumber, supplierSiteName, txtPaymentThreshold.Text.Trim(), txtPaymentFilename.Text.Replace("'", "").Trim(), txtRoyaltor.Text.Split('-')[0].ToString().Trim(), out errorId); //JIRA-1048 Changes to handle single quote while searching --End paymentDetailsBL = null; if (searchedData.Tables.Count != 0 && errorId != 2) { BindGrid(searchedData.Tables[0]); } else { ExceptionHandler("Error in fetching payment details search data", string.Empty); } }
//JIRA-746 CHanges by Ravi on 05/03/2019 -- End protected void btnSupplierSearch_Click(object sender, EventArgs e) { try { paymentDetailsBL = new PaymentDetailsBL(); DataSet supplierList = paymentDetailsBL.GetSupplierList(txtSupplier.Text, out errorId); paymentDetailsBL = null; if (supplierList.Tables.Count != 0 && errorId != 2) { if (supplierList.Tables[0].Rows.Count == 0) { gvSupplierSearchList.DataSource = supplierList.Tables[0]; gvSupplierSearchList.EmptyDataText = "No data found for the entered text"; gvSupplierSearchList.DataBind(); } else { gvSupplierSearchList.DataSource = supplierList.Tables[0]; gvSupplierSearchList.DataBind(); //set pop up panel and gridview panel height pnlSupplierSearchPopup.Style.Add("height", (Convert.ToDouble(hdnGridPnlHeight.Value) * 0.75).ToString()); plnGridSupplierSearch.Style.Add("height", (Convert.ToDouble(hdnGridPnlHeight.Value) * 0.75 - 100).ToString()); } } else if (supplierList.Tables.Count == 0 && errorId != 2) { dtEmpty = new DataTable(); gvSupplierSearchList.DataSource = dtEmpty; gvSupplierSearchList.EmptyDataText = "No data found for the entered text"; gvSupplierSearchList.DataBind(); } else { ExceptionHandler("Error in supplier search data", string.Empty); } mpeSupplierSearch.Show(); } catch (Exception ex) { mpeSupplierSearch.Hide(); ExceptionHandler("Error in supplier search data", ex.Message); } }