Raasa.in (Impact)
<script language="javascript"
type="text/javascript">
function
CheckOnes(spanChk) {
var
oItem = spanChk.children;
var
theBox = (spanChk.type == "radio")
? spanChk : spanChk.children.item[0];
xState = theBox.unchecked;
elm = theBox.form.elements;
for (i
= 0; i < elm.length; i++) {
if
(elm[i].type == "radio" &&
elm[i].id != theBox.id) {
elm[i].checked = xState;
}
}
}
function
IsNumericOnly(evt) {
var
charCode = ((evt.which) ? evt.which : evt.keyCode);
if
(charCode == 37 || charCode == 39)
return
true;
if
(charCode > 31 && (charCode < 48 || charCode > 57))
return
false;
return true;
}
</script>
<asp:DataList ID="dl_address"
runat="server"
BackColor="White"
BorderColor="#CCCCCC"
BorderStyle="None"
BorderWidth="0"
CellPadding="6"
CellSpacing="6"
ForeColor="Black"
GridLines="None"
onitemdatabound="dl_address_ItemDataBound"
RepeatDirection="Horizontal"
RepeatColumns="3">
<ItemTemplate>
<div align="center" style="width:200px;background-color:#f3f3f3; border:4px solid #666;">
<table width="100%"
cellpadding="1"
cellspacing="1"
border="0">
<tr>
<td
align="left">
<span
style="font-size:13px; font-weight:bold;"><%#Eval("name")
%></span> <br />
<%#Eval("street_addr")%> <br />
<%#Eval("landmark")%><br />
<%#Eval("city")%> <br />
<%#Eval("state")
%>, <%#Eval("country")%> <br />
<%#Eval("pincode")%>, <%#Eval("ph_no")%><br />
</td>
</tr>
<tr>
<td
align="center"><br /><hr style="width:95%;"/>
</td>
</tr>
<tr>
<td
align="center">
<asp:RadioButton ID="rdb" runat="server" OnCheckedChanged="rdb_click" AutoPostBack="True" /> Default Address
<asp:HiddenField ID="HiddenField1"
runat="server"
Value = '<%#Eval("ID")%>' />
</td>
</tr>
<tr>
<td
align="center"><br /><hr style="width:95%;"/>
</td>
</tr>
<tr>
<td
align="center">
<asp:LinkButton ID="lnkdeladdr"
runat="server" CausesValidation="false"
CommandArgument='<%#Eval("ID")%>' onclick="lnkdeladdr_Click">Delete
Address</asp:LinkButton>
</td>
</tr>
</table>
</div>
</ItemTemplate>
<FooterStyle BackColor="#CCCC99"
ForeColor="Black"
/>
<HeaderStyle BackColor="#333333"
Font-Bold="True"
ForeColor="White"
/>
<SelectedItemStyle
BackColor="#CC3333"
Font-Bold="True"
ForeColor="White"
/>
</asp:DataList>
.cs
public void Bind(string
email)
{
bl_raasa
csobj = new bl_raasa();
ds = csobj.GetAddressDetails("raasa_user_shipaddress", "email='" + email + "' and status='A'");
if
(ds.Tables[0].Rows.Count > 0)
{
//Session["Dataset"]
= ds;
dl_address.DataSource =
ds.Tables[0];
dl_address.DataBind();
}
}
protected
void dl_address_ItemDataBound(object sender, DataListItemEventArgs
e)
{
RadioButton
rdb;
rdb = (RadioButton)e.Item.FindControl("rdb");
if
(rdb != null)
rdb.Attributes.Add("onclick", "CheckOnes(this);");
}
protected
void rdb_click(object
sender, EventArgs e)
{
for
(int i = 0; i < dl_address.Items.Count; i++)
{
RadioButton
rdb;
rdb = (RadioButton)dl_address.Items[i].FindControl("rdb");
if (rdb !=
null)
{
if
(rdb.Checked)
{
HiddenField hf = (HiddenField)dl_address.Items[i].FindControl("HiddenField1");
bl_raasa csobj = new bl_raasa();
int errNo = 0;
string errMsg = null;
csobj.Update_Address_status(Convert.ToInt32(hf.Value),out errNo,out
errMsg);
//Response.Write(hf.Value);
if
(errNo == 0)
{
}
else
{
}
}
}
}
}
No comments:
Post a Comment