/// <summary>
 /// 获取指定Id记录
 /// </summary>
 /// <param name="id">主键Id</param>
 /// <param name="isCache">是否从缓存中读取</param>
 /// <returns>DataAccess.Model.OUT_BACK00</returns>
 public DataAccess.Model.OUT_BACK00 GetModel(long id, bool isCache = true)
 {
     //判断是否使用缓存
     if (CommonBll.IsUseCache() && isCache)
     {
         //从缓存中获取List
         var list = GetList();
         if (list == null)
         {
             return(null);
         }
         else
         {
             //在List查询指定主键Id的记录
             return(list.SingleOrDefault(x => x.Id == id));
         }
     }
     else
     {
         //从数据库中直接读取
         var model = OUT_BACK00.SingleOrDefault(x => x.Id == id);
         if (model == null)
         {
             return(null);
         }
         else
         {
             //对查询出来的实体进行转换
             return(Transform(model));
         }
     }
 }
        /// <summary>
        /// 加载主表明细数据
        /// </summary>
        public void LoadMAIN()
        {
            string _tbxBK_ID = tbxBK_ID.Text;

            if (!String.IsNullOrEmpty(_tbxBK_ID))
            {
                var model = new OUT_BACK00(x => x.BK_ID == _tbxBK_ID);
                ddlSHOP_NAME.SelectedValue = model.SHOP_ID;
                dpINPUT_DATE.SelectedDate  = model.INPUT_DATE;
                ddlStatus.SelectedValue    = model.STATUS.ToString();
                ddlIN_SHOP.SelectedValue   = model.IN_SHOP;
                ddlSTOCK_ID.SelectedValue  = model.STOCK_ID;
                tbxUSER_ID.Text            = model.USER_ID;
                tbxAPP_USER.Text           = model.APP_USER;
                tbxAPP_DATETIME.Text       = model.APP_DATETIME.ToString("yyyy-MM-dd HH:mm:ss") == "1900-01-01 00:00:00" ? "" : model.APP_DATETIME.ToString("yyyy-MM-dd HH:mm:ss");
                cbExported.Checked         = model.Exported == 1 ? true : false;
                tbxExported_ID.Text        = model.Exported_ID;
                tbxRELATE_ID.Text          = model.RELATE_ID;
                tbxMemo.Text     = model.Memo;
                ckLOCKED.Checked = model.LOCKED == 0 ? false : true;


                tbxCRT_DATETIME.Text = model.CRT_DATETIME.ToString();
                tbxCRT_USER_ID.Text  = model.CRT_USER_ID;
                tbxMOD_DATETIME.Text = model.MOD_DATETIME.ToString();
                tbxMOD_USER_ID.Text  = model.MOD_USER_ID;
                tbxLAST_UPDATE.Text  = model.LAST_UPDATE.ToString();
                OrderStatus(model);
            }
        }
        /// <summary>
        /// 将OUT_BACK00记录实体(SubSonic实体)转换为普通的实体(DataAccess.Model.OUT_BACK00)
        /// </summary>
        /// <param name="model">SubSonic插件生成的实体</param>
        /// <returns>DataAccess.Model.OUT_BACK00</returns>
        public DataAccess.Model.OUT_BACK00 Transform(OUT_BACK00 model)
        {
            if (model == null)
            {
                return(null);
            }

            return(new DataAccess.Model.OUT_BACK00
            {
                Id = model.Id,
                SHOP_ID = model.SHOP_ID,
                BK_ID = model.BK_ID,
                STATUS = model.STATUS,
                INPUT_DATE = model.INPUT_DATE,
                IN_SHOP = model.IN_SHOP,
                STOCK_ID = model.STOCK_ID,
                USER_ID = model.USER_ID,
                APP_USER = model.APP_USER,
                APP_DATETIME = model.APP_DATETIME,
                RELATE_ID = model.RELATE_ID,
                Exported = model.Exported,
                Exported_ID = model.Exported_ID,
                Memo = model.Memo,
                LOCKED = model.LOCKED,
                CRT_DATETIME = model.CRT_DATETIME,
                CRT_USER_ID = model.CRT_USER_ID,
                MOD_DATETIME = model.MOD_DATETIME,
                MOD_USER_ID = model.MOD_USER_ID,
                LAST_UPDATE = model.LAST_UPDATE,
                Trans_STATUS = model.Trans_STATUS,
            });
        }
        /// <summary>
        /// 从IIS缓存中获取指定Id记录
        /// </summary>
        /// <param name="id">主键Id</param>
        /// <returns>DataAccess.Model.OUT_BACK00</returns>
        public DataAccess.Model.OUT_BACK00 GetModelForCache(long id)
        {
            try
            {
                //从缓存中读取指定Id记录
                var model = GetModelForCache(x => x.Id == id);

                if (model == null)
                {
                    //从数据库中读取
                    var tem = OUT_BACK00.SingleOrDefault(x => x.Id == id);
                    if (tem == null)
                    {
                        return(null);
                    }
                    else
                    {
                        //对查询出来的实体进行转换
                        model = Transform(tem);
                        return(model);
                    }
                }
                else
                {
                    return(model);
                }
            }
            catch (Exception e)
            {
                //记录日志
                CommonBll.WriteLog("从IIS缓存中获取OUT_BACK00表记录时出现异常", e);

                return(null);
            }
        }
        /// <summary>
        /// 添加与编辑OUT_BACK00记录
        /// </summary>
        /// <param name="page">当前页面指针</param>
        /// <param name="model">OUT_BACK00表实体</param>
        /// <param name="content">更新说明</param>
        /// <param name="isCache">是否更新缓存</param>
        /// <param name="isAddUseLog">是否添加用户操作日志</param>
        public void Save(Page page, OUT_BACK00 model, string content = null, bool isCache = true, bool isAddUseLog = true)
        {
            try {
                //保存
                model.Save();

                //判断是否启用缓存
                if (CommonBll.IsUseCache() && isCache)
                {
                    SetModelForCache(model);
                }

                if (isAddUseLog)
                {
                    if (string.IsNullOrEmpty(content))
                    {
                        content = "{0}" + (model.Id == 0 ? "添加" : "编辑") + "OUT_BACK00记录成功,ID为【" + model.Id + "】";
                    }

                    //添加用户访问记录
                    UseLogBll.GetInstence().Save(page, content);
                }
            }
            catch (Exception e) {
                var result = "执行OUT_BACK00Bll.Save()函数出错!";

                //出现异常,保存出错日志信息
                CommonBll.WriteLog(result, e);
            }
        }
        /// <summary>
        /// 订单为存档,核准,作废的状态判定
        /// </summary>
        /// <param name="model"></param>
        public void OrderStatus2(OUT_BACK00 model)
        {
            //1:存档 2:核准 3:作废 4:已引入
            //新增:ButtonAdd 保存:ButtonSave 更新:ButtonUpdate 核准:ButtonCheck 作废:ButtonCancel
            //Pur02新增:ButtonPur02Add
            Grid2ColumnEdit(model.STATUS);
            switch (model.STATUS)
            {
            case 1:
                ButtonSave.Enabled   = true;
                ButtonCancel.Enabled = true;
                ButtonCheck.Enabled  = true;
                ButtonCheck.Text     = "核准";
                ButtonCancel.Text    = "作废";
                Toolbar21111.Enabled = true; break;

            case 2:
                ButtonSave.Enabled   = false;
                ButtonCheck.Text     = "反核准";
                ButtonCancel.Text    = "作废";
                ButtonCancel.Enabled = false;
                ButtonCheck.Enabled  = true;
                Toolbar21111.Enabled = false;
                Grid2.Enabled        = false;
                break;

            case 3:
                ButtonSave.Enabled   = false;
                ButtonCheck.Text     = "核准";
                ButtonCheck.Enabled  = false;
                ButtonCancel.Text    = "取消作废";
                ButtonCancel.Enabled = true;
                Toolbar21111.Enabled = false;
                break;

            case 4:
                ButtonSave.Enabled   = false;
                ButtonCheck.Text     = "反核准";
                ButtonCancel.Text    = "作废";
                ButtonCancel.Enabled = false;
                ButtonCheck.Enabled  = false;
                Toolbar21111.Enabled = false; break;

            case 5:
                ButtonSave.Enabled   = false;
                ButtonCancel.Enabled = false;
                ButtonCheck.Enabled  = false;
                Toolbar21111.Enabled = false; break;

            default:
                ButtonSave.Enabled   = false;
                ButtonCheck.Text     = "核准";
                ButtonCancel.Text    = "作废";
                ButtonCancel.Enabled = false;
                ButtonCheck.Enabled  = false;
                Toolbar21111.Enabled = false; break;
            }
        }
