Beispiel #1
0
        public void DeleteBcAutoCode(int id)
        {
            BcAutoCodeEntity entity = new BcAutoCodeEntity()
            {
                Id = id
            };

            EntityExecution.Delete(entity);
        }
Beispiel #2
0
 public void AddNewBcAutoCode(BcAutoCodeEntity entity)
 {
     entity.Id          = null;
     entity.CurrentDate = DateTime.Now;
     entity.CurrentCode = 0;
     using (var ts = new TransactionScope())
     {
         ClearDefault(entity.FuncPointId);
         entity.Insert();
         ts.Complete();
     }
 }
Beispiel #3
0
        private BcAutoCodeEntity PrepareFormData()
        {
            //TODO:需要校验参数的合法性
            var entity = new BcAutoCodeEntity();

            entity.Id          = int.Parse(hdId.Value);
            entity.Prefix      = txtPrefix.Text.ToUpper();
            entity.DateFormat  = txtDateFormat.Text;
            entity.FuncPointId = ddlFuncPoint.SelectedValue;
            entity.Digit       = int.Parse(txtDigit.Text);
            entity.IsDefault   = rYes.Checked;
            return(entity);
        }
Beispiel #4
0
 public void UpdateBcAutoCode(BcAutoCodeEntity entity)
 {
     if (entity.IsDefault == true)
     {
         using (var ts = new TransactionScope())
         {
             ClearDefault(entity.FuncPointId);
             entity.Update();
             ts.Complete();
         }
     }
     else
     {
         entity.Update();
     }
 }