protected void FVRefundApplication_ItemUpdating(object sender, FormViewUpdateEventArgs e) { InitActsApplicable(); InitStampDetails(); //Adding The DataTable dt to the eventArgs of FVRefundApplication e.NewValues.Add("StampDetails", dt); dt.Rows.Add(dlRevenueStampId.SelectedValue, dlRevenueStampId.SelectedItem.Text, TxtReturnedQty.Text, txtStampsNumbers.Text); dt.AcceptChanges(); gvRefundStampDetails.DataSource = dt; gvRefundStampDetails.DataBind(); Session["StampDetails"] = dt; txtStampsNumbers.Text = ""; TxtReturnedQty.Text = ""; //****** gvRefundStampDetails.DataSource = dt; gvRefundStampDetails.DataBind(); RefundApplication RfApplication = new RefundApplication(); Guid RefundApplicationId = (Guid) FVRefundApplication.SelectedValue; DataTable dtStampDetails = RfApplication.SelectRefundStampDetailsByRefundId(RefundApplicationId); gvRefundStampDetails.DataSource = dtStampDetails; gvRefundStampDetails.DataBind(); }
protected void fvRefundApplication_DataBound(object sender, EventArgs e) { if (fvRefundApplication.CurrentMode == FormViewMode.Edit) { RefundApplication app = new RefundApplication(); Guid RefundApplicationId = (Guid) fvRefundApplication.DataKey["RefundApplicationId"]; ViewState["StampDetails"] = app.SelectRefundStampDetailsByRefundId(RefundApplicationId); GridView grd = (GridView) fvRefundApplication.FindControl("gvRefundStampDetailsUpd"); grd.DataSource = (DataTable) ViewState["StampDetails"]; grd.SelectedIndex = -1; grd.DataBind(); DataTable ActsApplicable = app.SelectActDetailsByRefundApplicationId(RefundApplicationId); //ViewState["dtActsApplicable"] = ActsApplicable; CheckBoxList lstActs = (CheckBoxList) fvRefundApplication.FindControl("chkLstBxUpd"); foreach (DataRow act in ActsApplicable.Rows) { ListItem item = new ListItem(); item.Text = Convert.ToString(act["NameOfAct"]); item.Selected = Convert.ToBoolean(act["Checked"]); item.Value = ((Guid) act["ActId"]).ToString(); lstActs.Items.Add(item); } } if (fvRefundApplication.CurrentMode == FormViewMode.ReadOnly) { RefundApplication app = new RefundApplication(); Guid RefundApplicationId = (Guid) fvRefundApplication.DataKey["RefundApplicationId"]; DataTable ItmActsApplicable = app.SelectActDetailsByRefundApplicationId(RefundApplicationId); ViewState["dtActsApplicable"] = ItmActsApplicable; CheckBoxList lstActs = (CheckBoxList) fvRefundApplication.FindControl("chkLstBxItm"); foreach (DataRow act in ItmActsApplicable.Rows) { ListItem item = new ListItem(); item.Text = Convert.ToString(act["NameOfAct"]); item.Selected = Convert.ToBoolean(act["Checked"]); item.Value = ((Guid) act["ActId"]).ToString(); lstActs.Items.Add(item); } } }
protected void OdsRefundDetails_Selected(object sender, ObjectDataSourceStatusEventArgs e) { RefundApplication app = new RefundApplication(); DataTable dt = app.SelectRefundStampDetailsByRefundId((Guid) e.OutputParameters["RefundApplicationId"]); e.OutputParameters.Add("StampDetails", dt); }
protected void btnUpdate_Click(object sender, EventArgs e) { OdsRefundDetails.SelectParameters["RefundApplicationId"].DefaultValue = GvRefundAlerts.SelectedDataKey.Value.ToString(); RefundApplication Rf = new RefundApplication(); DataTable dtGridUpd = new DataTable(); Guid RefundApplicationId = (Guid) GvRefundAlerts.SelectedValue; dtGridUpd = Rf.SelectRefundStampDetailsByRefundId(RefundApplicationId); GridView Gv = ((GridView) fvRefundApplication.FindControl("gvRefundStampDetailsIns")); Gv.DataSource = dtGridUpd; Gv.DataBind(); }