Ejemplo n.º 1
0
 public void SubmitForm(BillCodeRuleEntity entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.Modify(keyValue);
         service.Update(entity);
     }
     else
     {
         entity.Create();
         service.Insert(entity);
     }
 }
Ejemplo n.º 2
0
        public string GetBillNo(string FTableName, bool FROB)
        {
            string             FBillNo;
            BillCodeRuleEntity entity = new BillCodeRuleEntity();

            entity  = this.FindEntity(FTableName, FROB);
            FBillNo = entity.FPreLetter.ToString() + Ext.ToString(entity.FMaxInterId).ToString().PadLeft(entity.FLength, '0');
            if (!string.IsNullOrEmpty(FBillNo))
            {
                entity.FMaxInterId += 1;
                this.SubmitForm(entity, entity.FId);
            }
            return(FBillNo);
        }
Ejemplo n.º 3
0
        public BillCodeRuleEntity FindEntity(string FTableName, bool FROB)
        {
            var expression = ExtLinq.True <BillCodeRuleEntity>();

            expression = expression.And(t => t.FTableName.Equals(FTableName));

            if (!FROB)
            {
                expression = expression.And(t => t.FROB.Equals(false));
            }
            else
            {
                expression = expression.And(t => t.FROB.Equals(true));
            }
            BillCodeRuleEntity entity = new BillCodeRuleEntity();

            entity = service.FindEntity(expression);

            return(entity);
        }
Ejemplo n.º 4
0
 public void Delete(BillCodeRuleEntity entity)
 {
     service.Delete(entity);
 }