Example #7
0
        /// <summary>
        /// 主表保存
        /// </summary>
        /// <returns></returns>
        public string MAINEdit()
        {
            string _IB_ID = tbxIB_ID.Text;

            try
            {
                var    model    = new IN_BACK00(x => x.IB_ID == _IB_ID);
                var    OlUser   = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                string _SHOP_ID = ddlSHOP_NAME.SelectedValue;
                if (String.IsNullOrEmpty(_IB_ID))
                {
                    model.SetIsNew(true);
                    model.CRT_DATETIME = DateTime.Now;
                    model.CRT_USER_ID  = OlUser.Manager_LoginName;
                    DataTable dt = new DataTable();
                    dt     = (DataTable)SPs.Get_ORDER_SEED(_SHOP_ID, "IN_BACK00").ExecuteDataTable();
                    _IB_ID = dt.Rows[0]["PLANE_ID"].ToString();
                    //var model = Purchase00.SingleOrDefault(x => x.Purchase_ID == _Pur00_id);
                    tbxIB_ID.Text = _IB_ID;
                }
                model.SHOP_ID    = _SHOP_ID;
                model.IB_ID      = _IB_ID.ToString();
                model.STATUS     = ConvertHelper.Cint(ddlStatus.SelectedValue);
                model.INPUT_DATE = ConvertHelper.StringToDatetime(dpINPUT_DATE.SelectedDate.ToString());

                model.OUT_SHOP     = ddlOUT_SHOP.SelectedValue;
                model.STOCK_ID     = ddlSTOCK_ID.SelectedValue;
                model.USER_ID      = OlUser.Manager_LoginName;
                model.APP_USER     = OlUser.Manager_LoginName;
                model.APP_DATETIME = tbxAPP_DATETIME.Text == "" ? DateTime.Parse("1900-01-01 00:00:00") : DateTime.Now;


                string _RELATE_ID = tbxRELATE_ID.Text;
                model.RELATE_ID = _RELATE_ID;
                if (!String.IsNullOrEmpty(_RELATE_ID))
                {
                    var modelOrder = new OUT_BACK00(x => x.BK_ID == _RELATE_ID);
                    modelOrder.Exported    = 1;
                    modelOrder.Exported_ID = _IB_ID;
                    modelOrder.Save();
                }
                model.Memo   = tbxMemo.Text;
                model.LOCKED = ConvertHelper.StringToByte(ckLOCKED.Checked ? "1" : "0");

                model.MOD_DATETIME = DateTime.Now;
                model.MOD_USER_ID  = OlUser.Manager_LoginName;
                model.LAST_UPDATE  = DateTime.Now;
                model.Trans_STATUS = 0;
                IN_BACK00Bll.GetInstence().Save(this, model);
            }
            catch (Exception err)
            {
                return(err.Message);
            }
            LoadMAIN(_IB_ID);
            return("");
        }
        /// <summary>
        /// 核准按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Btn_MainCheck(Object sender, EventArgs e)
        {
            string _BK_ID = tbxBK_ID.Text.ToString();
            var    model  = OUT_BACK00.SingleOrDefault(x => x.BK_ID == _BK_ID);

            if (model == null)
            {
                FineUI.Alert.ShowInParent("订单单号不存在", FineUI.MessageBoxIcon.Information);
                return;
            }

            if (model.STATUS == 1)
            {
                DataTable dsCom   = (DataTable)SPs.Get_MAX_Inventory_DATE().ExecuteDataTable();
                DateTime  dtInput = DateTime.Parse(dsCom.Rows[0]["INPUT_DATE"].ToString());
                if (model.INPUT_DATE.CompareTo(dtInput) <= 0)
                {
                    FineUI.Alert.ShowInParent("单据小于盘点日期,不允许盘点。盘点日期为:" + dsCom.Rows[0]["INPUT_DATE"].ToString() + "", FineUI.MessageBoxIcon.Information);
                    return;
                }
            }
            //1 = 存档 2 = 核准 3 = 作废 4 = 已引入(供应商进货)
            switch (model.STATUS)
            {
            case 1: model.STATUS = 2; break;

            case 2: model.STATUS = 1; break;

            case 3: FineUI.Alert.ShowInParent("订单已作废,无法进行核准", FineUI.MessageBoxIcon.Information); return;

            case 4: FineUI.Alert.ShowInParent("订单已引入,无法进行核准", FineUI.MessageBoxIcon.Information); return;

            default: FineUI.Alert.ShowInParent("订单状态有误,无法核准", FineUI.MessageBoxIcon.Information); return;
            }

            ddlStatus.SelectedValue = model.STATUS.ToString();

            string result = DetailEdit();

            if (String.IsNullOrEmpty(result))
            {
                result = MAINEdit();
            }
            if (!String.IsNullOrEmpty(result))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error);
            }
            else
            {
                FineUI.Alert.ShowInParent("保存成功", FineUI.MessageBoxIcon.Error);
            }

            LoadMAIN();
            LoadDETAIL();
            //FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error);
            //FineUI.Alert.ShowInParent("核准成功", FineUI.MessageBoxIcon.Information);
        }
        /// <summary>
        /// 判断指定主键Id的记录是否存在——在IIS缓存或数据库中查找
        /// </summary>
        /// <param name="id">主键Id</param>
        /// <returns></returns>
        public bool Exist(int id)
        {
            if (id <= 0)
            {
                return(false);
            }

            //判断是否启用缓存
            if (CommonBll.IsUseCache())
            {
                return(Exist(x => x.Id == id));
            }

            //从数据库中查找
            return(OUT_BACK00.Exists(x => x.Id == id));
        }
        /// <summary>
        /// 作废按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Btn_MainCancel(Object sender, EventArgs e)
        {
            string _BK_ID = tbxBK_ID.Text.ToString();
            var    model  = OUT_BACK00.SingleOrDefault(x => x.BK_ID == _BK_ID);

            if (model == null)
            {
                FineUI.Alert.ShowInParent("订单单号不存在", FineUI.MessageBoxIcon.Information);
            }
            //1 = 存档 2 = 核准 3 = 作废 4 = 已引入(供应商进货)
            switch (model.STATUS)
            {
            case 1: model.STATUS = 3; break;

            case 2: FineUI.Alert.ShowInParent("订单已核准,无法进行作废", FineUI.MessageBoxIcon.Information); return;

            case 3: model.STATUS = 1; break;

            case 4: FineUI.Alert.ShowInParent("订单已引入,无法进行作废", FineUI.MessageBoxIcon.Information); return;

            default: FineUI.Alert.ShowInParent("订单状态有误,无法进行作废", FineUI.MessageBoxIcon.Information); return;
            }
            ddlStatus.SelectedValue = model.STATUS.ToString();

            string result = DetailEdit();

            if (String.IsNullOrEmpty(result))
            {
                result = MAINEdit();
            }
            if (!String.IsNullOrEmpty(result))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error);
            }
            else
            {
                string alterMssage = ButtonCancel.Text;
                if (alterMssage == "取消作废")
                {
                    FineUI.Alert.ShowInParent("作废成功", FineUI.MessageBoxIcon.Error);
                }
                else
                {
                    FineUI.Alert.ShowInParent("取消作废成功", FineUI.MessageBoxIcon.Error);
                }
            }
        }
        /// <summary>
        /// 获取数据表中的某个值——从数据库中查询,如果使用了缓存,删除成功后会清空本表的所有缓存记录,然后重新加载进缓存
        /// </summary>
        /// <param name="page">当前页面指针</param>
        /// <param name="expression">条件语句</param>
        /// <param name="isAddUseLog">是否添加用户操作日志</param>
        public void Delete(Page page, Expression <Func <OUT_BACK00, bool> > expression, bool isAddUseLog = true)
        {
            //执行删除
            OUT_BACK00.Delete(expression);

            //判断是否启用缓存
            if (CommonBll.IsUseCache())
            {
                //清空当前表所有缓存记录
                DelAllCache();
                //重新载入缓存
                GetList();
            }

            if (isAddUseLog)
            {
                //添加用户操作记录
                UseLogBll.GetInstence().Save(page, "{0}删除了OUT_BACK00表记录!");
            }
        }
