Ejemplo n.º 1
0
    protected void FvRefundReadOnly_DataBound(object sender, EventArgs e)
    {
        RefundApplication app = new RefundApplication();
        Guid RefundApplicationId = (Guid) FvRefundReadOnly.DataKey["RefundApplicationId"];
        DataTable ItmActsApplicable = app.SelectActDetailsByRefundApplicationId(RefundApplicationId);
        ViewState["dtActsApplicable"] = ItmActsApplicable;

        CheckBoxList lstActs = (CheckBoxList) FvRefundReadOnly.FindControl("chkLstBxReadOnly");
        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);
        }
    }
Ejemplo n.º 2
0
    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);
            }
        }
    }