Exemplo n.º 1
0
        /// <summary>
        /// 添加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(DataAngineSet.Model.hitalert model)
        {
            if (!hitrecorddal.Add(model.hit))
            {
                return(false);
            }
            int hit_record_id = hitrecorddal.GetMaxId() - 1;

            bool addState = true;

            for (int n = 0; n < model.details.Length; n++)
            {
                model.details[n].hit_record_id = hit_record_id;
                model.details[n].rank          = n;
                addState = hitrecord_detaildal.Add(model.details[n]);

                if (false == addState)
                {
                    break;
                }
            }

            return(addState);
        }