Exemplo n.º 1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="paramModel">UIModel</param>
        /// <returns></returns>
        public bool SaveDetailDS(MerchantAuthorityQueryUIModel paramModel)
        {
            //服务端检查
            if (!ServerCheck(paramModel))
            {
                return(false);
            }

            #region 事务,多数据表操作

            //将UIModel转为TBModel
            var argsAROrgSupMerchantAuthority = CopyModel <MDLSM_AROrgSupMerchantAuthority>(paramModel);

            #region 新增
            //判断主键是否被赋值
            if (string.IsNullOrEmpty(argsAROrgSupMerchantAuthority.ASAH_ID))
            {
                //生成新ID
                argsAROrgSupMerchantAuthority.ASAH_ID          = Guid.NewGuid().ToString();
                argsAROrgSupMerchantAuthority.ASAH_CreatedBy   = LoginInfoDAX.UserName;
                argsAROrgSupMerchantAuthority.ASAH_CreatedTime = BLLCom.GetCurStdDatetime();
                argsAROrgSupMerchantAuthority.ASAH_UpdatedBy   = LoginInfoDAX.UserName;
                argsAROrgSupMerchantAuthority.ASAH_UpdatedTime = BLLCom.GetCurStdDatetime();
                //主键未被赋值,则执行新增
                if (!_bll.Insert(argsAROrgSupMerchantAuthority))
                {
                    //新增[汽修商户授权]信息失败
                    ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.ADD + SystemTableEnums.Name.SM_AROrgSupMerchantAuthority });
                    return(false);
                }
            }
            #endregion

            #region 更新
            else
            {
                //主键被赋值,则需要更新,更新需要设定更新条件
                argsAROrgSupMerchantAuthority.WHERE_ASAH_ID        = argsAROrgSupMerchantAuthority.ASAH_ID;
                argsAROrgSupMerchantAuthority.WHERE_ASAH_VersionNo = argsAROrgSupMerchantAuthority.ASAH_VersionNo;
                argsAROrgSupMerchantAuthority.ASAH_VersionNo++;

                argsAROrgSupMerchantAuthority.ASAH_UpdatedBy   = LoginInfoDAX.UserName;
                argsAROrgSupMerchantAuthority.ASAH_UpdatedTime = BLLCom.GetCurStdDatetime();
                if (!_bll.Update(argsAROrgSupMerchantAuthority))
                {
                    //更新[汽修商户授权]信息失败
                    ResultMsg = MsgHelp.GetMsg(MsgCode.E_0010, new object[] { MsgParam.UPDATE + SystemTableEnums.Name.SM_AROrgSupMerchantAuthority });
                    return(false);
                }
            }
            #endregion

            //将最新数据回写给DetailDS
            CopyModel(argsAROrgSupMerchantAuthority, paramModel);

            #endregion

            return(true);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 服务端检查
 /// </summary>
 /// <param name="paramModel">UIModel</param>
 /// <returns></returns>
 private bool ServerCheck(MerchantAuthorityQueryUIModel paramModel)
 {
     return(true);
 }