private void SaveChangeList() { using (ChangeList change = new ChangeList(true)) { change.FromDate = FromDate; change.Todate = ToDate; if (ChangeListID == 0) { ChangeListID = change.Add(); } change.Clear(ChangeListID); foreach (ChangeListToolstriptItem RmenuItem in contextMenuStrip1.Items) { if (RmenuItem.asapuChangeListItem != null) { foreach (ChangeListItemBhikku bhikku in RmenuItem.asapuChangeListItem.bhikkuList) { change.AddBhikkuAsapuwa(ChangeListID, RmenuItem.asapuChangeListItem.asapuwaID, bhikku.bInfo.ID, bhikku.bInfo.Post, bhikku.bInfo.ChangeType); } } } } }
public int AddDeleteChangeItem(int bhikkuChangeListID, int asapuwaID, int bhikkuID, DBCore.BhikkuPost post, DBCore.BhikkuChangeType changeType, bool isUpasampanna) { using (ChangeList change = new ChangeList(true)) { saveHistrybtn.Enabled = true; if (ChangeListID == 0) { change.FromDate = FromDate; change.Todate = ToDate; ChangeListID = change.Add(); } if (bhikkuChangeListID == 0) { if (isUpasampanna) { upasampadaChangeCount++; } else { samaneraChangeCount++; } setSummaryCounts(); return(change.AddBhikkuAsapuwa(ChangeListID, asapuwaID, bhikkuID, post, changeType)); } else { // delete bhikku if (asapuwaID == -1) { if (isUpasampanna) { upasampadaChangeCount--; } else { samaneraChangeCount--; } change.DeleteBhikkuAsapuwa(bhikkuChangeListID); setSummaryCounts(); return(0); } else { change.UpdateBhikkuAsapuwa(bhikkuChangeListID, post, changeType); return(bhikkuChangeListID); } } } }