private void RetreiveMyDetails() { IUserDetailBussinessService userDetailsBussinessService = null; string userId = Session["UserName"].ToString() ?? string.Empty; try { userDetailsBussinessService = BizDelegateFactory.Current.UserDetailBussinessService; personalDetailsTable = ViewState["DataTable"] as DataTable; if (personalDetailsTable == null) { personalDetailsTable = userDetailsBussinessService.PersonalDetails(userId); ViewState["DataTable"] = personalDetailsTable; } PersonalDetailsView.DataSource = personalDetailsTable; PersonalDetailsView.DataBind(); } catch (Exception ex) { ShowMessage(ex.Message, MessageInfo.Error); } finally { userDetailsBussinessService = null; } }
protected void PersonalDetailsView_ModeChanging(object sender, DetailsViewModeEventArgs e) { if (e.NewMode == DetailsViewMode.Edit) { PersonalDetailsView.ChangeMode(DetailsViewMode.Edit); } if (e.NewMode == DetailsViewMode.ReadOnly) { PersonalDetailsView.ChangeMode(DetailsViewMode.ReadOnly); } PersonalDetailsView.DataSource = ViewState["DataTable"]; PersonalDetailsView.DataBind(); }
private void RetreivePersonalDetails() { IUserDetailBussinessService userDetailsBussinessService = null; try { if (Session["MyCart"] != null && Session["UserName"] != null) { string userId = Session["UserName"].ToString(); userDetailsBussinessService = BizDelegateFactory.Current.UserDetailBussinessService; PersonalDetailsView.DataSource = userDetailsBussinessService.PersonalDetails(userId); PersonalDetailsView.DataBind(); } } catch (Exception ex) { ShowMessage(ex.Message, MessageInfo.Error); } finally { userDetailsBussinessService = null; } }