public void AddNewBcAutoCode(BcAutoCodeEntity entity)
 {
     entity.Id = null;
     entity.CurrentDate = DateTime.Now;
     entity.CurrentCode = 0;
     using (var ts = new TransactionScope())
     {
         Dao.ClearDefault(entity.FuncPointId);
         EntityExecution.InsertEntity(entity);
         ts.Complete();
     }
 }
 public void UpdateBcAutoCode(BcAutoCodeEntity entity)
 {
     if (entity.IsDefault == true)
     {
         using (var ts = new TransactionScope())
         {
             Dao.ClearDefault(entity.FuncPointId);
             EntityExecution.UpdateEntity(entity);
             ts.Complete();
         }
     }
     else
     {
         EntityExecution.UpdateEntity(entity);
     }
 }
 public void DeleteBcAutoCode(int id)
 {
     BcAutoCodeEntity entity = new BcAutoCodeEntity() { Id = id };
     EntityExecution.DeleteEntity(entity);
 }
 private BcAutoCodeEntity PrepareFormData()
 {
     //TODO:需要校验参数的合法性
     var entity = new BcAutoCodeEntity();
     entity.Id = int.Parse(this.hdId.Value);
     entity.Prefix = this.txtPrefix.Text.ToUpper();
     entity.DateFormat = this.txtDateFormat.Text;
     entity.FuncPointId = this.ddlFuncPoint.SelectedValue;
     entity.Digit = int.Parse(this.txtDigit.Text);
     entity.IsDefault = this.rYes.Checked;
     return entity;
 }