Beispiel #1
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <returns></returns>
        private string SaveData()
        {
            try
            {
                if (string.IsNullOrEmpty(Post("OID")))
                {
                    return("主键不能为空!");
                }

                Loan_project_head model = new Loan_project_head();
                model.OID = Post("OID");
                ds.RetrieveObject(model);

                #region 发送信息核对信息

                string strMsgOid = string.Empty;
                if (model.CHECK_MSG_ID.Length == 0)
                {
                    strMsgOid = SendMsg(model.SEQ_NO);
                }
                else
                {
                    //删除相关信息数据
                    string strDelMsgSql      = string.Format("DELETE FROM MESSGE_INFO WHERE OID = '{0}' ", model.CHECK_MSG_ID);
                    string strDelMsg_ListSql = string.Format("DELETE FROM MESSGE_ACCPTER WHERE MSG_OID = '{0}' ", model.CHECK_MSG_ID);
                    ds.ExecuteTxtNonQuery(strDelMsgSql);
                    ds.ExecuteTxtNonQuery(strDelMsg_ListSql);
                    //重新发送信息
                    strMsgOid = SendMsg(model.SEQ_NO);
                }

                #endregion 发送信息核对信息

                #region 保存信息核对

                if (strMsgOid.Length > 0)
                {
                    //清除核对信息
                    model.CHECK_START   = Post("CHECK_START");
                    model.CHECK_END     = Post("CHECK_END");
                    model.CHECK_IS_SEND = CValue.FLAG_Y;
                    model.CHECK_MSG_ID  = strMsgOid;
                    model.CHECK_OP_CODE = user.User_Id;
                    model.CHECK_OP_NAME = user.User_Name;
                    model.CHECK_OP_TIME = GetDateLongFormater();
                    ds.UpdateObject(model);
                }

                #endregion 保存信息核对

                return(string.Empty);
            }
            catch (Exception ex)
            {
                LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "保存贷款项目数据,出错:" + ex.ToString());
                return("保存失败!");
            }
        }
Beispiel #2
0
        /// <summary>
        /// 校验是否有核对信息
        /// </summary>
        /// <returns></returns>
        private string ChkCheckData()
        {
            if (string.IsNullOrEmpty(Get("id")))
            {
                return("贷款项目主键不能为空!");
            }
            Loan_project_head head = new Loan_project_head();

            head.OID = Get("id");
            ds.RetrieveObject(head);
            if (head == null)
            {
                return("贷款项目信息不能为空!");
            }
            if (string.IsNullOrEmpty(head.CHECK_START))
            {
                return("贷款项目核对信息未设置,不能发布公告!");
            }
            return(string.Empty);
        }
Beispiel #3
0
        /// <summary>
        /// 通过传入的主键编码删除数据
        /// </summary>
        /// <returns></returns>
        private string DeleteData()
        {
            try
            {
                if (string.IsNullOrEmpty(Get("id")))
                {
                    return("主键为空,不允许删除操作");
                }

                Loan_project_head model = new Loan_project_head();
                model.OID = Get("id");
                ds.RetrieveObject(model);
                //删除发布的核对信息
                Messge_info msg = new Messge_info();
                msg.OID = model.CHECK_MSG_ID;
                ds.RetrieveObject(msg);

                var transaction = ImplementFactory.GetDeleteTransaction <Messge_info>("Messge_infoDeleteTransaction");
                transaction.EntityList.Add(msg);
                if (transaction.Commit())
                {
                    //清除核对信息
                    model.CHECK_START   = "";
                    model.CHECK_END     = "";
                    model.CHECK_IS_SEND = "";
                    model.CHECK_MSG_ID  = "";
                    model.CHECK_OP_CODE = "";
                    model.CHECK_OP_NAME = "";
                    model.CHECK_OP_TIME = "";
                    ds.UpdateObject(model);
                }
                return(string.Empty);
            }
            catch (Exception ex)
            {
                LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "删除贷款项目数据,出错:" + ex.ToString());
                return("删除失败!");
            }
        }