Exemplo n.º 1
0
        public static void Add(IncomeDTO income)
        {
            DB db = new DB();

            try
            {
                Income IncomeDAL = new Income();
                IncomeDAL = IncomeConvert.DTOtoDAL(income);
                db.Incoms.Add(IncomeDAL);
                FundBL.AddBalance((int)income.Amount);

                db.SaveChanges();
            }
            catch (Exception e)
            {
                throw new Exception(e.ToString() + ' ' + income.ToString());
            }
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     using (var dbSG = new  SuperGmachEntities())
     {
         dbSG.Add(new Status {
             NameStatus = "canceled", Description = "בוטל"
         });
         dbSG.Add(new Status {
             NameStatus = "future", Description = "עתידי"
         });
         dbSG.Add(new Status {
             NameStatus = "Happy", Description = "מאושר"
         });
         dbSG.Add(new Status {
             NameStatus = "performed", Description = "בוצע"
         });
         // dbSG.Add(new Exception {Data= " 2/03/2020" ,name ="cancle"});
         dbSG.SaveChanges();
     }
 }