示例#1
0
        /// <summary>
        ///  債権代表者マスター 登録前に AddCusotmer, DeleteCustomer を設定する処理
        /// </summary>
        /// <param name="customerGroupDB"></param>
        private void PrepareCustomerGroup(List <CustomerGroup> customerGroupDB)
        {
            if (CustomerModifyList.Any())
            {
                AddCustomer.Clear();
                DeleteCustomer.Clear();

                foreach (var item in CustomerModifyList
                         .Where(x => !customerGroupDB.Any(y => y.ChildCustomerCode == x.ChildCustomerCode)))
                {
                    item.ParentCustomerId = ParentCustomerId;
                    item.CreateBy         = Login.UserId;
                    item.UpdateBy         = Login.UserId;
                    AddCustomer.Add(item);
                }
            }

            foreach (var item in customerGroupDB
                     .Where(x => !CustomerModifyList.Any(y => y.ChildCustomerCode == x.ChildCustomerCode)))
            {
                DeleteCustomer.Add(item);
            }
        }