Пример #1
0
 //見積データの追加
 public void Create(string customer, string helper, string staff, string[] products_Id)
 {
     using (DefaultConnection db = new DefaultConnection())
     {
         int[] customer_Ids = BusinessPartnerData.NameToId(db, customer);
         int[] helper_Ids   = HelperData.NameToId(db, helper);
         int   customer_Id  = customer_Ids[0];
         int   helper_Id    = helper_Ids[0];
         int   product_Id   = 0;
         int   staff_Id     = StaffData.EmailToId(db, staff);
         foreach (var item in products_Id)
         {
             product_Id = int.Parse(item);
             Quotation quotation = new Quotation(customer_Id, helper_Id, product_Id, staff_Id);
             db.Quotations.Add(quotation);
             db.SaveChanges();
         }
     }
 }