protected void dlContacts_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { LinkButton lnkEdit = e.Item.FindControl("lbtnEdit") as LinkButton; LinkButton lnkDelete = e.Item.FindControl("lnkDelete") as LinkButton; Label lblPhone = e.Item.FindControl("lblPhone") as Label; Label lblFax = e.Item.FindControl("lblFax") as Label; lblPhone.Text = customerDetails.FormatPhoneFax(lblPhone.Text.Trim().Replace(" ", "")); lblFax.Text = customerDetails.FormatPhoneFax(lblFax.Text.Trim().Replace(" ", "")); lnkDelete.Attributes.Add("onclick", "return confirm(\"Do you want to delete this contact?\");"); Label lblMphone = e.Item.FindControl("lblMphone") as Label; lblMphone.Text = customerDetails.FormatPhoneFax(lblMphone.Text.Trim().Replace(" ", "")); if (Session["SecurityCode"].ToString().Trim() != "" && Session["CustomerLock"].ToString().Trim() != "L") { lnkDelete.Visible = true; } else { lnkDelete.Visible = false; } //if ((!(hidType.Value == "Address" || hidType.Value == "SF" || hidType.Value == "BF")) && (Session["SecurityCode"] != null && Session["SecurityCode"].ToString().Trim() == "VEND (W)")) //{ // lnkEdit.Visible = false; // lnkDelete.Visible = false; //} //else if((hidType.Value == "Address" || hidType.Value == "SF" || hidType.Value == "BF") && (Session["SecurityCode"] != null && Session["SecurityCode"].ToString().Trim() == "VDAP")) //{ // lnkEdit.Visible = false; // lnkDelete.Visible = false; //} //else //{ // lnkEdit.Visible = true; // lnkDelete.Visible = true; //} } }
private void BindBillToAddress() { //[pCustomerAddressID],[Type],[fCustomerMasterID],[Name2],[AddrLine1],[AddrLine2],[AddrLine3],[AddrLine4], //[AddrLine5],[City],[State],[PostCd],[Country],[PhoneNo],[CustContacts],[fCustContactsID],[UPSZone], //[FaxPhoneNo],[EDIPhoneNo],[UPSShipperNo],[Email],CustomerAddress.[EntryID],CustomerAddress.[EntryDt] //,CustomerAddress.[ChangeID],CustomerAddress.[ChangeDt],CustomerAddress.[StatusCd],[LocationName] if (CustomerNumber != "") { if (CustType == CustomerType.BT || CustType == CustomerType.BTST) { dsValue = customerDetails.GetCustomerAddress(CustomerNumber); } else { dsValue = customerDetails.GetCustomerAddress(BillToCustomerNo); } if (dsValue != null && dsValue.Rows.Count > 0) { lblBillCity.Text = dsValue.Rows[0]["City"].ToString(); lblBillCountry.Text = dsValue.Rows[0]["Country"].ToString(); lblBillFax.Text = customerDetails.FormatPhoneFax(dsValue.Rows[0]["FaxPhoneNo"].ToString()); lblBillLine1.Text = dsValue.Rows[0]["AddrLine1"].ToString(); lblBillName.Text = dsValue.Rows[0]["CustName"].ToString(); lblBillPhone.Text = customerDetails.FormatPhoneFax(dsValue.Rows[0]["PhoneNo"].ToString()); lblBillToCustomerNumber.Text = dsValue.Rows[0]["CustNo"].ToString(); lblBillChangeDate.Text = (dsValue.Rows[0]["ChangeDt"].ToString() == "") ? "" : Convert.ToDateTime(dsValue.Rows[0]["ChangeDt"].ToString()).ToShortDateString(); lblBillChangeID.Text = dsValue.Rows[0]["ChangeID"].ToString(); lblBillEntryDate.Text = (dsValue.Rows[0]["EntryDt"].ToString() == "") ? "" : Convert.ToDateTime(dsValue.Rows[0]["EntryDt"].ToString()).ToShortDateString(); lblBillEntryID.Text = dsValue.Rows[0]["EntryID"].ToString(); lblCustMastChnageDt.Text = (dsValue.Rows[0]["CustMasterChangeDt"].ToString() == "") ? "" : Convert.ToDateTime(dsValue.Rows[0]["CustMasterChangeDt"].ToString()).ToShortDateString(); lblCustMastChangeID.Text = dsValue.Rows[0]["CustMasterChangeID"].ToString(); lblCustMastEntryDt.Text = (dsValue.Rows[0]["CustMasterEntryDt"].ToString() == "") ? "" : Convert.ToDateTime(dsValue.Rows[0]["CustMasterEntryDt"].ToString()).ToShortDateString(); lblCustMastEntryID.Text = dsValue.Rows[0]["CustMasterEntryID"].ToString(); tblEntryPanel.Visible = true; } else { ClearBillControls(); } if (CustType == CustomerType.BTST) { DataTable dtsoldto = customerDetails.GetCustomerSoldToAddress(CustomerNumber); if (dtsoldto != null && dtsoldto.Rows.Count > 0) { dsValue = dtsoldto.Copy(); } BindSoldToAddress(); } else if (CustType == CustomerType.ST) { dsValue = customerDetails.GetCustomerAddress(CustomerNumber); BindSoldToAddress(); } else { tdSoldAddress.Style.Add(HtmlTextWriterStyle.Display, "none"); } } else { ClearBillControls(); ClearSoldControls(); } }