Example #12
0
        /// <summary>
        /// 订单未引入出货单的情况
        /// </summary>
        /// <param name="model"></param>
        public void OrderStatus1(IN_BACK00 model)
        {
            var _IB_ID = model.IB_ID;
            var model2 = new OUT_BACK00(x => x.Exported_ID == _IB_ID);

            if (model2.Id > 0)
            {
                Grid2ColumnEdit(2);
                ButtonYR.Text        = "取消引入";
                Toolbar21111.Enabled = false;
                return;
            }
            else
            {
                ButtonYR.Text = "引入";
                Grid2ColumnEdit(1);
                Toolbar21111.Enabled = true;
                return;
            }
        }
 /// <summary>
 /// 状态位的判定
 /// </summary>
 /// <param name="status"></param>
 public void OrderStatus(OUT_BACK00 model)
 {
     OrderStatus2(model);
 }
        /// <summary>
        /// 从IIS缓存中获取OUT_BACK00表记录
        /// </summary>
        /// <param name="isCache">是否从缓存中读取</param>
        public IList <DataAccess.Model.OUT_BACK00> GetList(bool isCache = true)
        {
            try
            {
                //判断是否使用缓存
                if (CommonBll.IsUseCache() && isCache)
                {
                    //检查指定缓存是否过期——缓存当天有效,第二天自动清空
                    if (CommonBll.CheckCacheIsExpired(const_CacheKey_Date))
                    {
                        //删除缓存
                        DelAllCache();
                    }

                    //从缓存中获取DataTable
                    var obj = CacheHelper.GetCache(const_CacheKey);
                    //如果缓存为null,则查询数据库
                    if (obj == null)
                    {
                        var list = GetList(false);

                        //将查询出来的数据存储到缓存中
                        CacheHelper.SetCache(const_CacheKey, list);
                        //存储当前时间
                        CacheHelper.SetCache(const_CacheKey_Date, DateTime.Now);

                        return(list);
                    }
                    //缓存中存在数据,则直接返回
                    else
                    {
                        return((IList <DataAccess.Model.OUT_BACK00>)obj);
                    }
                }
                else
                {
                    //定义临时实体集
                    IList <DataAccess.Model.OUT_BACK00> list = null;

                    //获取全表缓存加载条件表达式
                    var exp = GetExpression <OUT_BACK00>();
                    //如果条件为空,则查询全表所有记录
                    if (exp == null)
                    {
                        //从数据库中获取所有记录
                        var all = OUT_BACK00.All();
                        list = all == null ? null : Transform(all.ToList());
                    }
                    else
                    {
                        //从数据库中查询出指定条件的记录,并转换为指定实体集
                        var all = OUT_BACK00.Find(exp);
                        list = all == null ? null : Transform(all);
                    }

                    return(list);
                }
            }
            catch (Exception e)
            {
                //记录日志
                CommonBll.WriteLog("从IIS缓存中获取OUT_BACK00表记录时出现异常", e);
            }

            return(null);
        }
        ///// <summary>
        ///// 修改按钮
        ///// </summary>
        //public void Btn_MainEdit(Object sender, EventArgs e)
        //{
        //    string result = DetailEdit();
        //    if (String.IsNullOrEmpty(result))
        //    {
        //        result = MAINEdit();
        //    }
        //    if (!String.IsNullOrEmpty(result))
        //    {
        //        FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error);
        //    }
        //    else
        //    {
        //        FineUI.Alert.ShowInParent("修改成功", FineUI.MessageBoxIcon.Error);
        //    }
        //}

        /// <summary>
        /// 核准按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Btn_MainCheck(Object sender, EventArgs e)
        {
            string _BK_ID     = tbxBK_ID.Text.ToString();
            var    model      = OUT_BACK00.SingleOrDefault(x => x.BK_ID == _BK_ID);
            int    out_status = model.STATUS;

            if (model == null)
            {
                FineUI.Alert.ShowInParent("订单单号不存在", FineUI.MessageBoxIcon.Information);
                return;
            }

            if (model.STATUS == 1)
            {
                DataTable dsCom   = (DataTable)SPs.Get_MAX_Inventory_DATE().ExecuteDataTable();
                DateTime  dtInput = DateTime.Parse(dsCom.Rows[0]["INPUT_DATE"].ToString());
                if (model.INPUT_DATE.CompareTo(dtInput) <= 0)
                {
                    FineUI.Alert.ShowInParent("单据小于盘点日期,不允许盘点。盘点日期为:" + dsCom.Rows[0]["INPUT_DATE"].ToString() + "", FineUI.MessageBoxIcon.Information);
                    return;
                }
            }
            //1 = 存档 2 = 核准 3 = 作废 4 = 已引入(供应商进货)
            switch (model.STATUS)
            {
            case 1: model.STATUS = 2; break;

            case 2: model.STATUS = 1; break;

            case 3: FineUI.Alert.ShowInParent("订单已作废,无法进行核准", FineUI.MessageBoxIcon.Information); return;

            case 4: FineUI.Alert.ShowInParent("订单已引入,无法进行核准", FineUI.MessageBoxIcon.Information); return;

            default: FineUI.Alert.ShowInParent("订单状态有误,无法核准", FineUI.MessageBoxIcon.Information); return;
            }

            ddlStatus.SelectedValue = model.STATUS.ToString();

            string result = DetailEdit();

            if (String.IsNullOrEmpty(result))
            {
                tbxAPP_DATETIME.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                result = MAINEdit();
            }

            if (String.IsNullOrEmpty(result))
            {
                //dsCom = (DataSet)SPs.Get_Purchase00(st, et, type).ExecuteDataSet();
                if (out_status == 2)
                {
                    SPs.Update_out_back00_stock01(_BK_ID).Execute();
                }
                else
                {
                    SPs.Update_out_back00_stock01_cancel(_BK_ID).Execute();
                }
            }

            if (!String.IsNullOrEmpty(result))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error);
            }
            else
            {
                string alterMssage = ButtonCheck.Text;
                if (alterMssage == "反核准")
                {
                    FineUI.Alert.ShowInParent("核准成功", FineUI.MessageBoxIcon.Error);
                }
                else
                {
                    FineUI.Alert.ShowInParent("取消核准成功", FineUI.MessageBoxIcon.Error);
                }
            }
            //FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Error);
            //FineUI.Alert.ShowInParent("核准成功", FineUI.MessageBoxIcon.Information);
        }
 /// <summary>
 /// 更新IIS缓存中指定Id记录
 /// </summary>
 /// <param name="model">记录实体</param>
 public void SetModelForCache(OUT_BACK00 model)
 {
     SetModelForCache(Transform(model));
 }
        /// <summary>
        /// 从IIS缓存中获取指定Id记录
        /// </summary>
        /// <param name="conditionColName">条件列名</param>
        /// <param name="value">条件值</param>
        /// <returns>DataAccess.Model.OUT_BACK00</returns>
        public DataAccess.Model.OUT_BACK00 GetModelForCache(string conditionColName, object value)
        {
            try
            {
                //从缓存中获取List
                var list = GetList();
                DataAccess.Model.OUT_BACK00           model      = null;
                Expression <Func <OUT_BACK00, bool> > expression = null;

                //返回指定条件的实体
                switch (conditionColName)
                {
                case "Id":
                    model      = list.SingleOrDefault(x => x.Id == (int)value);
                    expression = x => x.Id == (int)value;
                    break;

                case "SHOP_ID":
                    model      = list.SingleOrDefault(x => x.SHOP_ID == (string)value);
                    expression = x => x.SHOP_ID == (string)value;
                    break;

                case "BK_ID":
                    model      = list.SingleOrDefault(x => x.BK_ID == (string)value);
                    expression = x => x.BK_ID == (string)value;
                    break;

                case "STATUS":
                    model      = list.SingleOrDefault(x => x.STATUS == (int)value);
                    expression = x => x.STATUS == (int)value;
                    break;

                case "INPUT_DATE":
                    model      = list.SingleOrDefault(x => x.INPUT_DATE == (DateTime)value);
                    expression = x => x.INPUT_DATE == (DateTime)value;
                    break;

                case "IN_SHOP":
                    model      = list.SingleOrDefault(x => x.IN_SHOP == (string)value);
                    expression = x => x.IN_SHOP == (string)value;
                    break;

                case "STOCK_ID":
                    model      = list.SingleOrDefault(x => x.STOCK_ID == (string)value);
                    expression = x => x.STOCK_ID == (string)value;
                    break;

                case "USER_ID":
                    model      = list.SingleOrDefault(x => x.USER_ID == (string)value);
                    expression = x => x.USER_ID == (string)value;
                    break;

                case "APP_USER":
                    model      = list.SingleOrDefault(x => x.APP_USER == (string)value);
                    expression = x => x.APP_USER == (string)value;
                    break;

                case "APP_DATETIME":
                    model      = list.SingleOrDefault(x => x.APP_DATETIME == (DateTime)value);
                    expression = x => x.APP_DATETIME == (DateTime)value;
                    break;

                case "RELATE_ID":
                    model      = list.SingleOrDefault(x => x.RELATE_ID == (string)value);
                    expression = x => x.RELATE_ID == (string)value;
                    break;

                case "Exported":
                    model      = list.SingleOrDefault(x => x.Exported == (byte)value);
                    expression = x => x.Exported == (byte)value;
                    break;

                case "Exported_ID":
                    model      = list.SingleOrDefault(x => x.Exported_ID == (string)value);
                    expression = x => x.Exported_ID == (string)value;
                    break;

                case "Memo":
                    model      = list.SingleOrDefault(x => x.Memo == (string)value);
                    expression = x => x.Memo == (string)value;
                    break;

                case "LOCKED":
                    model      = list.SingleOrDefault(x => x.LOCKED == (byte)value);
                    expression = x => x.LOCKED == (byte)value;
                    break;

                case "CRT_DATETIME":
                    model      = list.SingleOrDefault(x => x.CRT_DATETIME == (DateTime)value);
                    expression = x => x.CRT_DATETIME == (DateTime)value;
                    break;

                case "CRT_USER_ID":
                    model      = list.SingleOrDefault(x => x.CRT_USER_ID == (string)value);
                    expression = x => x.CRT_USER_ID == (string)value;
                    break;

                case "MOD_DATETIME":
                    model      = list.SingleOrDefault(x => x.MOD_DATETIME == (DateTime)value);
                    expression = x => x.MOD_DATETIME == (DateTime)value;
                    break;

                case "MOD_USER_ID":
                    model      = list.SingleOrDefault(x => x.MOD_USER_ID == (string)value);
                    expression = x => x.MOD_USER_ID == (string)value;
                    break;

                case "LAST_UPDATE":
                    model      = list.SingleOrDefault(x => x.LAST_UPDATE == (DateTime)value);
                    expression = x => x.LAST_UPDATE == (DateTime)value;
                    break;

                case "Trans_STATUS":
                    model      = list.SingleOrDefault(x => x.Trans_STATUS == (byte)value);
                    expression = x => x.Trans_STATUS == (byte)value;
                    break;

                default:
                    return(null);
                }

                if (model == null)
                {
                    //从数据库中读取
                    var tem = OUT_BACK00.SingleOrDefault(expression);
                    if (tem == null)
                    {
                        return(null);
                    }
                    else
                    {
                        //对查询出来的实体进行转换
                        model = Transform(tem);

                        return(model);
                    }
                }
                else
                {
                    return(model);
                }
            }
            catch (Exception e)
            {
                //记录日志
                CommonBll.WriteLog("从IIS缓存中获取OUT_BACK00表记录时出现异常", e);

                return(null);
            }
        }