コード例 #1
0
        /// <summary>
        /// 获取插入状态的实体
        /// </summary>
        /// <param name="allotId"></param>
        /// <param name="cityId"></param>
        /// <param name="fxtcompanyId"></param>
        /// <param name="userName"></param>
        /// <param name="stateCode"></param>
        /// <param name="stateDate"></param>
        /// <param name="remark">说明</param>
        /// <returns></returns>
        public static DatAllotSurvey GetDatAllotSurveyInsertEntitie(long allotId, int cityId, int fxtcompanyId, string userName, int stateCode, DateTime stateDate, string remark = null)
        {
            DatAllotSurvey allotSurvey = new DatAllotSurvey
            {
                AllotId      = allotId,
                CityId       = cityId,
                FxtCompanyId = fxtcompanyId,
                UserName     = userName,
                CreateDate   = DateTime.Now,
                StateCode    = stateCode,
                StateDate    = stateDate,
                Remark       = remark
            };

            return(allotSurvey);
        }
コード例 #2
0
        /// <summary>
        /// 任务状态记录表插入信息
        /// </summary>
        /// <param name="allotId">任务ID</param>
        /// <param name="cityId">城市ID</param>
        /// <param name="fxtcompanyId">当前机构ID</param>
        /// <param name="userName">当前用户名</param>
        /// <param name="stateCode">当前状态ID</param>
        /// <param name="stateDate">当前状态更改时间</param>
        /// <param name="_db"></param>
        /// <param name="tran"></param>
        /// <returns></returns>
        public static bool InsertAllotSurvey(long allotId, int cityId, int fxtcompanyId, string userName, int stateCode, DateTime stateDate, DataBase _db = null, ITransaction tran = null)
        {
            DataBase db = new DataBase(_db);

            try
            {
                DatAllotSurvey allotSurvey = GetDatAllotSurveyInsertEntitie(allotId, cityId, fxtcompanyId, userName, stateCode, stateDate);
                db.DB.Create(allotSurvey, tran);
                db.Close();
                return(true);
            }
            catch (Exception ex)
            {
                db.Close();
                throw ex;
            }
        }