/// <summary>
        /// 添加与编辑ORDER00记录
        /// </summary>
        /// <param name="page">当前页面指针</param>
        /// <param name="model">ORDER00表实体</param>
        /// <param name="content">更新说明</param>
        /// <param name="isCache">是否更新缓存</param>
        /// <param name="isAddUseLog">是否添加用户操作日志</param>
        public void Save(Page page, ORDER00 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 ? "添加" : "编辑") + "ORDER00记录成功,ID为【" + model.Id + "】";
                    }

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

                //出现异常,保存出错日志信息
                CommonBll.WriteLog(result, e);
            }
        }
        /// <summary>
        /// 主表保存
        /// </summary>
        /// <returns></returns>
        public string MAINEdit()
        {
            string _OUT_ID = tbxOUT_ID.Text;

            try
            {
                var    model    = new OUT00(x => x.OUT_ID == _OUT_ID);
                var    OlUser   = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                string _SHOP_ID = ddlSHOP_NAME.SelectedValue;
                if (String.IsNullOrEmpty(_OUT_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, "OUT00").ExecuteDataTable();
                    _OUT_ID        = dt.Rows[0]["PLANE_ID"].ToString();
                    tbxOUT_ID.Text = _OUT_ID;
                    //var model = Purchase00.SingleOrDefault(x => x.Purchase_ID == _Pur00_id);
                }
                model.SHOP_ID    = _SHOP_ID;
                model.OUT_ID     = _OUT_ID.ToString();
                model.STATUS     = ConvertHelper.Cint(ddlStatus.SelectedValue);
                model.INPUT_DATE = ConvertHelper.StringToDatetime(dpINPUT_DATE.SelectedDate.ToString());

                model.IN_SHOP      = ddlIN_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;
                model.EXPECT_DATE  = ConvertHelper.StringToDatetime(dpEXPECT_DATE.SelectedDate.ToString());

                model.Exported    = ConvertHelper.StringToByte(cbExported.Checked ? "1" : "0");
                model.Exported_ID = tbxExported_ID.Text;
                string _RELATE_ID = tbxRELATE_ID.Text;
                model.RELATE_ID = _RELATE_ID;
                if (!String.IsNullOrEmpty(_RELATE_ID))
                {
                    var modelOrder = new ORDER00(x => x.ORDER_ID == _RELATE_ID);
                    modelOrder.EXPORTED = 1;
                    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;
                OUT00Bll.GetInstence().Save(this, model);
                LoadMAIN();
            }
            catch (Exception err)
            {
                return(err.Message);
            }
            return("");
        }