public void ClearFacture() { FactureModel fm = new FactureModel(); fm = fm.Get((int)Facture); fm.ClearUnclear(true); }
public BindableCollection <ReceiptModel> GiveCollection(DataTable cs) { List <ReceiptModel> output = new List <ReceiptModel>(); SeasonModel sm = new SeasonModel(); CustomerModel cm = new CustomerModel(); CurrencyModel cr = new CurrencyModel(); FactureModel fm = new FactureModel(); foreach (DataRow row in cs.Rows) { cm = cm.Get(System.Convert.ToInt32(row[2].ToString())); ReceiptModel ctm = new ReceiptModel { Id = System.Convert.ToInt32(row[0].ToString()), Number = System.Convert.ToInt32(row[1].ToString()), Customer = cm.Id, CustomerName = cm.Name, }; if (row[3].ToString() != null && row[3].ToString() != string.Empty) { sm = sm.Get(System.Convert.ToInt32(row[3].ToString())); ctm.Season = sm.Id; ctm.SeasonYear = sm.Year; } if (row[4].ToString() != null && row[4].ToString() != string.Empty) { ctm.Details = row[4].ToString(); } if (row[5].ToString() != null && row[5].ToString() != string.Empty) { ctm.Amount = System.Convert.ToDecimal(row[5].ToString()); if (row[6].ToString() != null && row[6].ToString() != string.Empty) { cr = cr.Get(System.Convert.ToInt32(row[6].ToString())); ctm.Currency = cr.Id; ctm.CurrencySymbol = cr.Symbol; } } if (row[7].ToString() != null && row[7].ToString() != string.Empty) { ctm.Delivery = System.Convert.ToDateTime(row[7].ToString()); } if (row[8].ToString() != null && row[8].ToString() != string.Empty) { fm = fm.Get(System.Convert.ToInt32(row[8].ToString())); ctm.Facture = fm.Id; } if (row[9].ToString() != null && row[9].ToString() != string.Empty) { ctm.Cheque = row[9].ToString(); } output.Add(ctm); } return(new BindableCollection <ReceiptModel>(output)); }