public void SubmitForm(BillCodeRuleEntity entity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { entity.Modify(keyValue); service.Update(entity); } else { entity.Create(); service.Insert(entity); } }
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); }
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); }
public void Delete(BillCodeRuleEntity entity) { service.Delete(entity); }