Example #1
0
    protected void gvRemovedDetails_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        View_StocktakeDetails detail = GetDetailsByRow(gvRemovedDetails.Rows[e.RowIndex]);

        detail.DetailsID = long.Parse(gvRemovedDetails.DataKeys[e.RowIndex].Value.ToString());

        RefreshSelectedDetails(SelectedRemovedDetails, gvRemovedDetails);
        int idx = SelectedRemovedDetails.FindIndex(d => d.DetailsID == detail.DetailsID);

        if (idx >= 0)
        {
            SelectedRemovedDetails.RemoveAt(idx);
        }

        int index = RemovedDetails.FindIndex(d => d.DetailsID == detail.DetailsID);

        if (index >= 0)
        {
            RemovedDetails.RemoveAt(index);
        }
        if (NotificationID != null)
        {
            IncludedDetails.Add(detail);
        }
        BindData();
    }
Example #2
0
    protected void Add(object sender, EventArgs e)
    {
        RefreshSelectedDetails(SelectedRemovedDetails, gvRemovedDetails);
        for (int i = SelectedRemovedDetails.Count - 1; i >= 0; i--)
        {
            View_StocktakeDetails detail = SelectedRemovedDetails[i];
            int index = RemovedDetails.FindIndex(d => d.DetailsID == detail.DetailsID);
            if (index >= 0)
            {
                RemovedDetails.RemoveAt(index);
            }

            if (NotificationID != null)
            {
                IncludedDetails.Add(detail);
            }
            SelectedRemovedDetails.RemoveAt(i);
        }
        BindData();
    }