示例#1
0
        private void ValiDate(Book.Model.AtCashAccount atCashAccount)
        {
            //if (atCashAccount.AtCashAccountMonth == null)
            //    throw new Helper.InvalidValueException(Model.AtCashAccount.PRO_AtCashAccountMonth);
            //if (this.ISExistsMonth(atCashAccount))
            //    throw new Helper.MessageValueException("當前月份 " + atCashAccount.AtCashAccountMonth.Value.Month.ToString() + " 月已存在記錄!");
            //foreach (var item in atCashAccount.Detail)
            //{
            //    if (item.SubjectId == null)
            //        throw new Helper.InvalidValueException(Model.AtCashAccountDetail.PRO_SubjectId);
            //}

            if (atCashAccount.DateBegin == null || atCashAccount.DateEnd == null)
            {
                throw new Helper.MessageValueException("日期區間不能為空");
            }

            foreach (var item in atCashAccount.Detail)
            {
                if (string.IsNullOrEmpty(item.SubjectId))
                {
                    throw new Helper.InvalidValueException(Model.AtCashAccountDetail.PRO_SubjectId);
                }
            }
        }
示例#2
0
 private void ValiDate(Book.Model.AtCashAccount atCashAccount)
 {
     if (atCashAccount.AtCashAccountMonth == null)
         throw new Helper.InvalidValueException(Model.AtCashAccount.PRO_AtCashAccountMonth);
     if (this.ISExistsMonth(atCashAccount))
         throw new Helper.MessageValueException("當前月份 " + atCashAccount.AtCashAccountMonth.Value.Month.ToString() + " 月已存在記錄!");
     //foreach (var item in atCashAccount.Detail)
     //{
     //    if (item.SubjectId == null)
     //        throw new Helper.InvalidValueException(Model.AtCashAccountDetail.PRO_SubjectId);
     //}
 }
 private void ValiDate(Book.Model.AtCashAccount atCashAccount)
 {
     if (atCashAccount.AtCashAccountMonth == null)
     {
         throw new Helper.InvalidValueException(Model.AtCashAccount.PRO_AtCashAccountMonth);
     }
     if (this.ISExistsMonth(atCashAccount))
     {
         throw new Helper.MessageValueException("Current month " + atCashAccount.AtCashAccountMonth.Value.Month.ToString() + " month record already exists!");
     }
     //foreach (var item in atCashAccount.Detail)
     //{
     //    if (item.SubjectId == null)
     //        throw new Helper.InvalidValueException(Model.AtCashAccountDetail.PRO_SubjectId);
     //}
 }