private void ExecuteDeleteCQCommand(object sender) { ChequeBusinessLogic business = new ChequeBusinessLogic(); business.DeleteTempCheque(ConvertToCheque(SelectedCheque, true) as CHQ_Cheques_Master_Temp); ChequeList.Remove(SelectedCheque); ChequeList = ChequeList.Select(S => { S.SerialNo = ChequeList.IndexOf(S) + 1; return(S); }).ToList().ToObservableCollection(); business = null; SelectedCheque = null; }
private void ExecuteSaveChqCommand(object sender) { if (ChequeList.Count == 0) { WPFCustomMessageBox.CustomMessageBox.ShowOK("No records to save", "Info", "OK"); return; } ChequeBusinessLogic chequeBussiness = new ChequeBusinessLogic(); foreach (ChequeInwardsModel cheque in ChequeList) { chequeBussiness.DeleteTempCheque(ConvertToCheque(cheque, true) as CHQ_Cheques_Master_Temp); CHQ_Cheques_Master entity = new CHQ_Cheques_Master() { Bank = cheque.Bank, ChequeNo = cheque.ChequeNo, Cheque_ID = cheque.Cheque_ID, ChqAmount = cheque.ChqAmount, ChqStatus_ID = 1, //Cheque Recieved EnteredBy = cheque.EnteredBy, EnteredOn = cheque.EnteredOn, InwardDate = cheque.InwardDate, IsActive = true, Login_ID = S360Model.S360Configuration.Instance.LoginID, Remarks = cheque.Remarks, Section_ID = cheque.Section_ID, Student_ID = cheque.Student_ID }; chequeBussiness.SaveCheque(entity); } ExecuteClearCommand(null); ChequeList.Clear(); chequeBussiness = null; //SelectedSection = null; CurrentChequeInwardModel = null; }