protected void btnDeleteReq_Click(object sender, EventArgs e) { POMain poMain = new POMain(); try { poMain.RequesterID = Convert.ToInt32(txtRequesterID.Text); poMain.CreatedBy = userName; int retOut = poMain.DeleteRequester(poMain); lblMessageError.Visible = true; if (retOut == 1) { ControlState(); lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; lblUpdateMessage.Text = "Data Successfully Deleted"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Data Deletion Failed " + txtRequesterID.Text; } } catch (Exception ex) { MessageError = ex.Message.ToString(); lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "<b>Your Transaction Failed: </b>" + MessageError; } }
protected void txtReqName_TextChanged(object sender, EventArgs e) { POMain poMain = new POMain(); DataSet ds = poMain.GetManagerEmailFromLDAP(txtReqName.Text); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { txtEmailID.Text = ds.Tables[0].Rows[i][1].ToString(); txtUserID.Text = ds.Tables[0].Rows[i][0].ToString(); } ModalPopupExtender1.Show(); lblValidation.Visible = false; BtnReqInsert.Visible = true; } else { txtReqName.Focus(); ModalPopupExtender1.Show(); lblValidation.Visible = true; lblValidation.Text = "Wrong User Name"; } }
protected void BtnEditShipTo_Click(object sender, EventArgs e) { POMain poMain = new POMain(); poMain.ShipToID = Convert.ToInt32(txtID.Text); poMain.ShipToName = txtCity.Text; poMain.ShipToAddress = txtAddress.Text; poMain.VAT = txtVAT.Text; poMain.NewAddress = txtAdditionalAddress.Text; poMain.CreatedBy = userName; int retOut = poMain.UpdateShipToDetails(poMain); lblMessageError.Visible = true; if (retOut == 1) { ControlState(); lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; lblUpdateMessage.Text = "Data Successfully Updated"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Failed while Updating Data" + txtID.Text; } }
protected void btnInsertNewProject_Click(object sender, EventArgs e) { POMain poMain = new POMain(); try { poMain.ProjectName = txtNewProject.Text; poMain.CreatedBy = userName; int retOut = poMain.InsertProject(poMain); if (retOut == 1) { lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; ControlState(); lblUpdateMessage.Text = "Data Successfully Inserted"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Project Already Exist....."; } } catch (Exception ex) { } }
public static List <string> GetShipToName(string prefixText, int count) { DataSet ds = new DataSet(); List <string> address = new List <string>(); try { ds = new POMain().GetShipToExtender(prefixText); string itemToAdd = string.Empty; foreach (DataRow dr in ds.Tables[0].Rows) { itemToAdd = dr["City"].ToString();//AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr["circuitid"].ToString(), dr["RecId"].ToString()); address.Add(itemToAdd); } //SqlConnection connection = new SqlConnection(); //connection.ConnectionString = DatabaseCredientials; //SqlCommand command = new SqlCommand("SpGetShipToExtender", connection); //command.CommandType = System.Data.CommandType.StoredProcedure; //command.Parameters.AddWithValue("@City", prefixText); //command.CommandText = "SpGetShipToExtender"; //connection.Open(); //using (SqlDataReader sdr = command.ExecuteReader()) //{ // while (sdr.Read()) // { // address.Add(sdr["City"].ToString()); // } //} //connection.Close(); } catch { } return(address); }
protected void btnSearchSupplier_Click(object sender, EventArgs e) { lblUpdateMessage.Visible = false; updSupplier.Visible = true; DataSet ds = new DataSet(); try { string supplier = txtSupplierearch.Text; ds = new POMain().GetSupplierDetails(supplier); lblSupplierID.Text = ds.Tables[0].Rows[0]["SupplierID"].ToString(); txtSuplierName.Text = ds.Tables[0].Rows[0]["CompanyName"].ToString(); txtMainNo.Text = ds.Tables[0].Rows[0]["MainNumber"].ToString(); txtFaxNo.Text = ds.Tables[0].Rows[0]["FaxNumber"].ToString(); txtContactPerson.Text = ds.Tables[0].Rows[0]["Personalcontact"].ToString(); txtPhNo.Text = ds.Tables[0].Rows[0]["Number"].ToString(); txtContactPerson1.Text = ds.Tables[0].Rows[0]["PersonalContact2"].ToString(); txtPhNo1.Text = ds.Tables[0].Rows[0]["Number2"].ToString(); txtAdd1.Text = ds.Tables[0].Rows[0]["Address1"].ToString(); txtAdd2.Text = ds.Tables[0].Rows[0]["Address2"].ToString(); txtAdd3.Text = ds.Tables[0].Rows[0]["Address3"].ToString(); txtAdd4.Text = ds.Tables[0].Rows[0]["Address4"].ToString(); txtAdd5.Text = ds.Tables[0].Rows[0]["Address5"].ToString(); txtCountry.Text = ds.Tables[0].Rows[0]["Country"].ToString(); txtComment.Text = ds.Tables[0].Rows[0]["Comment"].ToString(); txtTerm.Text = ds.Tables[0].Rows[0]["Term"].ToString(); } catch (Exception ex) { } }
protected void btnSearchBudgetCode_Click(object sender, EventArgs e) { divBudgCode.Visible = true; lblUpdateMessage.Visible = false; DataSet ds = new DataSet(); try { DataSet dsDept = new POSystemDataHandler().GetDepartment(); ddlDepartment.DataSource = dsDept; ddlDepartment.DataBind(); DataSet dsOrderClass = new POMain().GetOrderClassification(1); ddlOrderClassification.DataSource = dsOrderClass; ddlOrderClassification.DataBind(); DataSet dsStation = new POSystemDataHandler().GetStation(); ddlStation.DataSource = dsStation; ddlStation.DataBind(); ddlStation.Items.Insert(0, new ListItem("--Select--", "0")); string budgetCode = txtSearchBudgetCode.Text; ds = new POMain().GetBudgetCodeDetails(budgetCode); lblBudgetCodeID.Text = ds.Tables[0].Rows[0]["BudgetCodeID"].ToString(); txtBudgetCode.Text = ds.Tables[0].Rows[0]["BudgetCode"].ToString(); ddlDepartment.SelectedValue = ds.Tables[0].Rows[0]["Department"].ToString(); ddlOrderClassification.SelectedValue = ds.Tables[0].Rows[0]["OrderClassification"].ToString(); ddlStation.SelectedValue = ds.Tables[0].Rows[0]["Station"] != DBNull.Value ? ds.Tables[0].Rows[0]["Station"].ToString() : "0"; txtDescription.Text = ds.Tables[0].Rows[0]["Description"].ToString(); } catch (Exception ex) { } }
private void BindPOData(Int64 poId) { DataSet dsPOData = new DataSet(); dsPOData = new POMain().BindPOData(Convert.ToInt64(ViewState["EditPONumber"])); DataTable dt1 = null; try { lblRequesterName.Text = dsPOData.Tables[0].Rows[0]["RequesterName"].ToString(); string currency = dsPOData.Tables[0].Rows[0]["CurrencyName"].ToString(); dt1 = dsPOData.Tables[1].Copy(); dt1.Columns.Add("Currency"); foreach (DataRow row in dt1.Rows) { row["Currency"] = currency; } int supplier = Convert.ToInt32(dsPOData.Tables[0].Rows[0]["Supplier"]); BindSuppliersDetails(supplier); int shipTo = Convert.ToInt32(dsPOData.Tables[0].Rows[0]["ShipTo"]); ViewState["ShipTo"] = shipTo; BindShipToDetails(shipTo); lblPrintPODateEntered.Text = Convert.ToDateTime(dsPOData.Tables[0].Rows[0]["CreatedDate"]).ToString("yyyy-MM-dd"); grdPrintPOItems.DataSource = dt1; grdPrintPOItems.DataBind(); } catch (Exception ex) { } }
private void BindShipToDetails(int shipTo) { DataSet dsShipToDetails = new POMain().GetShipToDetailsByShipToId(shipTo); string address = dsShipToDetails.Tables[0].Rows[0]["Address"].ToString(); address = address.Replace("<br /><br />", "/r/n"); //address = address.Replace("\n\n", "<br />"); lblPrintPODeliverTo.Text += address;//"<br />" + address; DataSet dsAddnBillingAdd = new POMain().GetAdditionalBillingAddress(shipTo); if (dsAddnBillingAdd.Tables[0].Rows.Count != 0) { string addnBillingAdd = dsAddnBillingAdd.Tables[0].Rows[0]["NewAddress"].ToString(); if (addnBillingAdd != "") { pnlPrintAddressDroppdown.Visible = true; drpPrintAddressDroppdown.SelectedIndex = 0; } else { pnlPrintAddressDroppdown.Visible = false; } } string billTo = dsShipToDetails.Tables[0].Rows[0]["VAT"].ToString(); billTo = billTo.Trim().Replace(" ", "\n"); //billTo = billTo.Replace("\n\n", "<br />"); lblBillTo.Text = "Bill To:<br />" + billTo; }
private void BindConditions() { DataSet dsConditions = new POMain().BindConditions(); drpTerms.DataSource = dsConditions; drpTerms.DataBind(); }
private void FillGrid(Int64 poID) { DataSet dsPOData = new POMain().BindPOData(poID); grdClosedPO.DataSource = dsPOData; grdClosedPO.DataBind(); }
protected void BtnReqInsert_Click(object sender, EventArgs e) { POMain poMain = new POMain(); try { poMain.RequesterName = txtReqName.Text; poMain.Email = txtEmailID.Text; poMain.UserID = txtUserID.Text; poMain.Role = drpdwnRole.SelectedItem.Text; poMain.CreatedBy = userName; int retOut = poMain.InsertRequester(poMain); lblMessageError.Visible = true; if (retOut == 1) { lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; ControlState(); lblUpdateMessage.Text = "Data Successfully Inserted"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "User Already Exist....."; } } catch (Exception ex) { } }
private void ShowApprovalStatus(Int64 poNumber) { DataSet dsPOData = new POMain().GetApprovalRecords(poNumber); grdApprovalStatus.DataSource = dsPOData; grdApprovalStatus.DataBind(); }
private void BindShipTerm() { DataSet dsShipTerm = new POMain().BindShipTerm(); drpShippingTerms.DataSource = dsShipTerm; drpShippingTerms.DataBind(); drpShippingTerms.Items.Insert(0, new ListItem("", "0")); }
protected void btnInsertNewSupplier_Click(object sender, EventArgs e) { POMain poMain = new POMain(); try { poMain.SupplierName = txtNewSupplier.Text; poMain.MainNo = txtNewMainNo.Text; poMain.FaxNo = txtNewFaxNo.Text; poMain.ContactPerson = txtNewContactPerson.Text; poMain.PhNo = txtNewPnNo.Text; poMain.ContactPerson1 = txtNewContactPerson1.Text; poMain.PhNo1 = txtNewPnNo1.Text; poMain.Address1 = txtNewAdd1.Text; poMain.Address2 = txtNewAdd2.Text; poMain.Address3 = txtNewAdd3.Text; poMain.Address4 = txtNewAdd4.Text; poMain.Address5 = txtNewAdd5.Text; poMain.Country = txtNewCountry.Text; poMain.Comment = txtNewComment.Text; if (txtNewTerm.Text != "") { poMain.Term = Convert.ToInt32(txtNewTerm.Text); } else { poMain.Term = 0; } poMain.CreatedBy = userName; int retOut = poMain.InsertSupplier(poMain); if (retOut == 1) { lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; ControlState(); lblUpdateMessage.Text = "Data Successfully Inserted"; } else { lblMessageError.Visible = true; lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Supplier Already Exist....."; } } catch (Exception ex) { } }
protected void gvRequesterView_SelectedIndexChanged(object sender, EventArgs e) { UpdPanelRequester.Visible = true; try { DataSet ds = new DataSet(); Label lblID = gvRequesterView.SelectedRow.FindControl("lblReqID") as Label; Label lblName = gvRequesterView.SelectedRow.FindControl("lblReqName") as Label; Label lblRole = gvRequesterView.SelectedRow.FindControl("lblRoleName") as Label; ds = new POMain().GetManagerEmailFromLDAP(lblName.Text); if (lblRole.Text == "PORequester") { drpdwnActive = 1; } else if (lblRole.Text == "Supervisor") { drpdwnActive = 2; } else if (lblRole.Text == "HOD") { drpdwnActive = 3; } else if (lblRole.Text == "CFO") { drpdwnActive = 4; } else if (lblRole.Text == "COO") { drpdwnActive = 5; } else if (lblRole.Text == "CEO") { drpdwnActive = 6; } txtRequesterID.Text = lblID.Text; txtRequesterName.Text = lblName.Text; DrpDwnRoleNames.SelectedIndex = drpdwnActive; reqEmail.Text = ds.Tables[0].Rows[0]["mail"].ToString(); reqUserID.Text = ds.Tables[0].Rows[0]["SAMAccountName"].ToString(); } catch (Exception ee) { } }
private void FillGrid(Int64 poID) { DataSet dsPOData = new DataSet(); //if (sessionUserID == "bpriyam" || sessionUserID == "jgarte" || sessionUserID == "atuccinardi" || sessionUserID == "jfoley" || sessionUserID == "scummings" || sessionUserID == "jbellini") //{ dsPOData = new POMain().BindPOData(poID); //} //else grdEditPO.DataSource = dsPOData; grdEditPO.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { GetRequester(); FillStation(); FillShipTo(); FillSuppliers(); FillDepartment(); FillProject(); lnkAdvExportToExcel.Visible = false; if (!string.IsNullOrEmpty(Request["E"])) { string queryStringE = Convert.ToString(Request["E"]); Int64 poID = Convert.ToInt64(queryStringE); DataSet dsPOData = new DataSet(); dsPOData = new POMain().BindPOData(poID); if (dsPOData.Tables[0].Rows.Count != 0) { grdSearchPO.DataSource = dsPOData; grdSearchPO.DataBind(); pnlAdvanceSearch.Visible = false; chkSearchPObyPartDescription.Visible = false; pnlAdvanceSearchByPartDescription.Visible = false; lnkAdvExportToExcel.Visible = false; grdSearchPO.Visible = true; } else { label1.Text = "The PO Number " + poID + " does not exist"; pnlAdvanceSearch.Visible = false; chkSearchPObyPartDescription.Visible = false; pnlAdvanceSearchByPartDescription.Visible = false; lnkAdvExportToExcel.Visible = false; } } } catch (Exception ex) { Response.Write(ex.Message); } } }
protected void btnSearchProject_Click(object sender, EventArgs e) { lblUpdateMessage.Visible = false; updProjects.Visible = true; DataSet ds = new DataSet(); try { ds = new POMain().GetProjectDetails(txtProjectSearch.Text); txtProjectName.Text = ds.Tables[0].Rows[0]["ProjectName"].ToString(); lblProjectID.Text = ds.Tables[0].Rows[0]["ProjectID"].ToString(); } catch (Exception ex) { } }
public static List <string> GetCircuitID(string prefixText, int count) { DataSet ds = new DataSet(); List <string> listToReturn = new List <string>(); ds = new POMain().GetCircuitID(prefixText); string itemToAdd = string.Empty; foreach (DataRow dr in ds.Tables[0].Rows) { itemToAdd = dr["circuitid"].ToString();//AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr["circuitid"].ToString(), dr["RecId"].ToString()); listToReturn.Add(itemToAdd); } return(listToReturn); }
protected void btnShwShipTo_Click(object sender, EventArgs e) { lblUpdateMessage.Visible = false; lblMessageError.Visible = false; DataSet ds = new DataSet(); try { string city = TxtReqSearchAddress.Text;; ds = new POMain().GetShipToDetails(city); gvShowShipTo.DataSource = ds; gvShowShipTo.DataBind(); gvShowShipTo.Visible = true; } catch (Exception ex) { } }
protected void BtnSearchRequester_Click(object sender, EventArgs e) { lblUpdateMessage.Visible = false; DataSet ds = new DataSet(); try { string requesterName = txtSearchRequestor.Text;; ds = new POMain().GetRequesterDetails(requesterName); //ds = new POMain().GetManagerEmailFromLDAP(requesterName); gvRequesterView.DataSource = ds; gvRequesterView.DataBind(); gvRequesterView.Visible = true; } catch (Exception ex) { } }
private void BindPOData(Int64 poID) { DataSet dsPOData = new DataSet(); dsPOData = new POMain().BindPOData(poID); ViewState["ReceivePOItems"] = dsPOData.Tables[1]; lblRPONumber.Text = poID.ToString(); lblRRequester.Text = dsPOData.Tables[0].Rows[0]["RequesterName"].ToString(); lblROrderClassification.Text = dsPOData.Tables[0].Rows[0]["OrderClassificationName"].ToString(); lblRStation.Text = dsPOData.Tables[0].Rows[0]["StationName"].ToString(); lblRDepartment.Text = dsPOData.Tables[0].Rows[0]["DepartmentName"].ToString(); lblRType.Text = dsPOData.Tables[0].Rows[0]["TypeDescription"].ToString(); lblRProject.Text = dsPOData.Tables[0].Rows[0]["ProjectName"].ToString(); lblRDateApproved.Text = dsPOData.Tables[0].Rows[0]["ApprovedDate"].ToString(); lblRDateReceived.Text = dsPOData.Tables[0].Rows[0]["ReceivedDate"].ToString(); //ddlGlCode.SelectedItem.Text = dsPOData.Tables[0].Rows[0]["GLCodeName"].ToString(); lblRShipTo.Text = dsPOData.Tables[0].Rows[0]["City"].ToString(); lblRStatus.Text = dsPOData.Tables[0].Rows[0]["Status"].ToString(); if (lblRStatus.Text == "Closed") { chkRReceived.Checked = true; btnUpdateReceivedPO.Visible = false; } if (lblRStatus.Text == "Invoiced") { chkRReceived.Checked = true; //chkInvoiced.Checked = true; chkInvoicedMain.Checked = true; } lblRSupplier.Text = dsPOData.Tables[0].Rows[0]["CompanyName"].ToString(); //lblTermText.Text = dsPOData.Tables[0].Rows[0]["Term"].ToString(); lblRApprovedBy.Text = dsPOData.Tables[0].Rows[0]["ModifiedBy"].ToString(); lblRComment.Text = dsPOData.Tables[0].Rows[0]["Comment"].ToString(); lblRInBudget.Text = dsPOData.Tables[0].Rows[0]["FieldName"].ToString(); lblCurrency.Text = dsPOData.Tables[0].Rows[0]["CurrencyName"].ToString(); grdReceivingPOItems.DataSource = dsPOData.Tables[1]; grdReceivingPOItems.DataBind(); }
public static List <string> GetBudgetCode(string prefixText, int count) { DataSet ds = new DataSet(); List <string> budgetCode = new List <string>(); try { ds = new POMain().GetBudgetCodeExtender(prefixText); string itemToAdd = string.Empty; foreach (DataRow dr in ds.Tables[0].Rows) { itemToAdd = dr["BudgetCode"].ToString();//AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr["circuitid"].ToString(), dr["RecId"].ToString()); budgetCode.Add(itemToAdd); } } catch { } return(budgetCode); }
protected void btnUpdateBudgetCode_Click(object sender, EventArgs e) { POMain poMain = new POMain(); try { poMain.BudgetCodeID = Convert.ToInt32(lblBudgetCodeID.Text); poMain.DepartmentID = Convert.ToInt32(ddlDepartment.SelectedValue); poMain.OrderClassificationID = Convert.ToInt32(ddlOrderClassification.SelectedValue); poMain.StationID = ddlStation.SelectedValue != "0" ? Convert.ToInt32(ddlStation.SelectedValue) : 0; poMain.BudgetCodeDescription = txtDescription.Text; poMain.CreatedBy = userName; poMain.Received = true; int retOut = poMain.UpdateBudgetCode(poMain); if (retOut == 1) { ControlState(); lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; lblUpdateMessage.Text = "Data Successfully Updated"; } else { lblMessageError.Visible = true; lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Failed while Updating Data" + lblBudgetCodeID.Text; } } catch (Exception ex) { MessageError = ex.Message.ToString(); lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "<b>Your Transaction Failed: </b>" + MessageError; } }
protected void BtnUpdateRequester_Click(object sender, EventArgs e) { POMain poMain = new POMain(); try { poMain.RequesterName = txtRequesterName.Text; poMain.Role = DrpDwnRoleNames.SelectedItem.Text; poMain.Email = reqEmail.Text; poMain.UserID = reqUserID.Text; poMain.CreatedBy = userName; int retOut = poMain.UpdateRequester(poMain); lblMessageError.Visible = true; if (retOut == 1) { ControlState(); lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; lblUpdateMessage.Text = "Data Successfully Updated"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Failed while Updating Data" + txtRequesterID.Text; } } catch (Exception ex) { MessageError = ex.Message.ToString(); lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "<b>Your Transaction Failed: </b>" + MessageError; } }
protected void drpPrintAddressDroppdown_SelectedIndexChanged(object sender, EventArgs e) { string billto = string.Empty; if (drpPrintAddressDroppdown.SelectedValue == "VAT") { DataSet dsShipToDetails = new POMain().GetShipToDetailsByShipToId(Convert.ToInt32(ViewState["ShipTo"])); string billTo = dsShipToDetails.Tables[0].Rows[0]["VAT"].ToString(); billTo = billTo.Replace(" ", "/r/n"); //billTo = billTo.Replace("\n\n", "<br />"); lblBillTo.Text = "Bill To:<br />" + billTo; } else { DataSet dsAddnBillingAdd = new POMain().GetAdditionalBillingAddress(Convert.ToInt32(ViewState["ShipTo"])); string addnBillingAdd = dsAddnBillingAdd.Tables[0].Rows[0]["NewAddress"].ToString(); addnBillingAdd = addnBillingAdd.Replace(" ", "/r/n"); //addnBillingAdd = addnBillingAdd.Replace("\n\n", "<br />"); lblBillTo.Text = "Bill To:<br />" + addnBillingAdd; } }
private void BindSuppliersDetails(int supplier) { DataSet dsSupplierDetails = new POMain().GetSupplierDetails(supplier); string supplierDetails = string.Empty; supplierDetails += dsSupplierDetails.Tables[0].Rows[0]["CompanyName"].ToString() + "<br />"; if (dsSupplierDetails.Tables[0].Rows[0]["Address1"].ToString() != null) { supplierDetails += dsSupplierDetails.Tables[0].Rows[0]["Address1"].ToString() + "<br />"; } if (dsSupplierDetails.Tables[0].Rows[0]["Address2"].ToString() != null) { supplierDetails += dsSupplierDetails.Tables[0].Rows[0]["Address2"].ToString() + "<br />"; } if (dsSupplierDetails.Tables[0].Rows[0]["Address3"].ToString() != null) { supplierDetails += dsSupplierDetails.Tables[0].Rows[0]["Address3"].ToString() + "<br />"; } if (dsSupplierDetails.Tables[0].Rows[0]["Address4"].ToString() != null) { supplierDetails += dsSupplierDetails.Tables[0].Rows[0]["Address4"].ToString() + "<br />"; } if (dsSupplierDetails.Tables[0].Rows[0]["Address5"].ToString() != null) { supplierDetails += dsSupplierDetails.Tables[0].Rows[0]["Address5"].ToString() + "<br />"; } lblPrintPOSupplier.Text = supplierDetails; if (dsSupplierDetails.Tables[0].Rows[0]["MainNumber"].ToString() != null) { lblPrintPOTelNumber.Text = dsSupplierDetails.Tables[0].Rows[0]["MainNumber"].ToString(); } if (dsSupplierDetails.Tables[0].Rows[0]["FaxNumber"].ToString() != null) { lblPrintPOFaxNumber.Text = dsSupplierDetails.Tables[0].Rows[0]["FaxNumber"].ToString(); } }
protected void btnInsertShipTo_Click(object sender, EventArgs e) { POMain poMain = new POMain(); poMain.ShipToName = txtNewCity.Text; poMain.ShipToAddress = txtAddress1.Text + " " + txtAddress2.Text; poMain.VAT = txtNewVat.Text; poMain.NewAddress = txtNewAddAddress.Text; poMain.CreatedBy = userName; int retOut = poMain.InsertShipTo(poMain); lblMessageError.Visible = true; if (retOut == 1) { lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; ControlState(); lblUpdateMessage.Text = "Data Successfully Inserted"; } else if (retOut == -1) { ControlState(); lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; lblUpdateMessage.Text = "Data already exists"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Insertion Failed"; } }
protected void btnDeleteShipto_Click(object sender, EventArgs e) { POMain poMain = new POMain(); poMain.ShipToID = Convert.ToInt32(txtID.Text); poMain.CreatedBy = userName; int retOut = poMain.DeleteShipToDetails(poMain); if (retOut == 1) { ControlState(); lblUpdateMessage.Visible = true; lblUpdateMessage.Text = ""; lblUpdateMessage.ForeColor = System.Drawing.Color.Green; lblUpdateMessage.Text = "Data Successfully Deleted"; } else { lblMessageError.Text = ""; lblMessageError.ForeColor = System.Drawing.Color.Red; lblMessageError.Text = "Failed while Deleting data" + txtID.Text; } }