Ejemplo n.º 1
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();
     }
 }
Ejemplo n.º 2
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();
     }
 }
Ejemplo n.º 3
0
 public void DeleteBcAutoCode(int id)
 {
     BcAutoCodeEntity entity = new BcAutoCodeEntity() {Id = id};
     EntityExecution.Delete(entity);
 }
Ejemplo n.º 4
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;
 }