protected override void DoSaveOrUpdate(Feng.IRepository rep, 换汇 entity) { if (entity.出款金额.币制编号.Equals(entity.入款金额.币制编号)) { throw new InvalidUserOperationException("换汇业务:" + Environment.NewLine + "出款币制与入款币制不可相同"); } base.DoSaveOrUpdate(rep, entity); }
protected override void DoSaveOrUpdate(Feng.IRepository rep, 换汇 entity) { 银行账户 ck_zh = Get银行账户(entity.出款账户编号); //出款账户 银行账户 rk_zh = Get银行账户(entity.入款账户编号); //入款账户 if (!ck_zh.币制编号.Equals(rk_zh.币制编号)) { throw new InvalidUserOperationException("转账业务:" + Environment.NewLine + "银行账户币制必须相同"); } entity.出款金额.币制编号 = entity.入款金额.币制编号 = ck_zh.币制编号; entity.入款金额 = entity.出款金额; base.DoSaveOrUpdate(rep, entity); }
public override void Unsubmit(Feng.IRepository rep, 车辆产值 entity) { IList <Hd.Model.费用> fy_List = rep.List <Hd.Model.费用>("from 费用 where 费用实体.ID = :费用实体ID", new Dictionary <string, object> { { "费用实体ID", entity.ID } }); if (fy_List.Count > 0) { //throw new InvalidUserOperationException("已撤销,但已登记费用,需关注!"); MessageForm.ShowWarning("已撤销,但已登记费用,需检查!"); } entity.Submitted = false; base.Update(rep, entity); }
public override void Submit(Feng.IRepository rep, 车辆产值 entity) { if (entity.任务.Count == 0) { throw new InvalidUserOperationException("产值没有包含任务"); } IList <任务> list = entity.任务; string strException = null; foreach (任务 item in list) { strException += GetExceptionString(item) + System.Environment.NewLine; } if (!string.IsNullOrEmpty(strException.Trim())) { throw new InvalidUserOperationException(strException); } entity.Submitted = true; base.Update(rep, entity); }