/// <summary> /// 新增数据的判断 /// </summary> /// <param name="dr"></param> /// <param name="tran"></param> /// <returns></returns> private bool CheckInsertData(DataRow dr, DbTransaction tran, out string strInvalid) { bool flag = true; strInvalid = ""; switch (dr.Table.TableName.ToUpper()) { case "HC_ORD_PURCHASE": //订单明细状态表 flag = PurchaseCheck.GetInstance().CheckPurchaseForInsert(dr, out strInvalid); break; case "HC_ORD_PURCHASE_ITEM": //产品匹配表 flag = PurchaseCheck.GetInstance().CheckPurchaseItemForInsert(dr, out strInvalid); break; case "HC_ORD_ORDER": //订单表 flag = OrderCheck.GetInstance().CheckOrderForInsert(dr, out strInvalid); break; case "HC_ORD_ORDER_ITEM": //订单明细表 flag = OrderCheck.GetInstance().CheckOrderItemForInsert(dr, out strInvalid); break; default: break; } return(flag); }
/// <summary> /// 删除数据的判断 /// </summary> /// <param name="dr"></param> /// <param name="tran"></param> /// <returns></returns> private bool CheckDeleteData(DataRow dr, DbTransaction tran, out string strInvalid) { bool flag = true; strInvalid = ""; switch (dr["Table_Name"].ToString().ToUpper()) { case "HC_ORD_PURCHASE": flag = PurchaseCheck.GetInstance().CheckPurchaseForDelete(dr, out strInvalid); break; case "HC_ORD_PURCHASE_ITEM": flag = PurchaseCheck.GetInstance().CheckPurchaseItemForDelete(dr, out strInvalid); break; } return(flag); }